Submission #44401

# Submission time Handle Problem Language Result Execution time Memory
44401 2018-04-02T01:38:40 Z leejseo Art Exhibition (JOI18_art) Python 2
0 / 100
14 ms 2936 KB
from sys import stdin
range = xrange
raw_input = stdin.readline
N = int(raw_input())
L = [None]*N
for i in range(N):
    a, b = map(int, raw_input().split())
    L[i] = (a, b)
L.sort()
S = [0]*(N+1)
for i in range(N):
    a, b = L[i]
    S[i+1] = S[i] + b

ans = 0
for j in range(N):
    for i in range(j):
        ans = max(ans, S[j+1] - S[i] + L[i][0] - L[j][0])
print ans
# Verdict Execution time Memory Grader output
1 Incorrect 14 ms 2936 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 14 ms 2936 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 14 ms 2936 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 14 ms 2936 KB Output isn't correct
2 Halted 0 ms 0 KB -