結果

問題 No.1313 N言っちゃダメゲーム (4)
ユーザー t98slidert98slider
提出日時 2023-05-07 20:58:01
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 625 bytes
コンパイル時間 3,938 ms
コンパイル使用メモリ 227,876 KB
実行使用メモリ 6,444 KB
最終ジャッジ日時 2023-08-16 08:06:59
合計ジャッジ時間 5,817 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 2 ms
4,376 KB
testcase_06 WA -
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 18 ms
6,320 KB
testcase_17 AC 20 ms
6,240 KB
testcase_18 AC 16 ms
4,960 KB
testcase_19 AC 13 ms
4,944 KB
testcase_20 AC 4 ms
4,376 KB
testcase_21 AC 14 ms
4,752 KB
testcase_22 AC 10 ms
4,376 KB
testcase_23 WA -
testcase_24 AC 3 ms
4,380 KB
testcase_25 AC 12 ms
4,936 KB
testcase_26 AC 2 ms
4,376 KB
testcase_27 AC 9 ms
4,708 KB
testcase_28 WA -
testcase_29 AC 19 ms
6,236 KB
testcase_30 WA -
testcase_31 AC 18 ms
6,240 KB
testcase_32 AC 14 ms
6,232 KB
testcase_33 AC 6 ms
6,240 KB
testcase_34 AC 6 ms
6,156 KB
testcase_35 AC 6 ms
6,200 KB
testcase_36 AC 5 ms
6,160 KB
testcase_37 AC 4 ms
6,444 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;

int op(int lhs, int rhs){ return max(lhs, rhs); }
int e(){ return 0; }

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n, k;
    string s;
    cin >> n >> k >> s;
    s = 'o' + s;
    atcoder::segtree<int, op, e> seg(vector<int>(n + 5, 1 << 30));
    seg.set(0, n - 1);
    for(int i = s.size() - 1, mexv; i >= 0; i--){
        if(s[i] == 'x') continue;
        seg.set(mexv = seg.max_right(0, [&](int v){return v <= i + k;}), i);
        if(mexv == 0 && i <= k){
            cout << i << '\n';
            exit(0);
        }
    }
}
0