提出 #73478655


ソースコード 拡げる

for _ in range(int(input())):
  n0,n1=map(int,input().split(' '))
  nn0=list(map(int,input().split(' ')))
  nn1=list(map(int,input().split(' ')))
  nn2=[0 for _ in range(n0)]
  j=0
  for i in range(n0):
    nn2[i]+=nn0[i]
    f0=nn1[i]
    while f0>0:
      f1=min(nn2[j],f0)
      f0-=f1
      nn2[j]-=f1
      if nn2[j]==0:
        j+=1
    while j+n1<=i:
      nn2[j]=0
      j+=1
  print(sum(nn2))

提出情報

提出日時
問題 C - Omelette Restaurant
ユーザ bscdesu
言語 Python (CPython 3.13.7)
得点 300
コード長 419 Byte
結果 AC
実行時間 772 ms
メモリ 25020 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 10 ms 9084 KiB
hand_00.txt AC 104 ms 23280 KiB
hand_01.txt AC 115 ms 23280 KiB
hand_02.txt AC 105 ms 25020 KiB
hand_03.txt AC 145 ms 24932 KiB
hand_04.txt AC 106 ms 24932 KiB
hand_05.txt AC 772 ms 9144 KiB
hand_06.txt AC 128 ms 16048 KiB
hand_07.txt AC 439 ms 12076 KiB
hand_08.txt AC 10 ms 9172 KiB
random_00.txt AC 243 ms 9144 KiB
random_01.txt AC 239 ms 9132 KiB
random_02.txt AC 241 ms 8992 KiB
random_03.txt AC 239 ms 9172 KiB
random_04.txt AC 238 ms 9164 KiB
random_05.txt AC 122 ms 9852 KiB
random_06.txt AC 123 ms 10060 KiB
random_07.txt AC 121 ms 9996 KiB
random_08.txt AC 142 ms 10028 KiB
random_09.txt AC 117 ms 9912 KiB
random_10.txt AC 140 ms 14956 KiB
random_11.txt AC 128 ms 15084 KiB
random_12.txt AC 122 ms 15068 KiB
random_13.txt AC 129 ms 15104 KiB
random_14.txt AC 132 ms 15040 KiB
random_15.txt AC 138 ms 14984 KiB
random_16.txt AC 132 ms 15128 KiB
random_17.txt AC 125 ms 15060 KiB
random_18.txt AC 122 ms 15056 KiB
random_19.txt AC 132 ms 15064 KiB