| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 939162 | vjudge1 | Art Exhibition (JOI18_art) | C++17 | 0 ms | 344 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
using namespace std;
const int N = (int)5e5+7;
const long long INF = (long long)1e18+7;
int n;
pair<long long, long long> a[N];
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
cin >> n;
for(int i = 1; i <= n; ++i) {
cin >> a[i].first >> a[i].second;
}
sort(a+1, a+1+n);
long long ans = 0, cur = 0, mn = 0;
for(int i = 1; i <= n; ++i) {
cur += a[i].second;
ans = max(ans, cur-a[i].first-mn);
mn = min(mn, (cur-a[i].second)-a[i].first);
}
cout << ans << "\n";
return 0;
} | # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
