6 条题解
-
1
#include <math.h> #include <stdio.h> #include #include <string.h> #include using namespace std; int a[100]; long long calc() { long long sum =0; for(int i = 0 ; i < 60 ; i++) { a[i] %= 3; if(a[i]) sum += (1 << i); } return sum; } void f(long long x) { long long len = 0; while(x!=0) { if(x&1) a[len]++; len++; x/=2; } } int main() { long long n ; cin >> n; for(int i = 0,x ; i < n ; i++) { scanf("%d",&x); f(x); } cout << calc() <<endl; return 0; }
信息
- ID
- 1224
- 时间
- 1000ms
- 内存
- 5MiB
- 难度
- 7
- 标签
- 递交数
- 486
- 已通过
- 102
- 上传者