結果

問題 No.78 クジ付きアイスバー
ユーザー steek79steek79
提出日時 2015-10-21 23:16:35
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 361 bytes
コンパイル時間 74 ms
コンパイル使用メモリ 7,040 KB
実行使用メモリ 14,136 KB
最終ジャッジ日時 2024-04-16 05:44:04
合計ジャッジ時間 7,044 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 11 ms
13,084 KB
testcase_01 AC 11 ms
6,944 KB
testcase_02 AC 11 ms
6,940 KB
testcase_03 AC 11 ms
6,944 KB
testcase_04 WA -
testcase_05 AC 11 ms
6,944 KB
testcase_06 AC 12 ms
6,940 KB
testcase_07 AC 12 ms
6,940 KB
testcase_08 AC 11 ms
6,940 KB
testcase_09 AC 11 ms
6,944 KB
testcase_10 AC 11 ms
6,940 KB
testcase_11 AC 11 ms
6,944 KB
testcase_12 AC 11 ms
6,948 KB
testcase_13 AC 11 ms
6,944 KB
testcase_14 AC 11 ms
6,944 KB
testcase_15 AC 12 ms
6,944 KB
testcase_16 AC 11 ms
6,940 KB
testcase_17 AC 11 ms
6,940 KB
testcase_18 AC 11 ms
6,944 KB
testcase_19 WA -
testcase_20 TLE -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

N, K = map(int, raw_input().split())
S = raw_input()

ans = 0
free = 0
eaten = 0

while True:
    for i in xrange(len(S)):
        if free > 0:
            free -= 1
        else:
            ans += 1

        eaten += 1
        free += int(S[i])

        if eaten == K:
            print ans
            exit()
    if free > 0:
        print ans
        exit()
0