結果

問題 No.2566 美しい整数列
ユーザー KudeKude
提出日時 2023-12-12 23:16:38
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 276 ms / 2,000 ms
コード長 329 bytes
コンパイル時間 262 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 165,980 KB
最終ジャッジ日時 2023-12-12 23:16:45
合計ジャッジ時間 6,585 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
53,460 KB
testcase_01 AC 36 ms
53,460 KB
testcase_02 AC 36 ms
53,460 KB
testcase_03 AC 40 ms
53,460 KB
testcase_04 AC 260 ms
145,216 KB
testcase_05 AC 256 ms
141,468 KB
testcase_06 AC 168 ms
125,768 KB
testcase_07 AC 170 ms
142,248 KB
testcase_08 AC 161 ms
122,264 KB
testcase_09 AC 170 ms
142,200 KB
testcase_10 AC 181 ms
142,336 KB
testcase_11 AC 203 ms
142,164 KB
testcase_12 AC 206 ms
142,760 KB
testcase_13 AC 203 ms
142,200 KB
testcase_14 AC 202 ms
142,504 KB
testcase_15 AC 204 ms
142,488 KB
testcase_16 AC 268 ms
165,980 KB
testcase_17 AC 266 ms
162,208 KB
testcase_18 AC 265 ms
160,040 KB
testcase_19 AC 191 ms
125,944 KB
testcase_20 AC 255 ms
157,308 KB
testcase_21 AC 276 ms
163,556 KB
testcase_22 AC 179 ms
126,424 KB
testcase_23 AC 219 ms
125,344 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()))
now = 0
d = {}
for i, x in enumerate(a):
    d.setdefault(x - now, []).append(i)
    now += b[i % m]
gain = max(sum(c[i] for i in idx) for idx in d.values())
ans = sum(c) - gain
print(ans)
0