結果

問題 No.698 ペアでチームを作ろう
ユーザー maimai
提出日時 2018-06-09 20:23:03
言語 cLay
(20240104-1)
結果
AC  
実行時間 3 ms / 1,000 ms
コード長 388 bytes
コンパイル時間 1,877 ms
コンパイル使用メモリ 173,800 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-27 04:56:54
合計ジャッジ時間 2,553 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,816 KB
testcase_01 AC 2 ms
6,940 KB
testcase_02 AC 1 ms
6,940 KB
testcase_03 AC 1 ms
6,944 KB
testcase_04 AC 2 ms
6,940 KB
testcase_05 AC 2 ms
6,944 KB
testcase_06 AC 2 ms
6,948 KB
testcase_07 AC 3 ms
6,940 KB
testcase_08 AC 3 ms
6,944 KB
testcase_09 AC 3 ms
6,944 KB
testcase_10 AC 2 ms
6,940 KB
testcase_11 AC 2 ms
6,940 KB
testcase_12 AC 2 ms
6,940 KB
testcase_13 AC 2 ms
6,944 KB
testcase_14 AC 2 ms
6,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

int N, A[15];
int dp[1<<15];
{
    rd(N,A(N));
    REP(b, 1<<(N-1)){
        if (__builtin_popcountll(b)&1) continue;
        REP(i, N){
            if (b&(1<<i)) continue;
            REP(j, N){
                if (b&(1<<j)) continue;
                int b2 = b|(1<<i)|(1<<j);
                dp[b2] = max(dp[b2], dp[b]+(A[i]^A[j]));
            }
        }
    }
    wt(dp[(1<<N)-1]);
}
0