結果
| 問題 | No.519 アイドルユニット | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2017-06-10 14:49:34 | 
| 言語 | D (dmd 2.109.1) | 
| 結果 | 
                                TLE
                                 
                             | 
| 実行時間 | - | 
| コード長 | 732 bytes | 
| コンパイル時間 | 841 ms | 
| コンパイル使用メモリ | 118,328 KB | 
| 実行使用メモリ | 69,572 KB | 
| 最終ジャッジ日時 | 2024-06-12 19:55:59 | 
| 合計ジャッジ時間 | 11,812 ms | 
| ジャッジサーバーID (参考情報) | judge5 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 28 TLE * 6 | 
ソースコード
import std.stdio, std.array, std.string, std.conv, std.algorithm;
import std.typecons, std.range, std.random, std.math, std.container;
import std.numeric, std.bigint, core.bitop, core.stdc.stdio;
immutable int INF = 1 << 28;
void main() {
    auto N = readln.chomp.to!int;
    auto F = N.iota.map!(_ => readln.split.map!(to!int).array).array;
    auto dp = new int[](1 << N);
    foreach (mask; 0..(1 << N)) {
        int i = bsf(~mask);
        foreach (j; i+1..N) {
            if (!(mask & (1 << j))) {
                dp[mask | (1 << i) | (1 << j)] = max(dp[mask | (1 << i) | (1 << j)],
                                                     dp[mask] + F[i][j]);
            }
        }
    }
    dp[(1 << N) - 1].writeln;
}
            
            
            
        