結果

問題 No.2566 美しい整数列
ユーザー noriaokinoriaoki
提出日時 2023-12-02 20:45:13
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 241 ms / 2,000 ms
コード長 344 bytes
コンパイル時間 275 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 156,612 KB
最終ジャッジ日時 2023-12-02 20:45:20
合計ジャッジ時間 6,001 ms
ジャッジサーバーID
(参考情報)
judge10 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
53,332 KB
testcase_01 AC 40 ms
53,332 KB
testcase_02 AC 39 ms
53,332 KB
testcase_03 AC 40 ms
53,332 KB
testcase_04 AC 241 ms
154,404 KB
testcase_05 AC 219 ms
156,612 KB
testcase_06 AC 165 ms
125,644 KB
testcase_07 AC 169 ms
142,128 KB
testcase_08 AC 163 ms
122,128 KB
testcase_09 AC 177 ms
142,204 KB
testcase_10 AC 176 ms
142,336 KB
testcase_11 AC 197 ms
142,032 KB
testcase_12 AC 183 ms
142,500 KB
testcase_13 AC 185 ms
142,164 KB
testcase_14 AC 184 ms
142,248 KB
testcase_15 AC 183 ms
142,360 KB
testcase_16 AC 195 ms
146,668 KB
testcase_17 AC 216 ms
148,268 KB
testcase_18 AC 202 ms
149,396 KB
testcase_19 AC 160 ms
136,580 KB
testcase_20 AC 188 ms
138,388 KB
testcase_21 AC 190 ms
139,916 KB
testcase_22 AC 142 ms
123,352 KB
testcase_23 AC 179 ms
118,432 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()))
import collections
d = collections.defaultdict(int)
acc = B[0]
d[0] += C[0]
for i in range(N-1):
    var = (A[i+1] - acc) - A[0]
    d[var] += C[i+1]
    acc += B[(i+1)%M]
print(sum(C) - max(d.values()))
0