結果

問題 No.2210 equence Squence Seuence
ユーザー srjywrdnprktsrjywrdnprkt
提出日時 2023-02-11 03:27:53
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 788 bytes
コンパイル時間 1,085 ms
コンパイル使用メモリ 107,852 KB
実行使用メモリ 4,508 KB
最終ジャッジ日時 2023-09-22 03:17:02
合計ジャッジ時間 3,635 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 1 ms
4,384 KB
testcase_02 AC 1 ms
4,384 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 24 ms
4,380 KB
testcase_07 AC 61 ms
4,384 KB
testcase_08 WA -
testcase_09 AC 1 ms
4,380 KB
testcase_10 AC 1 ms
4,384 KB
testcase_11 AC 2 ms
4,384 KB
testcase_12 AC 2 ms
4,384 KB
testcase_13 AC 74 ms
4,380 KB
testcase_14 AC 76 ms
4,380 KB
testcase_15 AC 75 ms
4,380 KB
testcase_16 AC 75 ms
4,384 KB
testcase_17 WA -
testcase_18 AC 1 ms
4,380 KB
testcase_19 AC 1 ms
4,384 KB
testcase_20 WA -
testcase_21 AC 1 ms
4,384 KB
testcase_22 WA -
testcase_23 AC 58 ms
4,380 KB
testcase_24 AC 44 ms
4,384 KB
testcase_25 AC 51 ms
4,380 KB
testcase_26 AC 69 ms
4,384 KB
testcase_27 AC 20 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <cmath>
#include <map>
#include <set>
#include <iomanip>
#include <queue>
#include <algorithm>
#include <numeric>
#include <deque>
#include <complex>
#include <cassert>

using namespace std;

int N, K, ans=-1;
vector<int> A;

int main(){
    cin >> N >> K;
    A.resize(N);
    for (int i=0; i<N; i++) cin >> A[i];

    for (int i=0; i<N; i++){
        if (A[i+1] <= A[i]){
            if (K == 1){
                ans = i;
                break;
            }
            else K--;
        }
        else{
            if (K == N-i){
                ans = i;
                break;
            }
        }
    }
    if (ans == -1) ans = N-1;

    for (int i=0; i<N; i++) if (ans != i) cout << A[i] << " ";
    cout << endl;

    return 0;
}
0