PageRenderTime 17ms CodeModel.GetById 12ms app.highlight 4ms RepoModel.GetById 0ms app.codeStats 0ms

/116A.cpp

https://bitbucket.org/alculquicondor/codeforces
C++ | 19 lines | 17 code | 2 blank | 0 comment | 1 complexity | ffe10128534b86a97ac2a16bb26378f0 MD5 | raw file
 1#include<cstdio>
 2#include<bits/stl_algobase.h>
 3
 4using std::max;
 5
 6int main()
 7{
 8	int n,a,b;
 9	scanf("%d",&n);
10	int cu=0,r=0;
11	for(int i=0;i<n;i++)
12	{
13		scanf("%d %d",&a,&b);
14		cu-=a;
15		cu+=b;
16		r=max(r,cu);
17	}
18	printf("%d\n",r);
19}