Submission #34090814


Source Code Expand

Copy
N, X = map(int, input().split())
n = min(N, X)
acc = 0
print(min((acc := acc + a + b) + b * (X - i) for i, (a, b) in enumerate(([int(x) for x in input().split()] for _ in range(n)), start=1)))
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
N, X = map(int, input().split())
n = min(N, X)
acc = 0
print(min((acc := acc + a + b) + b * (X - i) for i, (a, b) in enumerate(([int(x) for x in input().split()] for _ in range(n)), start=1)))

Submission Info

Submission Time
Task D - Trophy
User arakaki_tokyo
Language Python (3.8.2)
Score 400
Code Size 195 Byte
Status AC
Exec Time 400 ms
Memory 9208 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 400 / 400
Status
AC × 2
AC × 21
Set Name Test Cases
Sample example_00.txt, example_01.txt
All example_00.txt, example_01.txt, test_00.txt, test_01.txt, test_02.txt, test_03.txt, test_04.txt, test_05.txt, test_06.txt, test_07.txt, test_08.txt, test_09.txt, test_10.txt, test_11.txt, test_12.txt, test_13.txt, test_14.txt, test_15.txt, test_16.txt, test_17.txt, test_18.txt
Case Name Status Exec Time Memory
example_00.txt AC 18 ms 9060 KB
example_01.txt AC 17 ms 9208 KB
test_00.txt AC 393 ms 9200 KB
test_01.txt AC 397 ms 9056 KB
test_02.txt AC 391 ms 9080 KB
test_03.txt AC 180 ms 9076 KB
test_04.txt AC 319 ms 9196 KB
test_05.txt AC 129 ms 8904 KB
test_06.txt AC 363 ms 9004 KB
test_07.txt AC 395 ms 9064 KB
test_08.txt AC 396 ms 9064 KB
test_09.txt AC 400 ms 9064 KB
test_10.txt AC 199 ms 9012 KB
test_11.txt AC 289 ms 9012 KB
test_12.txt AC 95 ms 8908 KB
test_13.txt AC 105 ms 8916 KB
test_14.txt AC 20 ms 8892 KB
test_15.txt AC 394 ms 9196 KB
test_16.txt AC 394 ms 9200 KB
test_17.txt AC 399 ms 9012 KB
test_18.txt AC 396 ms 9196 KB


2025-04-08 (Tue)
17:36:16 +00:00