結果

問題 No.2210 equence Squence Seuence
ユーザー tsugutsugutsugutsugu
提出日時 2023-03-05 13:06:31
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 588 bytes
コンパイル時間 1,682 ms
コンパイル使用メモリ 172,952 KB
実行使用メモリ 4,860 KB
最終ジャッジ日時 2023-10-18 04:52:47
合計ジャッジ時間 3,753 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 2 ms
4,348 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 12 ms
4,348 KB
testcase_07 AC 29 ms
4,476 KB
testcase_08 WA -
testcase_09 AC 2 ms
4,348 KB
testcase_10 AC 2 ms
4,348 KB
testcase_11 AC 2 ms
4,348 KB
testcase_12 AC 2 ms
4,348 KB
testcase_13 AC 37 ms
4,740 KB
testcase_14 AC 36 ms
4,740 KB
testcase_15 AC 36 ms
4,740 KB
testcase_16 AC 37 ms
4,740 KB
testcase_17 WA -
testcase_18 AC 2 ms
4,348 KB
testcase_19 AC 2 ms
4,348 KB
testcase_20 WA -
testcase_21 AC 2 ms
4,348 KB
testcase_22 WA -
testcase_23 AC 26 ms
4,476 KB
testcase_24 AC 20 ms
4,348 KB
testcase_25 AC 24 ms
4,348 KB
testcase_26 AC 32 ms
4,740 KB
testcase_27 AC 10 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int n, k;
    cin >> n >> k;
    vector<int> a(n);
    for (int i = 0; i < n; i++) {
        cin >> a[i];
    }
    k--;
    deque<int> Q;
    Q.push_back(n - 1);
    for (int i = n - 2; i >= 0; i--) {
        if (a[i] < a[i + 1]) {
            Q.push_back(i);
        } else {
            Q.push_front(i);
        }
    }
    for (int i = 0; i < n; i++) {
        if (i == Q[k]) {
            continue;
        }
        cout << a[i] << ' ';
    }
    cout << endl;
}
0