Submission #69861405
Source Code Expand
N, Q = map(int,input().split())
R = [list(map(int,input().split())) for _ in range(Q)]
Version = [1 for _ in range(N)]
SumVersion = [i for i in range(1,N+1)]
for i in range(Q):
Sum = 0
j = R[i][0] - 1
while j >= 0:
if Version[j] == -1 : j
Sum += Version[j]
Version[j] = 0
j -= 1
Version[R[i][1]-1] += Sum
print(Sum)
Submission Info
| Submission Time | |
|---|---|
| Task | C - Upgrade Required |
| User | NNN_125128 |
| Language | Python (PyPy 3.10-v7.3.12) |
| Score | 0 |
| Code Size | 397 Byte |
| Status | TLE |
| Exec Time | 2216 ms |
| Memory | 119716 KiB |
Judge Result
| Set Name | Sample | All | ||||||
|---|---|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 0 / 300 | ||||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | sample_01.txt |
| All | hand_01.txt, hand_02.txt, hand_03.txt, sample_01.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, test_19.txt, test_20.txt, test_21.txt, test_22.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| hand_01.txt | TLE | 2213 ms | 119320 KiB |
| hand_02.txt | TLE | 2212 ms | 118272 KiB |
| hand_03.txt | TLE | 2212 ms | 117956 KiB |
| sample_01.txt | AC | 56 ms | 76376 KiB |
| test_01.txt | AC | 57 ms | 76448 KiB |
| test_02.txt | TLE | 2212 ms | 118280 KiB |
| test_03.txt | TLE | 2215 ms | 118284 KiB |
| test_04.txt | TLE | 2215 ms | 118196 KiB |
| test_05.txt | TLE | 2213 ms | 119716 KiB |
| test_06.txt | TLE | 2215 ms | 118236 KiB |
| test_07.txt | TLE | 2213 ms | 119460 KiB |
| test_08.txt | TLE | 2212 ms | 118012 KiB |
| test_09.txt | TLE | 2213 ms | 118308 KiB |
| test_10.txt | AC | 757 ms | 104268 KiB |
| test_11.txt | AC | 788 ms | 104380 KiB |
| test_12.txt | AC | 246 ms | 104136 KiB |
| test_13.txt | AC | 245 ms | 103916 KiB |
| test_14.txt | TLE | 2215 ms | 117716 KiB |
| test_15.txt | TLE | 2216 ms | 119272 KiB |
| test_16.txt | TLE | 2215 ms | 117948 KiB |
| test_17.txt | TLE | 2212 ms | 118220 KiB |
| test_18.txt | TLE | 2213 ms | 119680 KiB |
| test_19.txt | TLE | 2212 ms | 117824 KiB |
| test_20.txt | TLE | 2212 ms | 118100 KiB |
| test_21.txt | TLE | 2212 ms | 117940 KiB |
| test_22.txt | TLE | 2212 ms | 118288 KiB |