Submission #918515

# Submission time Handle Problem Language Result Execution time Memory
918515 2024-01-30T03:42:27 Z Cutebol Art Exhibition (JOI18_art) C++17
0 / 100
1 ms 344 KB
#include <bits/stdc++.h>

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 ;
}
# 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 -