結果

問題 No.1313 N言っちゃダメゲーム (4)
ユーザー sotanishysotanishy
提出日時 2020-12-13 23:01:05
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 428 bytes
コンパイル時間 200 ms
コンパイル使用メモリ 81,912 KB
実行使用メモリ 66,796 KB
最終ジャッジ日時 2023-10-20 04:31:06
合計ジャッジ時間 3,695 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
53,232 KB
testcase_01 AC 39 ms
53,232 KB
testcase_02 AC 39 ms
53,232 KB
testcase_03 AC 37 ms
53,232 KB
testcase_04 WA -
testcase_05 AC 37 ms
53,232 KB
testcase_06 AC 40 ms
53,232 KB
testcase_07 AC 38 ms
53,232 KB
testcase_08 WA -
testcase_09 AC 39 ms
53,232 KB
testcase_10 AC 37 ms
53,232 KB
testcase_11 AC 37 ms
53,232 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 48 ms
61,808 KB
testcase_15 AC 49 ms
61,792 KB
testcase_16 AC 53 ms
63,992 KB
testcase_17 AC 50 ms
61,800 KB
testcase_18 AC 49 ms
62,660 KB
testcase_19 AC 50 ms
62,584 KB
testcase_20 AC 45 ms
59,744 KB
testcase_21 AC 50 ms
62,352 KB
testcase_22 AC 47 ms
62,092 KB
testcase_23 AC 56 ms
64,560 KB
testcase_24 AC 51 ms
63,732 KB
testcase_25 AC 57 ms
66,796 KB
testcase_26 AC 46 ms
61,640 KB
testcase_27 AC 53 ms
64,360 KB
testcase_28 AC 62 ms
66,084 KB
testcase_29 AC 62 ms
66,080 KB
testcase_30 AC 61 ms
66,080 KB
testcase_31 AC 63 ms
66,084 KB
testcase_32 AC 62 ms
66,076 KB
testcase_33 AC 56 ms
64,000 KB
testcase_34 AC 56 ms
64,000 KB
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

N, K = map(int, input().split())
S = 'o' + input().rstrip() + 'x'
win = [False] * (N + 1)
cnt = 0
for i in range(1, N)[::-1]:
    if S[i] == 'o' and not win[i + 1]:
        cnt += 1
    if i + K + 1 <= N and S[i + K] == 'o' and not win[i + K + 1]:
        cnt -= 1
    if cnt:
        win[i] = True
for i in range(1, K + 1):
    if not win[i + 1]:
        print(i)
        exit()
print(0)
0