結果

問題 No.5001 排他的論理和でランニング
ユーザー maimai
提出日時 2018-05-24 23:47:16
言語 cLay
(20240104-1)
結果
AC  
実行時間 398 ms / 1,500 ms
コード長 625 bytes
コンパイル時間 1,670 ms
実行使用メモリ 7,024 KB
スコア 52,428,750
最終ジャッジ日時 2021-09-25 19:04:17
合計ジャッジ時間 24,232 ms
ジャッジサーバーID
(参考情報)
judge13 / judge10
純コード判定しない問題か言語
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 390 ms
5,040 KB
testcase_01 AC 379 ms
7,020 KB
testcase_02 AC 380 ms
7,020 KB
testcase_03 AC 379 ms
4,976 KB
testcase_04 AC 386 ms
5,272 KB
testcase_05 AC 382 ms
4,976 KB
testcase_06 AC 380 ms
4,976 KB
testcase_07 AC 384 ms
4,976 KB
testcase_08 AC 387 ms
5,236 KB
testcase_09 AC 380 ms
4,976 KB
testcase_10 AC 378 ms
4,980 KB
testcase_11 AC 398 ms
7,024 KB
testcase_12 AC 379 ms
7,020 KB
testcase_13 AC 382 ms
4,976 KB
testcase_14 AC 380 ms
4,976 KB
testcase_15 AC 378 ms
4,976 KB
testcase_16 AC 380 ms
4,980 KB
testcase_17 AC 378 ms
4,972 KB
testcase_18 AC 379 ms
7,020 KB
testcase_19 AC 379 ms
4,972 KB
testcase_20 AC 383 ms
4,976 KB
testcase_21 AC 381 ms
7,020 KB
testcase_22 AC 382 ms
4,976 KB
testcase_23 AC 379 ms
7,024 KB
testcase_24 AC 380 ms
4,972 KB
testcase_25 AC 385 ms
4,972 KB
testcase_26 AC 386 ms
4,976 KB
testcase_27 AC 382 ms
4,976 KB
testcase_28 AC 383 ms
7,020 KB
testcase_29 AC 388 ms
4,976 KB
testcase_30 AC 382 ms
7,020 KB
testcase_31 AC 394 ms
7,024 KB
testcase_32 AC 390 ms
7,020 KB
testcase_33 AC 389 ms
5,192 KB
testcase_34 AC 392 ms
5,204 KB
testcase_35 AC 385 ms
7,020 KB
testcase_36 AC 389 ms
4,976 KB
testcase_37 AC 385 ms
4,980 KB
testcase_38 AC 387 ms
4,976 KB
testcase_39 AC 390 ms
7,020 KB
testcase_40 AC 382 ms
4,972 KB
testcase_41 AC 383 ms
4,976 KB
testcase_42 AC 384 ms
4,972 KB
testcase_43 AC 386 ms
4,972 KB
testcase_44 AC 382 ms
4,976 KB
testcase_45 AC 383 ms
4,976 KB
testcase_46 AC 389 ms
4,972 KB
testcase_47 AC 378 ms
4,980 KB
testcase_48 AC 381 ms
4,972 KB
testcase_49 AC 382 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(_,8000100){
        int j = rand(0,M-1);
        int k = rand(0,N-M-1);
        x ^= A[used[j]];
        x ^= A[unused[k]];
        swap(used[j],unused[k]);
        if (x > best){
            best = x;
            if (_ > N/10){
                ans = used;
            }
        }
    }
    REP(i,M)
        wtSp(A[ans[i]]);
}
0