結果

問題 No.771 しおり
ユーザー lloyzlloyz
提出日時 2023-10-27 00:03:12
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 570 bytes
コンパイル時間 244 ms
コンパイル使用メモリ 81,828 KB
実行使用メモリ 132,008 KB
最終ジャッジ日時 2023-10-27 00:03:39
合計ジャッジ時間 26,702 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,933 ms
131,972 KB
testcase_01 AC 229 ms
82,284 KB
testcase_02 AC 35 ms
53,496 KB
testcase_03 AC 35 ms
53,496 KB
testcase_04 AC 35 ms
53,496 KB
testcase_05 AC 36 ms
53,496 KB
testcase_06 AC 35 ms
53,496 KB
testcase_07 AC 36 ms
53,496 KB
testcase_08 AC 66 ms
70,596 KB
testcase_09 AC 35 ms
53,496 KB
testcase_10 AC 35 ms
53,496 KB
testcase_11 AC 35 ms
53,496 KB
testcase_12 AC 36 ms
53,496 KB
testcase_13 AC 36 ms
53,496 KB
testcase_14 AC 69 ms
72,652 KB
testcase_15 AC 36 ms
53,496 KB
testcase_16 AC 48 ms
59,652 KB
testcase_17 AC 60 ms
68,496 KB
testcase_18 AC 36 ms
53,496 KB
testcase_19 AC 39 ms
59,652 KB
testcase_20 AC 35 ms
53,496 KB
testcase_21 AC 35 ms
53,496 KB
testcase_22 AC 41 ms
59,652 KB
testcase_23 AC 46 ms
62,236 KB
testcase_24 AC 60 ms
68,496 KB
testcase_25 AC 885 ms
103,200 KB
testcase_26 AC 91 ms
76,520 KB
testcase_27 AC 235 ms
82,260 KB
testcase_28 AC 469 ms
89,324 KB
testcase_29 AC 267 ms
82,164 KB
testcase_30 AC 1,967 ms
131,972 KB
testcase_31 TLE -
testcase_32 AC 106 ms
77,484 KB
testcase_33 TLE -
testcase_34 TLE -
testcase_35 AC 107 ms
77,456 KB
testcase_36 AC 75 ms
74,388 KB
testcase_37 AC 79 ms
76,256 KB
testcase_38 AC 104 ms
77,460 KB
testcase_39 AC 79 ms
76,256 KB
testcase_40 AC 807 ms
103,432 KB
testcase_41 TLE -
testcase_42 AC 1,954 ms
131,972 KB
testcase_43 AC 265 ms
82,284 KB
testcase_44 AC 1,941 ms
131,980 KB
testcase_45 AC 1,857 ms
131,944 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
A = [list(map(int, input().split())) for _ in range(n)]

INF = 10**18
DP = [[INF for _ in range(n)] for _ in range(1 << n)]
for i in range(n):
    DP[1 << i][i] = 0
for bit in range(1, 1 << n):
    seen = set()
    for i in range(n):
        if (bit >> i) & 1:
            seen.add(i)
    for i in range(n):
        if i in seen:
            for j in range(n):
                if j not in seen:
                    nbit = bit | (1 << j)
                    DP[nbit][j] = min(DP[nbit][j], max(DP[bit][i], A[i][1] - A[i][0] + A[j][0]))
print(min(DP[-1]))
0