Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

为什么就是超时!!!!!!!!!!!!!!!!!!!!!!!

Posted by pig8310 at 2007-03-31 00:25:27 on Problem 1019
#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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator