QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#865181 | #858. GCD vs. XOR | AFLeartLey0103 | WA | 3ms | 3584kb | C++14 | 413b | 2025-01-21 15:52:44 | 2025-01-21 15:52:44 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define int long long
const int maxn = 200000;
int cnt[maxn+50];
signed main(){
int n; cin >> n;
for(int i = 0, u; i < n; ++ i){
cin >> u;
cnt[u] ++;
}
int ans = 0;
for(int i = 1; i <= maxn; ++ i){
for(int j = i; j+i <= maxn; j += i){
if((j+i) == (j^i)) ans += cnt[j] * cnt[j+i];
}
}
cout << ans;
return 0;
}
详细
Test #1:
score: 0
Wrong Answer
time: 3ms
memory: 3584kb
input:
1 4 2 3 4 3
output:
0
result:
wrong answer 1st numbers differ - expected: '2', found: '0'