提出 #73487352


ソースコード 拡げる

from collections import deque
T=int(input())
for t in range(T) :
    N,D=map(int,input().split())
    A=list(map(int,input().split()))
    B=list(map(int,input().split()))
    E=deque()
    for i in range(N) :
        for k in range(A[i]) :
            E.append(i)
        u=0
        while u<B[i] :
            if E[0]+D>=i :
                u+=1
            E.popleft()
    ans=0
    while len(E)>0 :
        if E[0]+D>=N :
            ans+=1
        E.popleft()
    print(ans)

提出情報

提出日時
問題 C - Omelette Restaurant
ユーザ Youteru
言語 Python (PyPy 3.11-v7.3.20)
得点 300
コード長 501 Byte
結果 AC
実行時間 864 ms
メモリ 186536 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 300 / 300
結果
AC × 1
AC × 30
セット名 テストケース
Sample example_00.txt
All example_00.txt, hand_00.txt, hand_01.txt, hand_02.txt, hand_03.txt, hand_04.txt, hand_05.txt, hand_06.txt, hand_07.txt, hand_08.txt, random_00.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, random_11.txt, random_12.txt, random_13.txt, random_14.txt, random_15.txt, random_16.txt, random_17.txt, random_18.txt, random_19.txt
ケース名 結果 実行時間 メモリ
example_00.txt AC 66 ms 93592 KiB
hand_00.txt AC 174 ms 186536 KiB
hand_01.txt AC 143 ms 159044 KiB
hand_02.txt AC 141 ms 159952 KiB
hand_03.txt AC 145 ms 159732 KiB
hand_04.txt AC 141 ms 159692 KiB
hand_05.txt AC 864 ms 110616 KiB
hand_06.txt AC 121 ms 158716 KiB
hand_07.txt AC 534 ms 126564 KiB
hand_08.txt AC 66 ms 93968 KiB
random_00.txt AC 294 ms 110436 KiB
random_01.txt AC 292 ms 110380 KiB
random_02.txt AC 290 ms 110340 KiB
random_03.txt AC 292 ms 110332 KiB
random_04.txt AC 294 ms 110744 KiB
random_05.txt AC 112 ms 109568 KiB
random_06.txt AC 112 ms 109760 KiB
random_07.txt AC 116 ms 110364 KiB
random_08.txt AC 111 ms 109788 KiB
random_09.txt AC 111 ms 109984 KiB
random_10.txt AC 129 ms 158344 KiB
random_11.txt AC 127 ms 158732 KiB
random_12.txt AC 127 ms 158512 KiB
random_13.txt AC 129 ms 158664 KiB
random_14.txt AC 130 ms 158396 KiB
random_15.txt AC 129 ms 158764 KiB
random_16.txt AC 130 ms 158636 KiB
random_17.txt AC 129 ms 158580 KiB
random_18.txt AC 129 ms 158628 KiB
random_19.txt AC 129 ms 158640 KiB