https://ac.nowcoder.com/acm/problem/17968 下面是错误的做法,因为题目要求必须使用x,而y在check的时候不一定用到等价于x的线性基来构成. 正确的做法是直接check(x^y),这样y已经使用了x,再看看能不能经过其他数表示. 因为异或是交换群. #include<bits/stdc++.h> using namespace std; #define ll long long const int MN=34; ll a[MN+1],tmp[MN+1]…
题目链接 题意 : 中文题.点链接 分析 : 对于给定的 X 和 Y 假设存在一个 Z 使得 X (xor) Z = Y 做一个变形 X (xor) Z (xor) Y = 0 X (xor) Y = Z 也就是原集合中 是否存在一个异或组合结果为 X (xor) Y 线性基模板一套.AC #include<bits/stdc++.h> #define LL long long #define ULL unsigned long long #define scl(i) scanf("…
XOR Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2302 Accepted Submission(s): 783 Problem Description XOR is a kind of bit operator, we define that as follow: for two binary base number A…
Mahmoud and Ehab and yet another xor task 存在的元素的方案数都是一样的, 啊, 我好菜啊. 离线之后用线性基取check存不存在,然后计算答案. #include<bits/stdc++.h> #define LL long long #define LD long double #define ull unsigned long long #define fi first #define se second #define mk make_pair…