結果

問題 No.2566 美しい整数列
ユーザー ntudantuda
提出日時 2023-12-04 19:59:14
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 262 ms / 2,000 ms
コード長 306 bytes
コンパイル時間 349 ms
コンパイル使用メモリ 81,572 KB
実行使用メモリ 160,160 KB
最終ジャッジ日時 2023-12-04 19:59:22
合計ジャッジ時間 7,816 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
53,332 KB
testcase_01 AC 41 ms
53,332 KB
testcase_02 AC 39 ms
53,332 KB
testcase_03 AC 38 ms
53,332 KB
testcase_04 AC 262 ms
156,868 KB
testcase_05 AC 231 ms
160,160 KB
testcase_06 AC 171 ms
141,636 KB
testcase_07 AC 165 ms
137,544 KB
testcase_08 AC 165 ms
139,132 KB
testcase_09 AC 166 ms
137,836 KB
testcase_10 AC 177 ms
137,836 KB
testcase_11 AC 179 ms
137,568 KB
testcase_12 AC 181 ms
138,324 KB
testcase_13 AC 178 ms
137,564 KB
testcase_14 AC 178 ms
137,696 KB
testcase_15 AC 181 ms
137,852 KB
testcase_16 AC 206 ms
147,444 KB
testcase_17 AC 199 ms
148,264 KB
testcase_18 AC 201 ms
149,932 KB
testcase_19 AC 155 ms
132,976 KB
testcase_20 AC 192 ms
147,896 KB
testcase_21 AC 197 ms
148,664 KB
testcase_22 AC 144 ms
123,668 KB
testcase_23 AC 198 ms
137,024 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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