結果
| 問題 | No.1313 N言っちゃダメゲーム (4) |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-12-10 01:28:47 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 38 ms / 2,000 ms |
| コード長 | 609 bytes |
| 記録 | |
| コンパイル時間 | 192 ms |
| コンパイル使用メモリ | 85,504 KB |
| 実行使用メモリ | 64,256 KB |
| 最終ジャッジ日時 | 2026-04-07 16:31:27 |
| 合計ジャッジ時間 | 2,580 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 35 |
ソースコード
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)