Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
115483 | 刘珩宇 | 最简真分数 | C++ | Accepted | 225 MS | 272 KB | 610 | 2025-03-30 19:04:52 |
#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 out(int x,int y){ for(int c=2;c<=y;c++){ if(x%c==0&&y%c==0){ return 0; } } return 1; } int main(){ int a[600],s=0,n; cin>>n; for(int i=0;i<n;i++){ cin>>a[i]; } for(int i=0;i<n-1;i++){ for(int j=i+1;j<n;j++){ if(out(a[i],a[j])==1){ s+=1; } } } cout<<s; return 0; }