F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

View Compilation Error

0_0_20612897_28086.cpp:4:5: error: expected unqualified-id before '>=' token
     >=1; } return r;}ll sol(int k){ ll x,y,t=B[0][k],m=A[0]; for(int i=1;i<n;i++) { ll d=egcd(m,A[i],x,y),tp=B[i][k]-t; if(tp%d!=0)return -1; x=tp/d*x%A[i]; if(x<0)x+=A[i]; t=x*m+t; m=m/gcd(m,A[i])*A[i]; } return t%m;}int main(){ while(~scanf("%d",&n)) { memset(v,0,sizeof(v)); memset(B,0,sizeof(B)); for(int i=0;i<n;i++) { scanf("%I64d",A+i); ll tp=A[i]; for(ll k=2;k*k<=tp;++k) if(tp%k==0) { v[k]=1; while(tp%k==0) { ++B[i][k]; tp/=k; } } if(tp>1){v[tp]=1;B[i][tp]=1;} } ll res=1; for(int i=2;i<9998;i++) if(v[i]) { ll t=sol(i); if(!~t){res=-1;break;} res=res*Pow((ll)i,t)%M; } printf("%I64d\n",res); }}
     ^
0_0_20612897_28086.cpp:4:10: error: expected declaration before '}' token
     >=1; } return r;}ll sol(int k){ ll x,y,t=B[0][k],m=A[0]; for(int i=1;i<n;i++) { ll d=egcd(m,A[i],x,y),tp=B[i][k]-t; if(tp%d!=0)return -1; x=tp/d*x%A[i]; if(x<0)x+=A[i]; t=x*m+t; m=m/gcd(m,A[i])*A[i]; } return t%m;}int main(){ while(~scanf("%d",&n)) { memset(v,0,sizeof(v)); memset(B,0,sizeof(B)); for(int i=0;i<n;i++) { scanf("%I64d",A+i); ll tp=A[i]; for(ll k=2;k*k<=tp;++k) if(tp%k==0) { v[k]=1; while(tp%k==0) { ++B[i][k]; tp/=k; } } if(tp>1){v[tp]=1;B[i][tp]=1;} } ll res=1; for(int i=2;i<9998;i++) if(v[i]) { ll t=sol(i); if(!~t){res=-1;break;} res=res*Pow((ll)i,t)%M; } printf("%I64d\n",res); }}
          ^


Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-11-23 02:43:13, Gzip enabled