結果

問題 No.2566 美しい整数列
ユーザー ゼットゼット
提出日時 2023-12-21 00:33:41
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 224 ms / 2,000 ms
コード長 325 bytes
コンパイル時間 254 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 157,592 KB
最終ジャッジ日時 2023-12-21 00:33:49
合計ジャッジ時間 7,652 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
53,460 KB
testcase_01 AC 37 ms
53,460 KB
testcase_02 AC 37 ms
53,460 KB
testcase_03 AC 36 ms
53,460 KB
testcase_04 AC 216 ms
156,684 KB
testcase_05 AC 224 ms
157,592 KB
testcase_06 AC 166 ms
125,768 KB
testcase_07 AC 173 ms
142,252 KB
testcase_08 AC 162 ms
122,252 KB
testcase_09 AC 172 ms
142,332 KB
testcase_10 AC 171 ms
142,336 KB
testcase_11 AC 180 ms
142,080 KB
testcase_12 AC 184 ms
142,320 KB
testcase_13 AC 183 ms
142,216 KB
testcase_14 AC 188 ms
142,140 KB
testcase_15 AC 188 ms
142,232 KB
testcase_16 AC 206 ms
148,844 KB
testcase_17 AC 206 ms
150,264 KB
testcase_18 AC 208 ms
151,072 KB
testcase_19 AC 182 ms
132,344 KB
testcase_20 AC 192 ms
139,500 KB
testcase_21 AC 198 ms
148,856 KB
testcase_22 AC 144 ms
124,228 KB
testcase_23 AC 168 ms
119,448 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M=map(int,input().split())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
C=list(map(int,input().split()))
v=[0]*N
for i in range(1,N):
  v[i]=v[i-1]+B[(i-1)%M]
T={}
for i in range(N):
  w=A[i]-v[i]
  if not w in T:
    T[w]=C[i]
  else:
    T[w]+=C[i]
k=0
for n in T:
  k=max(k,T[n])
u=sum(C)
print(u-k)
0