結果

問題 No.1313 N言っちゃダメゲーム (4)
ユーザー kk
提出日時 2021-02-04 19:26:33
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 608 bytes
コンパイル時間 2,189 ms
コンパイル使用メモリ 203,196 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-13 15:55:25
合計ジャッジ時間 4,031 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 2 ms
4,376 KB
testcase_09 AC 1 ms
4,380 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 2 ms
4,380 KB
testcase_13 AC 4 ms
4,380 KB
testcase_14 WA -
testcase_15 AC 3 ms
4,380 KB
testcase_16 AC 3 ms
4,380 KB
testcase_17 AC 3 ms
4,376 KB
testcase_18 AC 3 ms
4,376 KB
testcase_19 AC 3 ms
4,376 KB
testcase_20 AC 2 ms
4,376 KB
testcase_21 AC 2 ms
4,380 KB
testcase_22 AC 2 ms
4,380 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 AC 4 ms
4,376 KB
testcase_36 AC 3 ms
4,380 KB
testcase_37 AC 3 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

#define REP(i,n) for(int i=0; i<(int)(n); i++)

int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);

  int n, k;
  cin >> n >> k;

  string s;
  cin >> s;

  vector<bool> win(n);
  int lose = n-1;
  for (int i = n-2; i >= 0; i--) {
    if (s[i] == 'o') {
      if (lose <= i + k)
        win[i] = true;
    }
    if (!win[i])
      lose = i;
  }

  vector<int> ret;
  for (int i = 1; i <= k; i++)
    if (!win[i])
      ret.push_back(i);

  if (!win[0])
    cout << 0 << endl;
  else {
    for (int r: ret)
      cout << r << endl;
  }
  
  return 0;
}
0