| Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|---|
| 38468 | 李羽乔 | 【S】T1 | C++ | 通过 | 100 | 159 MS | 248 KB | 689 | 2025-10-08 15:40:02 |
#include<bits/stdc++.h> using namespace std; int n; long long ans; int main(){ cin>>n; if(n<=10000){ for(int i=1;i<=n;i++){ for(int j=i+1;j<=n;j++){ int tmp=(i^j),g=__gcd(i,j); if(tmp==g){ ans++; } } } cout<<ans<<endl; return 0; } if(n<=10000000){ for(int i=1;i<=n;i++){ for(int j=2;j<=n/i;j++){ int tmp=(j*i)^((j-1)*i); if(tmp==i){ ans++; } } } cout<<ans<<endl; return 0; } return 0; }