結果

問題 No.1313 N言っちゃダメゲーム (4)
ユーザー shotoyooshotoyoo
提出日時 2020-12-10 01:10:10
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 560 bytes
コンパイル時間 188 ms
コンパイル使用メモリ 81,772 KB
実行使用メモリ 80,852 KB
最終ジャッジ日時 2023-10-19 11:26:59
合計ジャッジ時間 3,585 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,480 KB
testcase_01 AC 38 ms
53,480 KB
testcase_02 AC 39 ms
53,480 KB
testcase_03 AC 38 ms
53,480 KB
testcase_04 WA -
testcase_05 AC 38 ms
53,480 KB
testcase_06 AC 39 ms
53,480 KB
testcase_07 AC 38 ms
53,480 KB
testcase_08 WA -
testcase_09 AC 38 ms
53,480 KB
testcase_10 WA -
testcase_11 AC 38 ms
53,480 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 50 ms
61,668 KB
testcase_16 AC 52 ms
63,868 KB
testcase_17 AC 53 ms
65,764 KB
testcase_18 AC 51 ms
62,928 KB
testcase_19 AC 50 ms
62,852 KB
testcase_20 AC 46 ms
60,012 KB
testcase_21 AC 49 ms
62,620 KB
testcase_22 AC 47 ms
60,312 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 = 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 = 1 # 0の個数
dp = [None]*(n)
dp[n-1] = 0
for i in range(n-2,0,-1):
    if s[i]=="x":
        v = 0
    else:
        if c>0:
            v = 1
        else:
            v = 0
    dp[i] = v
    if v==0:
        c += 1
    if i+k<n and dp[i+k]==0:
        c -= 1
if c==0:
    print(0)
else:
    for i in range(1,k+1):
        if dp[i]==0:
            print(i)
0