Submission #918516

#TimeUsernameProblemLanguageResultExecution timeMemory
918516CutebolArt Exhibition (JOI18_art)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #define int long long using namespace std ; int main (){ int n ; cin >> n ; pair <int , int> a[n+5] ; for ( int i = 0 ; i < n ; i ++ ) cin >> a[i].first >> a[i].second ; sort ( a , a + n ) ; int pref = 0 , ans = 0 ; for ( int i = 0 ; i < n ; i ++ ){ pref += a[i].second ; pref = max ( pref , a[i].second + a[i].first ) ; ans = max ( ans , pref-a[i].first ) ; } cout << ans ; }

Compilation message (stderr)

cc1plus: error: '::main' must return 'int'