Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
115963 欧阳俊懿 最简真分数 C++ Wrong Answer 12 MS 268 KB 658 2025-04-05 17:55:21

Tests(2/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 z(int a,int b){ if(b==0) return a; else return z(b,a%b); } int main(){ int n,i,j,a[601]; long long sum=0; cin>>n; for(i=0;i<n;i++) { cin>>a[i]; } for(i=0;i<=n;i++) { for(j=0;j<=n;j++){ if(a[i]<a[j]&&z(a[j],a[i])==1) sum++; } } cout<<sum; return 0; }


Run Info:

------Input------
600 538 644 249 612 643 713 953 570 145 347 858 778 740 941 806 108 118 25 942 440 202 637 197 332 760 648 954 153 634 177 422 76 394 756 767 831 692 406 498 640 83 284 182 231 621 32 979 333 981 527 55 571 414 143 397 152 302 218 52 265 596 855 334 582 922 735 25 789 635 80 103 524 599 435 20 667 978 420 75 342 820 108 903 586 710 186 614 42 277 560 615 632 838 547 645 571 959 325 51 658 205 792 845 242 880 488 563 765 20 732 461 290 427 649 89 923 25 215 752 539 325 3 911 703 271 771 49 211 24
------Answer-----
107404
------Your output-----
107695