| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1341454 | zowi | Art Exhibition (JOI18_art) | C++20 | 137 ms | 8752 KiB |
#include<bits/stdc++.h>
using namespace std;
int main()
{
ios_base::sync_with_stdio(0);
long long n,a,b;
cin >> n;
vector<pair<long long,long long>> tab;
for(long long i = 0;i < n;++i)
{
cin >> a >> b;
tab.push_back({a,b});
}
sort(tab.begin(),tab.end());
long long best = 0;
long long wyn = 0;
for(long long i = 0;i < n;++i)
{
best = max(best,tab[i].first);
best += tab[i].second;
wyn = max(wyn,best-tab[i].first);
//cout << wyn << endl;
}
cout << wyn;
}
| # | 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... | ||||
