Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
92219 | 牛延希 | 最简真分数 | C++ | Wrong Answer | 1 MS | 272 KB | 282 | 2024-09-28 16:24:27 |
#include<iostream> #include<algorithm> using namespace std; int main(){ int n,a[1145],s=0; cin>>n; for(int i=0;i<n;i++){ cin>>a[i]; }for(int i=0;i<n;i++){ for(int j=i+1;j<n;j++){ if(__gcd(a[i],a[j])!=1) s++; } }cout<<s; return 0; }
------Input------
5 2 2 12 4 7
------Answer-----
4
------Your output-----
6