Submission #1050197

# Submission time Handle Problem Language Result Execution time Memory
1050197 2024-08-09T07:56:13 Z vjudge1 Art Exhibition (JOI18_art) Python 3
30 / 100
1000 ms 3932 KB
n=int(input())
mas=[]
for i in range(n):
    mas.append(list(map(int,input().split())))
mas.sort(key=lambda x:x[0])
maxi=0
for i in range(n):
    mx=0
    mn=10**15+7
    sm=0
    for j in range(i,n):
        mx=max(mas[j][0],mx)
        mn=min(mas[j][0],mn)
        sm+=mas[j][1]
        maxi=max(maxi,sm-mx+mn)
print(maxi)

# Verdict Execution time Memory Grader output
1 Correct 9 ms 2908 KB Output is correct
2 Correct 8 ms 2908 KB Output is correct
3 Correct 8 ms 2908 KB Output is correct
4 Correct 9 ms 2908 KB Output is correct
5 Correct 9 ms 2900 KB Output is correct
6 Correct 8 ms 2980 KB Output is correct
7 Correct 9 ms 2908 KB Output is correct
8 Correct 13 ms 2908 KB Output is correct
9 Correct 9 ms 2756 KB Output is correct
10 Correct 8 ms 2908 KB Output is correct
11 Correct 9 ms 2908 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 9 ms 2908 KB Output is correct
2 Correct 8 ms 2908 KB Output is correct
3 Correct 8 ms 2908 KB Output is correct
4 Correct 9 ms 2908 KB Output is correct
5 Correct 9 ms 2900 KB Output is correct
6 Correct 8 ms 2980 KB Output is correct
7 Correct 9 ms 2908 KB Output is correct
8 Correct 13 ms 2908 KB Output is correct
9 Correct 9 ms 2756 KB Output is correct
10 Correct 8 ms 2908 KB Output is correct
11 Correct 9 ms 2908 KB Output is correct
12 Correct 35 ms 2908 KB Output is correct
13 Correct 33 ms 2908 KB Output is correct
14 Correct 34 ms 2908 KB Output is correct
15 Correct 34 ms 2908 KB Output is correct
16 Correct 34 ms 2908 KB Output is correct
17 Correct 35 ms 2908 KB Output is correct
18 Correct 35 ms 3040 KB Output is correct
19 Correct 43 ms 2908 KB Output is correct
20 Correct 34 ms 2908 KB Output is correct
21 Correct 35 ms 2908 KB Output is correct
22 Correct 43 ms 2908 KB Output is correct
23 Correct 36 ms 2908 KB Output is correct
24 Correct 37 ms 2908 KB Output is correct
25 Correct 34 ms 2908 KB Output is correct
26 Correct 38 ms 3160 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 9 ms 2908 KB Output is correct
2 Correct 8 ms 2908 KB Output is correct
3 Correct 8 ms 2908 KB Output is correct
4 Correct 9 ms 2908 KB Output is correct
5 Correct 9 ms 2900 KB Output is correct
6 Correct 8 ms 2980 KB Output is correct
7 Correct 9 ms 2908 KB Output is correct
8 Correct 13 ms 2908 KB Output is correct
9 Correct 9 ms 2756 KB Output is correct
10 Correct 8 ms 2908 KB Output is correct
11 Correct 9 ms 2908 KB Output is correct
12 Correct 35 ms 2908 KB Output is correct
13 Correct 33 ms 2908 KB Output is correct
14 Correct 34 ms 2908 KB Output is correct
15 Correct 34 ms 2908 KB Output is correct
16 Correct 34 ms 2908 KB Output is correct
17 Correct 35 ms 2908 KB Output is correct
18 Correct 35 ms 3040 KB Output is correct
19 Correct 43 ms 2908 KB Output is correct
20 Correct 34 ms 2908 KB Output is correct
21 Correct 35 ms 2908 KB Output is correct
22 Correct 43 ms 2908 KB Output is correct
23 Correct 36 ms 2908 KB Output is correct
24 Correct 37 ms 2908 KB Output is correct
25 Correct 34 ms 2908 KB Output is correct
26 Correct 38 ms 3160 KB Output is correct
27 Execution timed out 1077 ms 3932 KB Time limit exceeded
28 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 9 ms 2908 KB Output is correct
2 Correct 8 ms 2908 KB Output is correct
3 Correct 8 ms 2908 KB Output is correct
4 Correct 9 ms 2908 KB Output is correct
5 Correct 9 ms 2900 KB Output is correct
6 Correct 8 ms 2980 KB Output is correct
7 Correct 9 ms 2908 KB Output is correct
8 Correct 13 ms 2908 KB Output is correct
9 Correct 9 ms 2756 KB Output is correct
10 Correct 8 ms 2908 KB Output is correct
11 Correct 9 ms 2908 KB Output is correct
12 Correct 35 ms 2908 KB Output is correct
13 Correct 33 ms 2908 KB Output is correct
14 Correct 34 ms 2908 KB Output is correct
15 Correct 34 ms 2908 KB Output is correct
16 Correct 34 ms 2908 KB Output is correct
17 Correct 35 ms 2908 KB Output is correct
18 Correct 35 ms 3040 KB Output is correct
19 Correct 43 ms 2908 KB Output is correct
20 Correct 34 ms 2908 KB Output is correct
21 Correct 35 ms 2908 KB Output is correct
22 Correct 43 ms 2908 KB Output is correct
23 Correct 36 ms 2908 KB Output is correct
24 Correct 37 ms 2908 KB Output is correct
25 Correct 34 ms 2908 KB Output is correct
26 Correct 38 ms 3160 KB Output is correct
27 Execution timed out 1077 ms 3932 KB Time limit exceeded
28 Halted 0 ms 0 KB -