結果
問題 | No.1313 N言っちゃダメゲーム (4) |
ユーザー |
|
提出日時 | 2020-12-10 00:42:36 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 48 ms / 2,000 ms |
コード長 | 411 bytes |
コンパイル時間 | 160 ms |
コンパイル使用メモリ | 82,216 KB |
実行使用メモリ | 63,572 KB |
最終ジャッジ日時 | 2024-09-19 07:09:41 |
合計ジャッジ時間 | 2,766 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 35 |
ソースコード
import sysinput = sys.stdin.readlineN, K = map(int, input().split())S = input()[:-1]dp = [False]*Nif S[-1]=='o':lose = N-1else:lose = 10**18for i in range(N-2, -1, -1):if lose<=i+K:dp[i] = Trueelse:if S[i-1]=='o':lose = iif not dp[0]:print(0)else:for i in range(1, K+1):if S[i-1]=='o' and not dp[i]:print(i)