QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#865181#858. GCD vs. XORAFLeartLey0103WA 3ms3584kbC++14413b2025-01-21 15:52:442025-01-21 15:52:44

Judging History

你现在查看的是最新测评结果

  • [2025-01-21 15:52:44]
  • 评测
  • 测评结果:WA
  • 用时:3ms
  • 内存:3584kb
  • [2025-01-21 15:52:44]
  • 提交

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'