제출 #918516

#제출 시각아이디문제언어결과실행 시간메모리
918516CutebolArt Exhibition (JOI18_art)C++17
컴파일 에러
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 ;
}

컴파일 시 표준 에러 (stderr) 메시지

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