| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 133537 | 王金檐 | 最简真分数 | C++ | Accepted | 13 MS | 276 KB | 358 | 2025-10-19 11:58:00 |
#include<bits/stdc++.h> using namespace std; int z[1000]; int s=0; void qs(int a,int b){ while(b!=0){ int c=a%b; a=b; b=c; } if(a==1){ s++; } } int main(){ int n; cin>>n; for(int j=1;j<=n;j++){ cin>>z[j]; } for(int i=1;i<=n;i++){ for(int j=i+1;j<=n;j++){ qs(z[i],z[j]); } } cout<<s; return 0; }