initial commit
This commit is contained in:
parent
597abdcede
commit
7a841a428e
26
116A Tram/116A.cpp
Normal file
26
116A Tram/116A.cpp
Normal file
@ -0,0 +1,26 @@
|
||||
#include<bits/stdc++.h>
|
||||
using namespace std;
|
||||
using ll = long long;
|
||||
|
||||
void solve()
|
||||
{
|
||||
int n,a,b,min=0,p=0;
|
||||
cin>>n;
|
||||
while(n--)
|
||||
{
|
||||
cin>>a>>b;
|
||||
p=p-a+b;
|
||||
if(p>min) min=p;
|
||||
}
|
||||
cout<<min<<endl;
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
ios_base::sync_with_stdio(false);
|
||||
cin.tie(nullptr);
|
||||
|
||||
int TC = 1;
|
||||
//cin >> TC;
|
||||
while (TC--) solve();
|
||||
}
|
Loading…
Reference in New Issue
Block a user