結果

問題 No.1313 N言っちゃダメゲーム (4)
ユーザー shotoyooshotoyoo
提出日時 2020-12-10 01:28:47
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 53 ms / 2,000 ms
コード長 609 bytes
コンパイル時間 165 ms
コンパイル使用メモリ 81,616 KB
実行使用メモリ 65,248 KB
最終ジャッジ日時 2023-10-19 11:47:58
合計ジャッジ時間 3,107 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,384 KB
testcase_01 AC 38 ms
53,384 KB
testcase_02 AC 38 ms
53,384 KB
testcase_03 AC 37 ms
53,384 KB
testcase_04 AC 38 ms
53,384 KB
testcase_05 AC 38 ms
53,384 KB
testcase_06 AC 39 ms
53,384 KB
testcase_07 AC 38 ms
53,384 KB
testcase_08 AC 38 ms
53,384 KB
testcase_09 AC 38 ms
53,384 KB
testcase_10 AC 38 ms
53,384 KB
testcase_11 AC 38 ms
53,384 KB
testcase_12 AC 38 ms
53,384 KB
testcase_13 AC 48 ms
63,052 KB
testcase_14 AC 51 ms
65,248 KB
testcase_15 AC 49 ms
63,056 KB
testcase_16 AC 48 ms
62,272 KB
testcase_17 AC 47 ms
61,480 KB
testcase_18 AC 47 ms
61,348 KB
testcase_19 AC 47 ms
61,072 KB
testcase_20 AC 44 ms
59,796 KB
testcase_21 AC 45 ms
60,292 KB
testcase_22 AC 45 ms
60,412 KB
testcase_23 AC 50 ms
63,028 KB
testcase_24 AC 45 ms
59,776 KB
testcase_25 AC 50 ms
63,600 KB
testcase_26 AC 45 ms
59,688 KB
testcase_27 AC 47 ms
62,240 KB
testcase_28 AC 52 ms
63,880 KB
testcase_29 AC 51 ms
63,908 KB
testcase_30 AC 53 ms
64,372 KB
testcase_31 AC 52 ms
63,928 KB
testcase_32 AC 52 ms
64,532 KB
testcase_33 AC 50 ms
63,876 KB
testcase_34 AC 51 ms
63,736 KB
testcase_35 AC 48 ms
62,840 KB
testcase_36 AC 51 ms
64,112 KB
testcase_37 AC 50 ms
64,184 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")

    
n,k = list(map(int, input().split()))
s = input()
c = k # 0の個数
dp = [0]*(n+k)
for i in range(n-1,0,-1):
    if s[i-1]=="x":
        v = 0
    else:
        if c==k:
            v = 1
        else:
            v = 0
    dp[i] = v
    if v==0:
        c += 1
    if dp[i+k]==0:
        c -= 1
index = []
for i in range(1,k+1):
        if dp[i]!=0 and s[i-1]=="o":
            index.append(i)
if index:
    write("\n".join(map(str, index)))
else:
    print(0)
0