Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
116478 | 陈铎文 | 最简真分数 | C++ | Wrong Answer | 0 MS | 272 KB | 377 | 2025-04-12 09:50:37 |
#include<bits/stdc++.h> using namespace std; int s=0; int f(int a,int b){ while(b){ int t=a%b; a=b; b=t; } cout<<a; } int main() { int n,a[601]; cin>>n; for(int i=1;i<=n;i++){ cin>>a[i]; } for(int i=1;i<=n;i++){ for(int j=i+1;j<=n;j++){ if(f(a[i],a[j])==1){ s++; } } } cout<<s; return 0; }
------Input------
5 2 2 12 4 7
------Answer-----
4
------Your output-----
22212214110