Submission #160092

#TimeUsernameProblemLanguageResultExecution timeMemory
160092combi1k1Art Exhibition (JOI18_art)C++14
100 / 100
914 ms44640 KiB
#include<bits/stdc++.h> using namespace std; #define int long long signed main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); map<int,int> mp; int n; cin >> n; for(int i = 1 ; i <= n ; ++i) { int a; cin >> a; int b; cin >> b; mp[a] += b; } int sum = 0; int Min = 0; int ans = 0; for(auto it : mp) { Min = min(Min,sum - it.first); sum += it.second; ans = max(ans,sum - it.first - Min); } 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...