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

水过40题··

Posted by 33305005 at 2010-02-02 00:57:39 on Problem 2853
#include<iostream>
using namespace std;
int main()
{
	int t;
	int i;
	int num;
	int count;
	int tcase;
	double x;
	scanf("%d",&t);
	while(t--)
	{
		scanf("%d%d",&tcase,&num);
		count = 0;
		for(i = 2; ; i++)
		{
			x = (num*1.0/i*2-i+1) / 2;
			if(x <= 0)
			{
				break;
			}
			if(x == int(x))
			{
				count++;
			}
		}
		printf("%d %d\n",tcase,count);
	}
	return 0;
}

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