제출 #538257

#제출 시각아이디문제언어결과실행 시간메모리
538257tkwiatkowskiArt Exhibition (JOI18_art)C++17
컴파일 에러
0 ms0 KiB
def solve():
	n = int(input())
	artworks = []
	for i in range(n):
		artworks.append(list(map(int, input().split())))

	artworks.sort()

	maxx = -10**18
	ans = 0
	pref = 0
	for a, b in artworks:
		maxx = max(a - pref, maxx)
		pref += b
		ans = max(maxx + pref - a, ans)
	print(ans)
solve()

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

art.cpp:1:1: error: 'def' does not name a type
    1 | def solve():
      | ^~~