Submission #19619686


Source Code Expand

Copy
N, D, K = map(int, input().split(' '))
L_Rs = [list(map(int, input().split(' '))) for _ in range(D)]
S_Ts = [list(map(int, input().split(' '))) for _ in range(K)]

# print(S_Ts)
for S, T in S_Ts:
    current = S
    for i, (L, R) in enumerate(L_Rs):
        if S < T and L <= current <= R:
            current = min(T, R)

        elif S > T and L <= current <= R:
            current = max(T, L)
        
        if current == T:
            print(i+1)
            break
    

Submission Info

Submission Time
Task C - 民族大移動
User moono08
Language Python (3.8.2)
Score 100
Code Size 493 Byte
Status AC
Exec Time 287 ms
Memory 10724 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 100 / 100
Status
AC × 3
AC × 52
Set Name Test Cases
Sample sample_01.txt, sample_02.txt, sample_03.txt
All sample_01.txt, sample_02.txt, sample_03.txt, subtask1_01.txt, subtask1_02.txt, subtask1_03.txt, subtask1_04.txt, subtask1_05.txt, subtask1_06.txt, subtask1_07.txt, subtask1_08.txt, subtask1_09.txt, subtask1_10.txt, subtask1_11.txt, subtask1_12.txt, subtask1_13.txt, subtask1_14.txt, subtask1_15.txt, subtask1_16.txt, subtask1_17.txt, subtask1_18.txt, subtask1_19.txt, subtask1_20.txt, subtask1_21.txt, subtask1_22.txt, subtask1_23.txt, subtask1_24.txt, subtask1_25.txt, subtask1_26.txt, subtask1_27.txt, subtask1_28.txt, subtask1_29.txt, subtask1_30.txt, subtask1_31.txt, subtask1_32.txt, subtask1_33.txt, subtask1_34.txt, subtask1_35.txt, subtask1_36.txt, subtask1_37.txt, subtask1_38.txt, subtask1_39.txt, subtask1_40.txt, subtask1_41.txt, subtask1_42.txt, subtask1_43.txt, subtask1_44.txt, subtask1_45.txt, subtask1_46.txt, subtask1_47.txt, subtask1_48.txt, subtask1_49.txt
Case Name Status Exec Time Memory
sample_01.txt AC 20 ms 9200 KB
sample_02.txt AC 21 ms 8896 KB
sample_03.txt AC 18 ms 9032 KB
subtask1_01.txt AC 37 ms 10192 KB
subtask1_02.txt AC 29 ms 9136 KB
subtask1_03.txt AC 31 ms 9456 KB
subtask1_04.txt AC 41 ms 10136 KB
subtask1_05.txt AC 44 ms 10720 KB
subtask1_06.txt AC 42 ms 10148 KB
subtask1_07.txt AC 38 ms 10136 KB
subtask1_08.txt AC 34 ms 9452 KB
subtask1_09.txt AC 39 ms 9872 KB
subtask1_10.txt AC 26 ms 9048 KB
subtask1_11.txt AC 39 ms 10144 KB
subtask1_12.txt AC 31 ms 9452 KB
subtask1_13.txt AC 27 ms 9140 KB
subtask1_14.txt AC 45 ms 10536 KB
subtask1_15.txt AC 46 ms 10640 KB
subtask1_16.txt AC 46 ms 10400 KB
subtask1_17.txt AC 45 ms 10404 KB
subtask1_18.txt AC 45 ms 10724 KB
subtask1_19.txt AC 43 ms 10572 KB
subtask1_20.txt AC 47 ms 10400 KB
subtask1_21.txt AC 46 ms 10584 KB
subtask1_22.txt AC 47 ms 10408 KB
subtask1_23.txt AC 49 ms 10636 KB
subtask1_24.txt AC 44 ms 10640 KB
subtask1_25.txt AC 47 ms 10576 KB
subtask1_26.txt AC 48 ms 10576 KB
subtask1_27.txt AC 48 ms 10572 KB
subtask1_28.txt AC 43 ms 10400 KB
subtask1_29.txt AC 44 ms 10408 KB
subtask1_30.txt AC 46 ms 10592 KB
subtask1_31.txt AC 46 ms 10508 KB
subtask1_32.txt AC 43 ms 10572 KB
subtask1_33.txt AC 45 ms 10572 KB
subtask1_34.txt AC 45 ms 10408 KB
subtask1_35.txt AC 44 ms 10404 KB
subtask1_36.txt AC 44 ms 10400 KB
subtask1_37.txt AC 45 ms 10580 KB
subtask1_38.txt AC 47 ms 10716 KB
subtask1_39.txt AC 44 ms 10532 KB
subtask1_40.txt AC 41 ms 10556 KB
subtask1_41.txt AC 271 ms 10532 KB
subtask1_42.txt AC 280 ms 10508 KB
subtask1_43.txt AC 276 ms 10640 KB
subtask1_44.txt AC 278 ms 10404 KB
subtask1_45.txt AC 283 ms 10400 KB
subtask1_46.txt AC 277 ms 10460 KB
subtask1_47.txt AC 261 ms 10632 KB
subtask1_48.txt AC 272 ms 10512 KB
subtask1_49.txt AC 287 ms 10532 KB