# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
48453 | 2018-05-13T16:18:19 Z | arman_ferdous | Art Exhibition (JOI18_art) | C++17 | 2 ms | 248 KB |
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int N = 5e5+10; pair<ll,ll> arr[N]; int main() { int n; scanf("%d", &n); for(int i = 0; i < n; i++) scanf("%lld %lld", &arr[i].first, &arr[i].second); sort(arr,arr+n); ll ans = 0, sum = 0; for(int i = 0; i < n; i++) { sum += arr[i].second; ans = max(ans, sum - arr[i].first + arr[0].first); } printf("%lld", ans); return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 248 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 248 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 248 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 248 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |