Submission #926183

# Submission time Handle Problem Language Result Execution time Memory
926183 2024-02-12T16:55:49 Z Art_ogo Art Exhibition (JOI18_art) C++17
Compilation error
0 ms 0 KB
#include <iostream>
#include <vector>
#include <set>
#include <map>
#include <algorithm>

//#define int long long */
#define ll long long
#define fi first
#define se second
#define ve vector

using namespace std;

typedef pair<ll, ll> pll;
typedef pair<int, int> pii;
#define all(x) x.begin(), x.end()

const int MAXN = 3e5+10;

signed main(){
    int n;
    cin >> n;
    ve<pll> v(n);
    for(auto& i : v)
        cin >> i.fi >> i.se;
    sort(all(v));
    ll res = LLONG_MIN;
    ll sum = 0;
    ll mx = 0;
    for(int i = 0; i < n; i++){
        mx = max(mx, v[i].fi - sum);
        sum += v[i].se;
        res = max(res, mx + sum - v[i].fi);   
    }
    cout << res << "\n";
}

Compilation message

art.cpp: In function 'int main()':
art.cpp:28:14: error: 'LLONG_MIN' was not declared in this scope
   28 |     ll res = LLONG_MIN;
      |              ^~~~~~~~~
art.cpp:6:1: note: 'LLONG_MIN' is defined in header '<climits>'; did you forget to '#include <climits>'?
    5 | #include <algorithm>
  +++ |+#include <climits>
    6 |