結果

問題 No.1313 N言っちゃダメゲーム (4)
ユーザー sotanishysotanishy
提出日時 2020-12-13 22:44:56
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 496 bytes
コンパイル時間 229 ms
コンパイル使用メモリ 81,848 KB
実行使用メモリ 77,776 KB
最終ジャッジ日時 2023-10-20 04:28:50
合計ジャッジ時間 3,634 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
53,516 KB
testcase_01 AC 36 ms
53,516 KB
testcase_02 AC 36 ms
53,516 KB
testcase_03 AC 36 ms
53,516 KB
testcase_04 WA -
testcase_05 AC 37 ms
53,516 KB
testcase_06 AC 35 ms
53,516 KB
testcase_07 AC 35 ms
53,516 KB
testcase_08 WA -
testcase_09 AC 35 ms
53,516 KB
testcase_10 AC 35 ms
53,516 KB
testcase_11 AC 35 ms
53,516 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 49 ms
62,304 KB
testcase_16 AC 51 ms
64,368 KB
testcase_17 AC 49 ms
64,412 KB
testcase_18 AC 47 ms
63,068 KB
testcase_19 AC 47 ms
62,992 KB
testcase_20 AC 45 ms
60,152 KB
testcase_21 AC 48 ms
62,760 KB
testcase_22 AC 46 ms
62,500 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
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 = [True] * (N + 1)
for i, s in enumerate(S):
    if s == 'x':
        win[i] = False
cnt = 0
for i in range(N)[::-1]:
    if not win[i]:
        continue
    if not win[i + 1]:
        cnt += 1
    if i + K + 1 <= N and not win[i + K + 1]:
        cnt -= 1
    if cnt == 0:
        win[i] = False
for i in range(1, K + 1):
    if not win[i + 1]:
        print(i)
        exit()
print(0)
0