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 |
why wa?高手指点#include<iostream> using namespace std; int tag[1000000]; int main() { int n,g,num[300],i,j; cin>>n; while(n--){ cin>>g; for(i=0; i<g; i++) cin>>num[i]; if(g==1) cout<<1<<endl; else{ for(j=g; j<1000000 ;j++){ for(i=0; i<g; i++){ int temp = num[i]%j; if(tag[temp]==j) break; else tag[temp] = j; } if(i==g){ cout<<j<<endl; break; } } } } system("pause"); return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator