| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1283856 | arashmemar | Art Exhibition (JOI18_art) | C++20 | 434 ms | 8320 KiB |
#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6;
pair <long long int, long long int> a[maxn];
int main()
{
int n;
cin >> n;
for (int i = 1;i <= n;i++)
{
cin >> a[i].first >> a[i].second;
}
sort(a + 1, a + 1 + n);
long long int ans = a[n].second, mx = a[n].second;
for (int i = n - 1;i;i--)
{
mx = max(mx - a[i + 1].first + a[i].first + a[i].second, a[i].second);
ans = max(mx, ans);
}
cout << ans;
}| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
