結果

問題 No.5001 排他的論理和でランニング
ユーザー tecchaxntecchaxn
提出日時 2018-03-16 22:48:52
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 785 bytes
コンパイル時間 1,057 ms
実行使用メモリ 7,428 KB
スコア 31,530,895
最終ジャッジ日時 2020-03-12 19:27:43
ジャッジサーバーID
(参考情報)
judge8 /
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 56 ms
5,376 KB
testcase_01 AC 10 ms
5,384 KB
testcase_02 AC 15 ms
5,380 KB
testcase_03 AC 29 ms
5,376 KB
testcase_04 AC 59 ms
5,380 KB
testcase_05 WA -
testcase_06 AC 37 ms
5,380 KB
testcase_07 AC 41 ms
5,376 KB
testcase_08 WA -
testcase_09 AC 2 ms
7,428 KB
testcase_10 WA -
testcase_11 AC 25 ms
5,380 KB
testcase_12 AC 18 ms
5,376 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 21 ms
5,380 KB
testcase_16 AC 10 ms
5,380 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 24 ms
5,376 KB
testcase_20 AC 17 ms
5,376 KB
testcase_21 AC 16 ms
5,380 KB
testcase_22 AC 8 ms
5,376 KB
testcase_23 AC 5 ms
5,376 KB
testcase_24 AC 23 ms
5,380 KB
testcase_25 AC 48 ms
6,148 KB
testcase_26 AC 40 ms
5,376 KB
testcase_27 AC 26 ms
5,380 KB
testcase_28 AC 40 ms
5,376 KB
testcase_29 AC 46 ms
5,380 KB
testcase_30 AC 8 ms
5,376 KB
testcase_31 AC 36 ms
5,380 KB
testcase_32 AC 17 ms
5,380 KB
testcase_33 WA -
testcase_34 AC 58 ms
5,380 KB
testcase_35 AC 38 ms
5,380 KB
testcase_36 AC 54 ms
5,380 KB
testcase_37 AC 41 ms
5,376 KB
testcase_38 AC 16 ms
5,380 KB
testcase_39 WA -
testcase_40 AC 28 ms
5,380 KB
testcase_41 AC 8 ms
5,380 KB
testcase_42 WA -
testcase_43 AC 29 ms
5,380 KB
testcase_44 AC 47 ms
5,380 KB
testcase_45 AC 53 ms
6,148 KB
testcase_46 AC 50 ms
6,148 KB
testcase_47 AC 24 ms
5,376 KB
testcase_48 AC 18 ms
7,424 KB
testcase_49 AC 44 ms
5,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(n);i++)
#define ALL(v) (v).begin(),(v).end()
#define int long long
using namespace std;

//-----------------------------------------------------------------------

signed main()
{
    int N,M; cin>>N>>M;
    vector<int> a(N);
    vector<int> v[30];
    REP(i,N){
        cin>>a[i];
        int x=a[i],cnt=0;
        while(x>0){
            x/=2;
            cnt++;
        }
        v[cnt].push_back(a[i]);
    }
    
    vector<int> ans;
    for(int i=29;i>=0;i--){
        if(v[i].size()>0){
            ans.push_back(v[i][0]);
            break;
        }
    }
    sort(ALL(a));
    REP(i,M-1){
        ans.push_back(a[i]);
    }
    
    REP(i,M){
        if(i) cout<<' ';
        cout<<ans[i];
    }
    cout<<endl;
    
}
0