| ||||||||||
| 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 | |||||||||
因为你定义了a[1000][2];其实这里可以不用这么多的空间。修改的代码如下,就可以AC了In Reply To:高手认为??? Posted by:for_love at 2007-06-11 19:26:12 #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;
}
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator