Submission #60508085


Source Code Expand

Copy
N = int(input())
s = 0
last = 0
for _ in range(N):
t,v = map(int,input().split())
s -= t-last
last = t
s = max(s,0)
s += v
print(s)
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
N = int(input())
s = 0
last = 0 
for _ in range(N):
  t,v = map(int,input().split())
  s -= t-last
  last = t
  s = max(s,0)
  s += v
  
print(s)

Submission Info

Submission Time
Task A - Humidifier 1
User QWERTOP18
Language Python (PyPy 3.10-v7.3.12)
Score 150
Code Size 155 Byte
Status AC
Exec Time 58 ms
Memory 76656 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 150 / 150
Status
AC × 3
AC × 20
Set Name Test Cases
Sample 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt
All 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 01_test_00.txt, 01_test_01.txt, 01_test_02.txt, 01_test_03.txt, 01_test_04.txt, 01_test_05.txt, 01_test_06.txt, 01_test_07.txt, 01_test_08.txt, 01_test_09.txt, 01_test_10.txt, 01_test_11.txt, 01_test_12.txt, 01_test_13.txt, 01_test_14.txt, 01_test_15.txt, 01_test_16.txt
Case Name Status Exec Time Memory
00_sample_00.txt AC 57 ms 76428 KB
00_sample_01.txt AC 57 ms 76432 KB
00_sample_02.txt AC 56 ms 76324 KB
01_test_00.txt AC 57 ms 76468 KB
01_test_01.txt AC 57 ms 76292 KB
01_test_02.txt AC 57 ms 76280 KB
01_test_03.txt AC 56 ms 76568 KB
01_test_04.txt AC 56 ms 76280 KB
01_test_05.txt AC 58 ms 76296 KB
01_test_06.txt AC 58 ms 76576 KB
01_test_07.txt AC 56 ms 76268 KB
01_test_08.txt AC 57 ms 76416 KB
01_test_09.txt AC 56 ms 76220 KB
01_test_10.txt AC 56 ms 76272 KB
01_test_11.txt AC 57 ms 76432 KB
01_test_12.txt AC 57 ms 76216 KB
01_test_13.txt AC 57 ms 76168 KB
01_test_14.txt AC 57 ms 76272 KB
01_test_15.txt AC 58 ms 76596 KB
01_test_16.txt AC 56 ms 76656 KB


2025-04-14 (Mon)
23:10:08 +00:00