#include<bits/stdc++.h> #define int long long #define debug usingnamespace std;
constint N = 1e7+66, mod = 998244353;
inlineintread(){ int s = 0, f = 1; char ch; while(!isdigit(ch = getchar())) (ch == '-') && (f = -f); for(s = ch ^ 48;isdigit(ch = getchar()); s = (s << 1) + (s << 3) + (ch ^ 48)); return s * f; }
int x, y, z, t; int js[N];
inlineintksm(int a, int b){ if (!b) return1; if (b&1) return a*ksm(a,b-1); int tmp = ksm(a, b/2)%mod; return tmp*tmp%mod; } //这个快速幂我没有测 inlineintC(int n, int m){ if (n < m) return0; return js[n]*ksm(js[m]*js[n-m]%mod, mod-2)%mod; }
inlineintLucas(int n, int m){ if (!m) return1; returnC(n%mod, m%mod)*Lucas(n/mod, m/mod)%mod; }
inlinevoidshuruhejiejueheshuchu(){ t = read(); js[0] = 1, js[1] = 1; for (int i = 2; i <= N; ++ i) js[i] = js[i - 1]*i%mod; while (t -- > 0) { // cin >> x >> y >> z; x = read(), y = read(), z = read(); int sum = Lucas(x+y, x+z)%mod; cout << sum << '\n'; } }
#include<bits/stdc++.h> #define LL long long #define debug usingnamespace std;
constint N = 6e6+66;
int n, t, x, y, cnt; int ch[N][6], tag[N];
inlinevoidshuruyijijiejueheshuchu(){ cin >> n >> t; for (int i = 1; i <= n; ++ i) { int now = 0; cin >> x; for (int j = 16; j >= 0; -- j) { if (!ch[now][x>>j&1]) ch[now][x>>j&1] = ++ cnt; now = ch[now][x>>j&1]; ++ tag[now]; } } while (t --> 0) { int res = 0, now = 0; cin >> x >> y; for (int j = 16; j >= 0; -- j) { if (y>>j&1) res += tag[ch[now][x>>j&1]]; now = ch[now][(y>>j&1)^(x>>j&1)]; if (!now) break; } if (now) res += tag[now]; cout << res << '\n'; } }