Submission #392773

#TimeUsernameProblemLanguageResultExecution timeMemory
392773wildturtleArt Exhibition (JOI18_art)C++14
0 / 100
1 ms256 KiB
#include<bits/stdc++.h> #define ll long long #define f first #define sc second using namespace std; ll a,b,c,d,i,e,f,g,n,m,k,l,maxx; pair <ll,ll> A[500005]; int main() { cin>>n; for(ll i=1;i<=n;i++) { cin>>A[i].f>>A[i].sc; } sort(A+1,A+1+n); for(ll i=1;i<=n;i++) { a+=A[i].sc; maxx=max(maxx,a+A[1].f-A[i].f); } cout<<maxx; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...