离散数学
一、用逻辑符号表达下列语句(论域为包含一切事物的集合)
1)过平面上的两个点,有且仅有一条直线通过。
解析: P ( x , y ) : x , y 是平面上的两个点, P_{(x, y)}: ~ \mathrm{x}, \mathrm{y} \text { 是平面上的两个点…
参考程序:
#include <cstdio>
#include <map>
using namespace std;
const int N 2e5 5;
int n;
char s[N];
map <int, int> m;
long long ans;int main() {scanf("%d", &n);scanf("%s", s 1);int v 0;m[v]; // 初…