Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
测试好多数据都过了,为什么提交后显示Runtime Error#include "iostream" using namespace std; long Mod(long Arr[],long Len) { long Mod = 1; long count = 0; long Mod_Stroe[300]; for (int k = 0; k < 300;k++) { Mod_Stroe[k] = -1; } if (Len == 1) { return 1; } else { for (long i = Len;;i++) { Mod = i; for (long j = 0;j < Len;j++) { if (Mod_Stroe[Arr[j] % Mod] != -1) { break; } else { Mod_Stroe[Arr[j] % Mod] = Arr[j] % Mod; count++; } } if (count == Len) { return Mod; } for (long k = 0; k < 300;k++) { Mod_Stroe[k] = -1; } count = 0; } } } int main(void) { long Num; long Case_Num; long Store[300]; cin>>Num; //long *Result = new unsigned long[Num]; for (long i = 0; i < Num; i++) { cin>>Case_Num; for (long j = 0;j < Case_Num; j++) { cin>>Store[j]; } cout<<Mod(Store,Case_Num)<<'\n'; //Result[i] = Mod(Store,Case_Num); } /*for (i = 0; i < Num; i++) { cout<<Result[i]<<endl; }*/ return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator