Submission #19723540


Source Code Expand

Copy
import sys
N = int(input())
K = []
total = 0
for i in range(N):
    a, b = map(int, input().split())
    K.append([a, b])
    total += a

T = []
for i in range(N):
    T.append(2 * K[i][0] + K[i][1])

T.sort(reverse=True)
c = 0
for i in range(N):
    c += T[i]
    if c > total:
        print(i+1)
        sys.exit()

Submission Info

Submission Time
Task D - Choose Me
User sakuya_1639
Language PyPy3 (7.3.0)
Score 400
Code Size 335 Byte
Status AC
Exec Time 349 ms
Memory 114752 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 400 / 400
Status
AC × 3
AC × 31
Set Name Test Cases
Sample sample_01.txt, sample_02.txt, sample_03.txt
All 01_small.txt, 02_small.txt, 03_small.txt, 04_small.txt, 05_small.txt, 06_small.txt, 07_small.txt, 08_small.txt, 09_small.txt, 10_small.txt, 11_small.txt, 12_small.txt, 13_small.txt, 14_small.txt, 15_small.txt, 16_large.txt, 17_large.txt, 18_large.txt, 19_large.txt, 20_large.txt, 21_large.txt, 22_large.txt, 23_large.txt, 24_large.txt, 25_large.txt, 26_max.txt, 27_max.txt, 28_max.txt, sample_01.txt, sample_02.txt, sample_03.txt
Case Name Status Exec Time Memory
01_small.txt AC 60 ms 61904 KB
02_small.txt AC 52 ms 61920 KB
03_small.txt AC 51 ms 61668 KB
04_small.txt AC 53 ms 61856 KB
05_small.txt AC 50 ms 61996 KB
06_small.txt AC 48 ms 61756 KB
07_small.txt AC 52 ms 61896 KB
08_small.txt AC 50 ms 61676 KB
09_small.txt AC 49 ms 61888 KB
10_small.txt AC 51 ms 61688 KB
11_small.txt AC 45 ms 61724 KB
12_small.txt AC 48 ms 61656 KB
13_small.txt AC 50 ms 61900 KB
14_small.txt AC 53 ms 61716 KB
15_small.txt AC 51 ms 61700 KB
16_large.txt AC 212 ms 88048 KB
17_large.txt AC 338 ms 108276 KB
18_large.txt AC 158 ms 79552 KB
19_large.txt AC 160 ms 79592 KB
20_large.txt AC 170 ms 80404 KB
21_large.txt AC 146 ms 78188 KB
22_large.txt AC 139 ms 76020 KB
23_large.txt AC 84 ms 69520 KB
24_large.txt AC 302 ms 102304 KB
25_large.txt AC 349 ms 114752 KB
26_max.txt AC 325 ms 112504 KB
27_max.txt AC 320 ms 112468 KB
28_max.txt AC 348 ms 112376 KB
sample_01.txt AC 52 ms 61908 KB
sample_02.txt AC 51 ms 61768 KB
sample_03.txt AC 52 ms 61704 KB