[BZOJ2844]albus就是要第一个出场 Description 已知一个长度为n的正整数序列A(下标从1开始), 令 S = { x | 1 <= x <= n }, S 的幂集2^S定义为S 所有子集构成的集合.定义映射 f : 2^S -> Zf(空集) = 0f(T) = XOR A[t] , 对于一切t属于T现在albus把2^S中每个集合的f值计算出来, 从小到大排成一行, 记为序列B(下标从1开始). 给定一个数, 那么这个数在序列B中第1次出现时的下标是多少呢? I
XOR is a kind of bit operator, we define that as follow: for two binary base number A and B, let C=A XOR B, then for each bit of C, we can get its value by check the digit of corresponding position in A and B. And for each digit, 1 XOR 1 = 0, 1 XOR 0
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
#include<bits/stdc++.h> #define ll long long #define LL long long #define int long long using namespace std; ; int a[maxn]; int b[maxn]; ]; ]; int32_t main() { int n; cin>>n; ;i<=n;i++) cin>>a[i]>>b[i]; ;i<=n;i++) { ;j>=;j