結果

問題 No.2566 美しい整数列
ユーザー takutaku
提出日時 2023-12-04 09:57:34
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 219 ms / 2,000 ms
コード長 290 bytes
コンパイル時間 610 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 160,160 KB
最終ジャッジ日時 2023-12-04 09:57:41
合計ジャッジ時間 6,115 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
53,332 KB
testcase_01 AC 40 ms
53,328 KB
testcase_02 AC 40 ms
53,332 KB
testcase_03 AC 41 ms
53,332 KB
testcase_04 AC 219 ms
156,860 KB
testcase_05 AC 218 ms
160,160 KB
testcase_06 AC 173 ms
141,628 KB
testcase_07 AC 169 ms
137,536 KB
testcase_08 AC 169 ms
139,120 KB
testcase_09 AC 172 ms
137,820 KB
testcase_10 AC 169 ms
137,824 KB
testcase_11 AC 182 ms
137,556 KB
testcase_12 AC 184 ms
138,316 KB
testcase_13 AC 181 ms
137,564 KB
testcase_14 AC 181 ms
137,728 KB
testcase_15 AC 185 ms
137,840 KB
testcase_16 AC 199 ms
147,436 KB
testcase_17 AC 202 ms
148,264 KB
testcase_18 AC 205 ms
149,924 KB
testcase_19 AC 161 ms
132,968 KB
testcase_20 AC 208 ms
147,892 KB
testcase_21 AC 202 ms
148,656 KB
testcase_22 AC 149 ms
123,664 KB
testcase_23 AC 178 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()))

cum = 0
di = defaultdict(int)
for i in range(N):
	di[A[i]-cum] += C[i]
	cum += B[i%M]
print(sum(C)-max(di.values()))
0