Submission #1049767

# Submission time Handle Problem Language Result Execution time Memory
1049767 2024-08-09T04:50:29 Z vjudge1 Art Exhibition (JOI18_art) C++17
0 / 100
1 ms 344 KB
#include <bits/stdc++.h>

using namespace std;

int main(){
    int num;
    cin >> num;
    
    vector<pair<int, int>> art(num);
    for (int idx = 0; idx < num; idx++){
        cin >> art[idx].first >> art[idx].second; 
    }
    
    sort(art.begin(), art.end());

    long long mxr = LLONG_MIN;
    
    for (int idx = 0; idx < num; idx++) {
        long long smv = 0;
        for(int jdx = idx; jdx < num; jdx++){
            smv += art[jdx].second;
            int amx = art[jdx].first;
            int amn = art[idx].first;
            long long res = smv - (amx - amn);
            mxr = max(mxr, res);
        }
    }
    cout << mxr << endl;

    return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -