Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
119836 | 杨登博 | 最简真分数 | C++ | Accepted | 281 MS | 272 KB | 643 | 2025-05-19 20:52:21 |
#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; bool a(int x,int y){ for(int i=x;i>1;i--){ if(x%i==0 && y%i==0){ return 0; } } return 1; } int main(){ int s[601],n,c=0; cin>>n; for(int i=1;i<=n;i++){ cin>>s[i]; } for(int i=1;i<n;i++){ for(int j=i+1;j<=n;j++){ if(a(s[i],s[j])) c++; } } cout<<c; return 0; }