結果

問題 No.2210 equence Squence Seuence
ユーザー Manuel1024Manuel1024
提出日時 2023-02-10 21:48:27
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 743 bytes
コンパイル時間 739 ms
コンパイル使用メモリ 77,776 KB
実行使用メモリ 8,880 KB
最終ジャッジ日時 2023-09-21 22:56:59
合計ジャッジ時間 6,783 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
8,760 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 20 ms
4,376 KB
testcase_04 AC 22 ms
4,376 KB
testcase_05 AC 34 ms
4,380 KB
testcase_06 AC 29 ms
4,380 KB
testcase_07 AC 74 ms
5,276 KB
testcase_08 AC 2 ms
4,376 KB
testcase_09 AC 1 ms
4,376 KB
testcase_10 AC 1 ms
4,376 KB
testcase_11 AC 1 ms
4,380 KB
testcase_12 AC 2 ms
4,380 KB
testcase_13 AC 96 ms
5,720 KB
testcase_14 AC 94 ms
5,624 KB
testcase_15 AC 92 ms
5,628 KB
testcase_16 AC 91 ms
5,880 KB
testcase_17 AC 93 ms
5,552 KB
testcase_18 AC 2 ms
4,376 KB
testcase_19 AC 2 ms
4,376 KB
testcase_20 AC 2 ms
4,380 KB
testcase_21 AC 1 ms
4,380 KB
testcase_22 AC 2 ms
4,380 KB
testcase_23 TLE -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: ラムダ関数内:
main.cpp:24:5: 警告: 制御が非 void 関数の終りに到達しました [-Wreturn-type]
   24 |     });
      |     ^

ソースコード

diff #

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int main(){
    int n, k; cin >> n >> k;
    vector<int> a(n);
    for(auto &it: a) cin >> it;

    vector<int> v(n);
    for(int i = 0; i < n; i++) v[i] = i;
    sort(v.begin(), v.end(), [&](int x, int y){
        if(x < y){
            y = x;
            x = x+1;
        }else{
            x = y;
            y = y+1;
        }
        for(; max(x, y) < n; x++, y++){
            if(a[x] != a[y]) return a[x] < a[y];
        }
    });
    vector<int> ans;
    for(int i = 0; i < n; i++){
        if(v[k-1] == i) continue;
        ans.emplace_back(a[i]);
    }
    for(int i = 0; i < ans.size(); i++) cout << ans[i] << " \n"[i == ans.size()-1];
    return 0;
}
0