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 |
贴个代码:#include"iostream" using namespace std; int main() { int n; cin>>n; while(n--) { long sum; int num,t=0; int i; cin>>num>>sum; for(i=2;i<70000;i++) if((2*sum-i*i+i)%(2*i)==0&&(2*sum-i*i+i)>0) t++; else if(2*sum-i*i+i<=0) break; cout<<num<<" "<<t<<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