| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1264542 | happyboy | Art Exhibition (JOI18_art) | C++20 | 327 ms | 8244 KiB |
#include <bits/stdc++.h>
int main() {
int n;
std :: cin >> n;
std :: vector<std::pair<long long, long long>> ab(n);
for (auto &[a, b] : ab) std :: cin >> a >> b;
std :: sort(ab.begin(), ab.end());
long long pmx = INT64_MIN, tot = 0LL, ans = INT64_MIN;
for (auto [a, b] : ab) {
pmx = std :: max(pmx, a - tot); tot += b;
ans = std :: max(ans, tot - a + pmx);
}
std :: cout << ans << "\n";
}| # | 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... | ||||
