結果

問題 No.1313 N言っちゃダメゲーム (4)
ユーザー roarisroaris
提出日時 2020-12-10 00:42:36
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 53 ms / 2,000 ms
コード長 411 bytes
コンパイル時間 1,173 ms
コンパイル使用メモリ 81,380 KB
実行使用メモリ 63,600 KB
最終ジャッジ日時 2023-10-19 10:59:41
合計ジャッジ時間 4,000 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
53,300 KB
testcase_01 AC 39 ms
53,300 KB
testcase_02 AC 40 ms
53,300 KB
testcase_03 AC 39 ms
53,300 KB
testcase_04 AC 39 ms
53,300 KB
testcase_05 AC 39 ms
53,300 KB
testcase_06 AC 39 ms
53,300 KB
testcase_07 AC 39 ms
53,300 KB
testcase_08 AC 39 ms
53,300 KB
testcase_09 AC 39 ms
53,300 KB
testcase_10 AC 40 ms
53,300 KB
testcase_11 AC 39 ms
53,300 KB
testcase_12 AC 41 ms
53,300 KB
testcase_13 AC 48 ms
61,404 KB
testcase_14 AC 51 ms
61,484 KB
testcase_15 AC 51 ms
61,528 KB
testcase_16 AC 51 ms
61,544 KB
testcase_17 AC 50 ms
61,460 KB
testcase_18 AC 48 ms
60,604 KB
testcase_19 AC 49 ms
60,528 KB
testcase_20 AC 45 ms
59,736 KB
testcase_21 AC 47 ms
60,296 KB
testcase_22 AC 47 ms
60,036 KB
testcase_23 AC 49 ms
60,344 KB
testcase_24 AC 45 ms
59,528 KB
testcase_25 AC 51 ms
60,524 KB
testcase_26 AC 46 ms
59,524 KB
testcase_27 AC 46 ms
60,156 KB
testcase_28 AC 49 ms
61,472 KB
testcase_29 AC 49 ms
61,476 KB
testcase_30 AC 52 ms
61,472 KB
testcase_31 AC 51 ms
61,472 KB
testcase_32 AC 53 ms
63,600 KB
testcase_33 AC 53 ms
63,540 KB
testcase_34 AC 52 ms
63,540 KB
testcase_35 AC 47 ms
61,404 KB
testcase_36 AC 51 ms
63,532 KB
testcase_37 AC 51 ms
63,532 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

N, K = map(int, input().split())
S = input()[:-1]
dp = [False]*N

if S[-1]=='o':
    lose = N-1
else:
    lose = 10**18
    
for i in range(N-2, -1, -1):
    if lose<=i+K:
        dp[i] = True
    else:
        if S[i-1]=='o':
            lose = i
    
if not dp[0]:
    print(0)
else:
    for i in range(1, K+1):
        if S[i-1]=='o' and not dp[i]:
            print(i)
0