結果
問題 |
No.1313 N言っちゃダメゲーム (4)
|
ユーザー |
|
提出日時 | 2020-12-10 01:10:10 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 560 bytes |
コンパイル時間 | 155 ms |
コンパイル使用メモリ | 82,384 KB |
実行使用メモリ | 81,612 KB |
最終ジャッジ日時 | 2024-09-19 07:34:39 |
合計ジャッジ時間 | 3,251 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 14 WA * 21 |
ソースコード
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)