Submission #1088172

#TimeUsernameProblemLanguageResultExecution timeMemory
1088172MahmytMArt Exhibition (JOI18_art)C++17
0 / 100
0 ms348 KiB
#include<bits/stdc++.h> using namespace std; #define ll long long #define ff first #define ss second #define pb push_back #define yes cout<<"YES"<<endl #define no cout<<"NO"<<endl void afterdot(int n){ cout<<setprecision(n)<<fixed; } int main(){ ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); // freopen("input.txt", "r", stdin); // freopen("output.txt", "w", stdout); ll n; cin>>n; pair<ll,ll> a[n+2]; for(int i=1;i<=n;i++){ cin>>a[i].ff>>a[i].ss; } sort(a+1,a+n+1); ll ans=0,sum=0; for(int i=1;i<=n;i++){ sum+=a[i].ss; ans=max(ans,sum-(a[i].ff-a[1].ff)); } cout<<ans<<endl; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...