meaning of the title
Find how many elements belong to the set of $1 \sim N $
R1 = {(x, y): X and Y belong to B, X is not a subset of Y, y is not a subset of X, the intersection of X and Y is equal to the empty set}
R2 = {(x, y): X and Y belong to B, X is not a subset of Y, y is not a subset of X, the intersection of X and Y is not equal to the empty set}
Sol
Fairy story, Orz
It took me two hours to push it out
First, violence
violence
/* */ #include<iostream> #include<cstdio> #include<cstring> //#define int long long #define LL int const int MAXN = 1001; using namespace std; inline int read() { char c = getchar(); int x = 0, f = 1; while(c < '0' || c > '9') {if(c == '-') f = -1; c = getchar();} while(c >= '0' && c <= '9') x = x * 10 + c - '0', c = getchar(); return x * f; } int N; int C[MAXN][MAXN], Po2[MAXN]; main() { cin >> N; Po2[0] = 1; for(int i = 1; i <= 1000; i++) Po2[i] = 2 * Po2[i - 1]; C[0][0] = 1; for(int i = 1; i <= 1000; i++) { C[i][0] = 1; for(int j = 1; j <= i; j++) C[i][j] = C[i - 1][j - 1] + C[i - 1][j]; } int ans = 0; for(int i = 1; i <= N - 1; i++) { int now = C[N][i], sum = 0; for(int j = 1; j <= N - i; j++) sum += C[N - i][j]; //ans += now * sum; ans += now * (Po2[N - i] - 1); } cout << ans / 2 << " "; ans = 0; for(int i = 2; i <= N - 1; i++) { int res1 = C[N][i], sum1 = 0; for(int j = 1; j <= i - 1; j++) { int res2 = C[i][j], sum2 = 0; for(int k = 1; k <= N - i; k++) { sum2 += C[N - i][k]; } sum1 += res2 * sum2; } ans += res1 * sum1; } cout << ans / 2; return 0; } /* 100 50 10000006 */