Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
128180 王定阳 最简真分数 C++ Runtime Error 125 MS 276 KB 387 2025-08-08 14:58:12

Tests(2/10):


Code:

#include<bits/stdc++.h> using namespace std; int gy(int a,int s){ if(a>=s){ return 0; } for(int i=2;i<=a;i++){ if(a%i==0 && s%i==0){ return 0; } } return 1; } int main() { int z,x[100],c=0; cin>>z; for(int o=1;o<=z;o++){ cin>>x[o]; } for(int o=1;o<=z;o++){ for(int p=1;p<=z;p++){ if(gy(x[o],x[p])) { c++; } } } cout<<c; return 0; }


Run Info:

Runtime Error:Segmentation fault