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 "stdio.h" void main() { int t,i,j,n; double s; scanf("%d",&t); for(i=0;i<t;i++) { scanf("%d",&n); for(j=1;;j++) { s=j*(j+1)/2.0; if(n<=s)break; } s=s-j-2; printf("%.0f\n",n-s-2); } } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator