# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
127281 | 2019-07-09T07:48:12 Z | gaoxam123 | Art Exhibition (JOI18_art) | C++14 | 2 ms | 376 KB |
#include<bits/stdc++.h> #pragma optimize(O3) using namespace std; //dit me oj.uz int n,ans=-1e15,tmp=-1e15,sum=-1e15;pair<int,int> a[500005]; signed main(){ ios_base::sync_with_stdio(0); cin.tie(0);cin>>n;for(int i=1;i<=n;i++) cin>>a[i].first>>a[i].second;sort(a+1,a+n+1);for(int i=1;i<=n;i++){tmp=max(tmp,a[i].first-sum);sum+=a[i].second;ans=max(ans,sum-a[i].first+tmp);}cout<<ans; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 376 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 376 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 376 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 376 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |