| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 155129 | 黄俊然 | 最简真分数 | C++ | Wrong Answer | 2 MS | 272 KB | 628 | 2026-05-31 15:49:43 |
#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int hz(int x,int y){ for(int i=1;i<=y;i++){ if(x%i==0||y%i==0||x%i==0&&y%i==0)return 0; } return 1; } int main(){ int a[601],n,sum=0; cin>>n; for(int i=1;i<=n;i++){ cin>>a[i]; for(int j=n;j>=0;j--){ if(hz(a[i],a[j])==1){ sum++; } } } cout<<sum; return 0; }
------Input------
5 2 2 12 4 7
------Answer-----
4
------Your output-----
15