結果

問題 No.2566 美しい整数列
ユーザー kemunikukemuniku
提出日時 2023-12-02 17:10:27
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 228 ms / 2,000 ms
コード長 294 bytes
コンパイル時間 379 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 160,032 KB
最終ジャッジ日時 2023-12-02 17:10:34
合計ジャッジ時間 6,205 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
53,204 KB
testcase_01 AC 40 ms
53,204 KB
testcase_02 AC 41 ms
53,204 KB
testcase_03 AC 41 ms
53,204 KB
testcase_04 AC 228 ms
156,736 KB
testcase_05 AC 218 ms
160,032 KB
testcase_06 AC 174 ms
141,500 KB
testcase_07 AC 172 ms
137,420 KB
testcase_08 AC 188 ms
138,992 KB
testcase_09 AC 173 ms
137,696 KB
testcase_10 AC 172 ms
137,696 KB
testcase_11 AC 182 ms
137,428 KB
testcase_12 AC 184 ms
138,196 KB
testcase_13 AC 183 ms
137,436 KB
testcase_14 AC 188 ms
137,596 KB
testcase_15 AC 186 ms
137,716 KB
testcase_16 AC 196 ms
147,316 KB
testcase_17 AC 200 ms
148,136 KB
testcase_18 AC 202 ms
149,796 KB
testcase_19 AC 160 ms
132,848 KB
testcase_20 AC 201 ms
147,760 KB
testcase_21 AC 198 ms
148,536 KB
testcase_22 AC 146 ms
123,536 KB
testcase_23 AC 175 ms
137,016 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict
N,M = map(int,input().split())
A = list( map(int,input().split()))
B = list( map(int,input().split()))
C = list( map(int,input().split()))
now = 0
d = defaultdict(int)
for i in range(N):
    d[now-A[i]] += C[i]
    now += B[i%M]
print(sum(C)-max(d.values()))
0