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 |
三点容易错:溢出, K=1, 和tmp>Tbool Test(BigInt T) { long long time=0; for(int i=0;i<N;i++) { if(A[i]>T) { if(K==1) return false; long long tmp; if((A[i]-T)%(K-1)) tmp=(A[i]-T)/(K-1)+1; else tmp=(A[i]-T)/(K-1); if(tmp>T)//容易错 找了很久 return false; time+=tmp; } } if(time<=T*M) return true; return false; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator