結果

問題 No.1313 N言っちゃダメゲーム (4)
ユーザー tamato
提出日時 2020-12-11 18:48:27
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 477 bytes
コンパイル時間 162 ms
コンパイル使用メモリ 82,600 KB
実行使用メモリ 60,416 KB
最終ジャッジ日時 2024-09-19 21:26:15
合計ジャッジ時間 2,620 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 26 WA * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 1000000007
eps = 10**-9


def main():
    import sys
    input = sys.stdin.readline

    N, K = map(int, input().split())
    S = input().rstrip('\n')

    i = N-1
    flg = 1
    while i > 0:
        if flg == 1:
            i -= K+1
            flg = 0
        else:
            if S[i-1] == "o":
                flg = 1
            else:
                i -= 1
    if i == 0:
        print(i)
    else:
        print(i + K + 1)


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