Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
119830 郝王骏程 最简真分数 C++ Wrong Answer 0 MS 268 KB 605 2025-05-19 20:45:30

Tests(0/10):


Code:

#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 n,c[1000],b=0; for(int i=1;i<=n;i++){ cin>>c[n]; } for(int i=1;i<n;i++){ for(int j=i+1;j<=n;j++){ if(a(c[i],c[j])) b++; } } cout<<b; return 0; }


Run Info:

------Input------
5 2 2 12 4 7
------Answer-----
4
------Your output-----
0