結果

問題 No.5001 排他的論理和でランニング
ユーザー maimai
提出日時 2018-05-24 23:32:43
言語 cLay
(20240104-1)
結果
AC  
実行時間 104 ms / 1,500 ms
コード長 593 bytes
コンパイル時間 1,484 ms
実行使用メモリ 7,028 KB
スコア 26,767,704
最終ジャッジ日時 2021-09-25 19:03:45
合計ジャッジ時間 9,623 ms
ジャッジサーバーID
(参考情報)
judge10 / judge12
純コード判定しない問題か言語
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 104 ms
5,048 KB
testcase_01 AC 99 ms
7,020 KB
testcase_02 AC 100 ms
4,976 KB
testcase_03 AC 98 ms
7,024 KB
testcase_04 AC 99 ms
5,252 KB
testcase_05 AC 98 ms
4,972 KB
testcase_06 AC 97 ms
4,972 KB
testcase_07 AC 97 ms
4,972 KB
testcase_08 AC 99 ms
5,104 KB
testcase_09 AC 96 ms
7,024 KB
testcase_10 AC 97 ms
7,024 KB
testcase_11 AC 99 ms
4,972 KB
testcase_12 AC 98 ms
4,972 KB
testcase_13 AC 104 ms
4,980 KB
testcase_14 AC 98 ms
4,976 KB
testcase_15 AC 96 ms
4,976 KB
testcase_16 AC 95 ms
7,020 KB
testcase_17 AC 97 ms
4,972 KB
testcase_18 AC 99 ms
7,020 KB
testcase_19 AC 97 ms
4,976 KB
testcase_20 AC 100 ms
4,980 KB
testcase_21 AC 97 ms
7,024 KB
testcase_22 AC 95 ms
4,976 KB
testcase_23 AC 95 ms
4,976 KB
testcase_24 AC 96 ms
4,976 KB
testcase_25 AC 97 ms
4,976 KB
testcase_26 AC 98 ms
4,976 KB
testcase_27 AC 97 ms
4,972 KB
testcase_28 AC 98 ms
7,020 KB
testcase_29 AC 98 ms
7,024 KB
testcase_30 AC 95 ms
4,972 KB
testcase_31 AC 100 ms
4,976 KB
testcase_32 AC 97 ms
4,972 KB
testcase_33 AC 100 ms
5,340 KB
testcase_34 AC 100 ms
7,024 KB
testcase_35 AC 98 ms
4,976 KB
testcase_36 AC 100 ms
4,972 KB
testcase_37 AC 98 ms
4,976 KB
testcase_38 AC 96 ms
4,976 KB
testcase_39 AC 98 ms
7,020 KB
testcase_40 AC 99 ms
4,976 KB
testcase_41 AC 96 ms
4,972 KB
testcase_42 AC 99 ms
4,972 KB
testcase_43 AC 97 ms
7,028 KB
testcase_44 AC 98 ms
4,972 KB
testcase_45 AC 99 ms
4,972 KB
testcase_46 AC 99 ms
7,020 KB
testcase_47 AC 97 ms
7,020 KB
testcase_48 AC 97 ms
4,972 KB
testcase_49 AC 99 ms
4,976 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

mt19937_64 randdev(8901016);
inline int rand(int l, int h) { return uniform_int_distribution<int>(l, h)(randdev); }


int N,M,A[100010];
int x,best;
vector<int> used,unused,ans;

{
    rd(N,M,A(N));
    REP(i,M) x ^= A[N-i-1], used.push_back(N-i-1);
    REP(i,N-M) unused.push_back(i);
    
    REP(_,2000100){
        int j = rand(0,M-1);
        int k = rand(0,N-M-1);
        x ^= A[used[j]];
        x ^= A[unused[k]];
        if (x > best){
            best = x;
            if (_ > N/10){
                ans = used;
            }
        }
    }
    REP(i,M)
        wtSp(A[ans[i]]);
}
0