| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1370342 | sarahspeedy | Art Exhibition (JOI18_art) | C++20 | 279 ms | 8240 KiB |
#include <bits/stdc++.h>
using namespace std;
#define ll long long
int main() {
int n;
cin >> n;
vector<pair<ll,ll>> vec(n);
for(int i = 0; i < n; i++){
cin >> vec[i].first >> vec[i].second;
}
sort(vec.begin(), vec.end());
ll best = LLONG_MIN;
ll sum = 0;
ll mx = 0;
for(int i = 0; i < n; i++){
ll pre = sum + vec[i].second;
best = max(best, vec[i].first - sum);
mx = max(mx, pre - vec[i].first + best);
sum = pre;
}
cout << mx;
}| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
