| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 | 
|---|---|---|---|---|---|---|---|
| 50708 | ayhcbagnop | Art Exhibition (JOI18_art) | C++14 | 301 ms | 239072 KiB | 
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
//Power Of Ninja Go
#include <bits/stdc++.h>
//#ifdef atom #else #endif
using namespace std;
typedef long long ll; typedef pair<ll, ll> ii; typedef vector<int> vi; typedef vector< ii > vii;
#define X first
#define Y second
#define pb push_back
vii pong;
const int maxn = 5e5+5;
ll qs[maxn];
ll x[maxn], y[maxn];
int main()
{
    int n; scanf("%d", &n);
    for(int i = 0; i< n; i++)
    {
        pong.pb(ii());
        scanf("%lld %lld", &pong.back().X, &pong.back().Y);
    }
    sort(pong.begin(), pong.end());
    for(int i = 1; i<= n; i++)
    {
        qs[i] = qs[i-1] + pong[i-1].Y;
    }
    for(int i = 1; i<= n; i++) x[i] = qs[i]-pong[i-1].X;
    for(int i = 1; i<= n; i++) y[i] = qs[i-1]-pong[i-1].X;
    //for(int i = 1; i<= n; i++) cout << x[i] << " " << y[i] << endl;
    ll best = 1e18;
    ll res = -1e18;
    for(int i = 1; i<= n; i++)
    {
        best = min(best, y[i]);
        res = max(res, x[i]-best);
    }
    printf("%lld\n", res);
}
컴파일 시 표준 에러 (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... | ||||
