結果

問題 No.2210 equence Squence Seuence
ユーザー tsugutsugu
提出日時 2023-03-05 13:06:31
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 588 bytes
コンパイル時間 1,602 ms
コンパイル使用メモリ 173,112 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-09-18 01:33:47
合計ジャッジ時間 3,553 ms
ジャッジサーバーID
(参考情報)
judge6 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 18 WA * 7
権限があれば一括ダウンロードができます

ソースコード

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