結果

問題 No.78 クジ付きアイスバー
ユーザー 👑 colognecologne
提出日時 2022-01-26 17:26:13
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 471 bytes
コンパイル時間 299 ms
コンパイル使用メモリ 86,656 KB
実行使用メモリ 75,944 KB
最終ジャッジ日時 2023-08-24 23:01:02
合計ジャッジ時間 5,244 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 74 ms
71,084 KB
testcase_02 AC 72 ms
71,224 KB
testcase_03 AC 73 ms
70,912 KB
testcase_04 AC 77 ms
71,028 KB
testcase_05 AC 73 ms
71,012 KB
testcase_06 AC 76 ms
71,108 KB
testcase_07 AC 75 ms
71,000 KB
testcase_08 AC 76 ms
71,156 KB
testcase_09 AC 75 ms
71,012 KB
testcase_10 AC 75 ms
70,908 KB
testcase_11 AC 74 ms
71,172 KB
testcase_12 AC 76 ms
71,016 KB
testcase_13 AC 74 ms
70,908 KB
testcase_14 AC 74 ms
71,092 KB
testcase_15 AC 74 ms
70,824 KB
testcase_16 AC 74 ms
71,148 KB
testcase_17 AC 76 ms
71,052 KB
testcase_18 AC 75 ms
70,824 KB
testcase_19 AC 79 ms
75,488 KB
testcase_20 AC 80 ms
75,504 KB
testcase_21 AC 80 ms
75,496 KB
testcase_22 AC 79 ms
75,744 KB
testcase_23 AC 71 ms
71,240 KB
testcase_24 AC 72 ms
71,076 KB
testcase_25 AC 71 ms
71,088 KB
testcase_26 AC 69 ms
71,016 KB
testcase_27 AC 70 ms
71,180 KB
testcase_28 AC 72 ms
71,004 KB
testcase_29 AC 73 ms
70,832 KB
testcase_30 AC 74 ms
71,004 KB
testcase_31 AC 71 ms
71,152 KB
testcase_32 AC 76 ms
75,488 KB
testcase_33 AC 78 ms
75,548 KB
testcase_34 AC 79 ms
75,628 KB
testcase_35 AC 76 ms
75,476 KB
testcase_36 AC 76 ms
75,740 KB
testcase_37 AC 79 ms
75,944 KB
testcase_38 AC 72 ms
70,824 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys


def input(): return sys.stdin.readline().rstrip()


def main():
    N, K = map(int, input().split())
    S = input()

    s = sum(map(int, S))
    if s >= N:
        K = min(N, 50)

    rep = max(0, (K - 100 * N) // N)
    ans = rep * (N - s)
    K -= N * rep

    cur = 0
    for i in range(K):
        if cur == 0:
            ans += 1
        else:
            cur -= 1
        cur += int(S[i % N])

    print(ans)


if __name__ == '__main__':
    main()
0