# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
997122 | 2024-06-11T17:49:44 Z | Luca1234 | Art Exhibition (JOI18_art) | C++14 | 0 ms | 348 KB |
#include <bits/stdc++.h> using namespace std; vector <pair <long long, int> > v; int main() { int n, val; long long sz; cin>>n; for(int i=1; i<=n; i++) { cin>>sz>>val; v.push_back({sz, val}); } sort(v.begin(), v.end()); long long ans=0, aux=0, sum=0; for(int i=0; i<v.size(); i++) { aux=max(aux, v[i].first-sum); sum+=v[i].second; ans=max(ans, sum-v[i].second+aux); } cout<<ans; return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 348 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 348 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 348 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 348 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |