| ||||||||||
| 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 | |||||||||
Re:因为你定义了a[1000][2];其实这里可以不用这么多的空间。修改的代码如下,就可以AC了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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator