正文
增加 3 行删除 3 行
28 行未改动29303132333435363718 行未改动5657585960616263644 行未改动69707172737475767728 行未改动#define ADD(a, b) a = (a + b)#define chk(x) (!(x) || __builtin_ctz(x) == n - __builtin_popcount(x))#define id(x, p) (((x) >> p) & 1)#define ID(x, y) ((x) * n + (y))//x=0时ctz出错const int N = 15;int n, m, x, y, a[1 << N], f[1 << N], ans;bool vis[1 << N];vector<int> buc[N * N];18 行未改动upd(), ans = 1;while(m--){scanf("%lld%lld", &x, &y);x = (x + ans) % n, y = (y + 2 * ans) % n;if(x > y) swap(x, y);bool fl = false;for(auto i : buc[ID(x, y)])if(id(a[i], x) && !id(a[i], y)){a[i] ^= (1 << x) | (1 << y);4 行未改动}}buc[ID(x, y)].clear();if(fl) upd();printf("%lld\n", ans);}return 0;}```28 行未改动29303132333435363718 行未改动5657585960616263644 行未改动69707172737475767728 行未改动#define ADD(a, b) a = (a + b)#define chk(x) (!(x) || __builtin_ctz(x) == n - __builtin_popcount(x))#define id(x, p) (((x) >> p) & 1)#define ID(x, y) ((x) * n + (y))//x=0时ctz出错const int N = 15;int n, m, x, y, a[1 << N], f[1 << N], ans;bool vis[1 << N];vector<int> buc[N * N];18 行未改动upd(), ans = 1;while(m--){scanf("%lld%lld", &x, &y);x = (x + ans) % n, y = (y + 2 * ans) % n;if(x > y) swap(x, y);bool fl = false;for(auto i : buc[ID(x, y)])if(id(a[i], x) && !id(a[i], y)){a[i] ^= (1 << x) | (1 << y);4 行未改动}}buc[ID(x, y)].clear();if(fl) upd();printf("%lld\n", ans);}return 0;}```