# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
754319 | KN200711 | Art Exhibition (JOI18_art) | C++14 | 206 ms | 20764 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
# include <bits/stdc++.h>
# define ll long long
# define fi first
# define se second
using namespace std;
int main() {
int N;
scanf("%d", &N);
vector< pair<ll, ll> > arr(N);
for(int i=0;i<N;i++) scanf("%lld %lld", &arr[i].fi, &arr[i].se);
sort(arr.begin(), arr.end());
ll mn = 1e18, pref = 0ll, ans = 0ll;
for(int i=0;i<N;i++) {
mn = min(mn, pref - 1ll * arr[i].fi);
pref += arr[i].se;
ans = max(ans, pref - arr[i].fi - mn);
}
printf("%lld\n", ans);
}
컴파일 시 표준 에러 (stderr) 메시지
# | 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... |