結果

問題 No.1313 N言っちゃダメゲーム (4)
ユーザー penguinmanpenguinman
提出日時 2020-12-10 00:22:55
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 230 bytes
コンパイル時間 2,165 ms
コンパイル使用メモリ 202,256 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-19 10:40:53
合計ジャッジ時間 3,415 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 2 ms
4,348 KB
testcase_05 WA -
testcase_06 AC 2 ms
4,348 KB
testcase_07 AC 2 ms
4,348 KB
testcase_08 AC 1 ms
4,348 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 2 ms
4,348 KB
testcase_13 AC 6 ms
4,348 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 AC 2 ms
4,348 KB
testcase_25 AC 5 ms
4,348 KB
testcase_26 AC 2 ms
4,348 KB
testcase_27 AC 4 ms
4,348 KB
testcase_28 WA -
testcase_29 AC 7 ms
4,348 KB
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 AC 7 ms
4,348 KB
testcase_34 AC 6 ms
4,348 KB
testcase_35 AC 7 ms
4,348 KB
testcase_36 AC 6 ms
4,348 KB
testcase_37 AC 6 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
int main(){
    int N,K; cin>>N>>K;
    string S; cin>>S;
    int last=N;
    S="o"+S;
    for(int i=N-1;i>=0;i--){
        if(last-i>K&&S[i]=='o') last=i;
    }
    cout<<last<<endl;
}
0