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

Re:因为你定义了a[1000][2];其实这里可以不用这么多的空间。修改的代码如下,就可以AC了

Posted by iyixiang at 2008-11-09 22:29:07 on Problem 2665
In Reply To:因为你定义了a[1000][2];其实这里可以不用这么多的空间。修改的代码如下,就可以AC了 Posted by:feima at 2008-11-04 10:38:41
> #include<iostream>
> using namespace std;
> int main()
> {
>     long l,s,sum;
> 	int a, b;
> 	long i, m;
>     
>     while(cin>>l>>m&&l!=0&&m!=0)
>     {
>       sum=0;
>       s=0;
>       for(i=0;i<m;i++)
>       {
> 	   cin>>a>>b;
> 	   s=b-a+s+1;
>       }
>      sum=l+1-s;
>    cout<<sum<<endl;
>     }
> 	return 0;
> }
为什么这样可以AC啊??????

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