結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,969 ms
132,040 KB
testcase_01 AC 229 ms
82,240 KB
testcase_02 AC 36 ms
53,560 KB
testcase_03 AC 35 ms
53,560 KB
testcase_04 AC 35 ms
53,560 KB
testcase_05 AC 36 ms
53,560 KB
testcase_06 AC 35 ms
53,560 KB
testcase_07 AC 36 ms
53,560 KB
testcase_08 AC 67 ms
70,660 KB
testcase_09 AC 35 ms
53,560 KB
testcase_10 AC 36 ms
53,560 KB
testcase_11 AC 35 ms
53,560 KB
testcase_12 AC 36 ms
53,560 KB
testcase_13 AC 35 ms
53,560 KB
testcase_14 AC 71 ms
72,716 KB
testcase_15 AC 35 ms
53,560 KB
testcase_16 AC 41 ms
59,716 KB
testcase_17 AC 62 ms
68,560 KB
testcase_18 AC 37 ms
53,560 KB
testcase_19 AC 41 ms
59,716 KB
testcase_20 AC 36 ms
53,560 KB
testcase_21 AC 36 ms
53,560 KB
testcase_22 AC 40 ms
59,716 KB
testcase_23 AC 47 ms
62,300 KB
testcase_24 AC 61 ms
68,560 KB
testcase_25 AC 899 ms
103,264 KB
testcase_26 AC 91 ms
76,584 KB
testcase_27 AC 234 ms
82,240 KB
testcase_28 AC 475 ms
89,164 KB
testcase_29 AC 241 ms
82,224 KB
testcase_30 AC 1,976 ms
132,032 KB
testcase_31 TLE -
testcase_32 AC 106 ms
77,556 KB
testcase_33 TLE -
testcase_34 TLE -
testcase_35 AC 107 ms
77,536 KB
testcase_36 AC 75 ms
74,432 KB
testcase_37 AC 81 ms
76,320 KB
testcase_38 AC 108 ms
77,516 KB
testcase_39 AC 83 ms
76,320 KB
testcase_40 AC 808 ms
103,500 KB
testcase_41 TLE -
testcase_42 AC 1,956 ms
132,032 KB
testcase_43 AC 238 ms
82,236 KB
testcase_44 AC 1,939 ms
132,032 KB
testcase_45 AC 1,846 ms
132,000 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

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