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 kaneLee at 2010-11-15 16:00:04 on Problem 2665
#include<iostream>

int main()
{
	unsigned long int road;
	int section;
	while(true)
	{
		scanf("%ld %d",&road,&section);
		if(road==0 && section==0)break;
		road++;
		for(int i=0;i<section;i++)
		{
			unsigned long int start,end;
			scanf("%ld %ld",&start,&end);
			unsigned long int distance=end-start; 			                distance++;
			road-=distance;
		}
		printf("%ld\n",road);
	}
	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