Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
7440 黄言岐 最简真分数 C++ Wrong Answer 0 MS 256 KB 671 2025-04-26 15:12:28

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; int my_sum(int x,int y){ int ans=0,j=0; while(x%y!=0){ ans=y; j=x/y; y=x%y; x=ans; } return y; } int n,a[601],cnt; int main(){ cin>>n; for(int i=1;i<=n;i++){ cin>>a[i]; } for(int i=1;i<n;i++){ for(int j=i+1;j<=n;j++){ if(my_sum(a[i],a[j])==1){ cnt++; } } } return 0; }


Run Info:

------Input------
3 2 2 2
------Answer-----
0
------Your output-----