結果

問題 No.2566 美しい整数列
ユーザー mymelochanmymelochan
提出日時 2023-12-02 15:57:34
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 199 ms / 2,000 ms
コード長 739 bytes
コンパイル時間 195 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 157,600 KB
最終ジャッジ日時 2023-12-02 15:57:40
合計ジャッジ時間 5,910 ms
ジャッジサーバーID
(参考情報)
judge9 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
55,596 KB
testcase_01 AC 38 ms
55,596 KB
testcase_02 AC 39 ms
55,596 KB
testcase_03 AC 40 ms
55,596 KB
testcase_04 AC 193 ms
156,708 KB
testcase_05 AC 199 ms
157,600 KB
testcase_06 AC 152 ms
138,300 KB
testcase_07 AC 169 ms
134,424 KB
testcase_08 AC 149 ms
136,276 KB
testcase_09 AC 150 ms
135,004 KB
testcase_10 AC 146 ms
135,004 KB
testcase_11 AC 163 ms
133,744 KB
testcase_12 AC 163 ms
133,880 KB
testcase_13 AC 160 ms
133,864 KB
testcase_14 AC 170 ms
134,556 KB
testcase_15 AC 165 ms
134,680 KB
testcase_16 AC 176 ms
149,600 KB
testcase_17 AC 182 ms
151,196 KB
testcase_18 AC 176 ms
151,596 KB
testcase_19 AC 133 ms
130,676 KB
testcase_20 AC 168 ms
147,048 KB
testcase_21 AC 194 ms
148,120 KB
testcase_22 AC 122 ms
122,668 KB
testcase_23 AC 155 ms
134,656 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#############################################################

import sys
sys.setrecursionlimit(10**7)

from heapq import heappop,heappush
from collections import deque,defaultdict,Counter
from bisect import bisect_left, bisect_right
from itertools import product,combinations,permutations
from math import sin,cos
#from math import isqrt #DO NOT USE PyPy

ipt = sys.stdin.readline
iin = lambda :int(ipt())
lmin = lambda :list(map(int,ipt().split()))

#############################################################

N,M = lmin()
A = lmin()
B = lmin()
C = lmin()

D = defaultdict(int)
tmp = 0
sm = 0
SC = sum(C)
for i in range(N):
    D[A[i]-sm] += C[i]
    sm += B[i%M]

ans = 1<<60
for k,v in D.items():
    ans = min(ans,SC-v)
print(ans)
0