結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 10 ms
5,380 KB
testcase_02 AC 15 ms
5,376 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 37 ms
5,380 KB
testcase_07 AC 41 ms
5,380 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 19 ms
5,380 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 10 ms
5,380 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 23 ms
5,380 KB
testcase_20 AC 17 ms
5,380 KB
testcase_21 WA -
testcase_22 AC 7 ms
5,376 KB
testcase_23 WA -
testcase_24 AC 22 ms
5,380 KB
testcase_25 AC 48 ms
5,376 KB
testcase_26 AC 41 ms
5,380 KB
testcase_27 AC 27 ms
5,380 KB
testcase_28 WA -
testcase_29 AC 47 ms
5,380 KB
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 AC 37 ms
5,380 KB
testcase_36 WA -
testcase_37 AC 41 ms
5,376 KB
testcase_38 AC 17 ms
5,376 KB
testcase_39 WA -
testcase_40 AC 29 ms
5,376 KB
testcase_41 WA -
testcase_42 WA -
testcase_43 WA -
testcase_44 AC 48 ms
5,380 KB
testcase_45 WA -
testcase_46 AC 51 ms
5,376 KB
testcase_47 WA -
testcase_48 WA -
testcase_49 WA -
権限があれば一括ダウンロードができます

ソースコード

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[20];
    REP(i,N){
        cin>>a[i];
        int x=a[i],cnt=0;
        while(x>0){
            x/=2;
            cnt++;
        }
        v[cnt].push_back(a[i]);
    }
    
    for(int i=19;i>=0;i--){
        if(v[i].size()>0){ 
            cout<<v[i][0]<<' ';
            break;
        }
    }
    sort(ALL(a));
    REP(i,M-1) cout<<a[i]<<' ';
    cout<<endl;
 
}
0