| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 853314 | thinknoexit | Art Exhibition (JOI18_art) | C++17 | 141 ms | 21296 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;
using ll = long long;
pair<ll, ll> a[500001];
int main() {
cin.tie(nullptr)->sync_with_stdio(false);
int n;
cin >> n;
for (int i = 1;i <= n;i++) {
cin >> a[i].first >> a[i].second;
}
sort(a + 1, a + 1 + n);
ll ans = LLONG_MIN, mx = LLONG_MIN, now = 0;
for (int i = 1;i <= n;i++) {
mx = max(mx, -now + a[i].first);
now += a[i].second;
ans = max(ans, now - a[i].first + mx);
}
cout << ans;
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... | ||||
