結果

問題 No.771 しおり
ユーザー convexineqconvexineq
提出日時 2021-05-21 01:26:44
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,091 ms / 2,000 ms
コード長 455 bytes
コンパイル時間 452 ms
コンパイル使用メモリ 87,304 KB
実行使用メモリ 134,148 KB
最終ジャッジ日時 2023-09-29 13:07:59
合計ジャッジ時間 16,071 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,008 ms
134,032 KB
testcase_01 AC 165 ms
84,128 KB
testcase_02 AC 62 ms
71,348 KB
testcase_03 AC 58 ms
71,280 KB
testcase_04 AC 58 ms
71,136 KB
testcase_05 AC 57 ms
71,404 KB
testcase_06 AC 58 ms
71,428 KB
testcase_07 AC 60 ms
71,428 KB
testcase_08 AC 81 ms
76,704 KB
testcase_09 AC 60 ms
71,468 KB
testcase_10 AC 59 ms
71,388 KB
testcase_11 AC 60 ms
71,396 KB
testcase_12 AC 60 ms
71,188 KB
testcase_13 AC 61 ms
71,624 KB
testcase_14 AC 80 ms
76,760 KB
testcase_15 AC 60 ms
71,460 KB
testcase_16 AC 61 ms
75,772 KB
testcase_17 AC 72 ms
76,536 KB
testcase_18 AC 61 ms
71,348 KB
testcase_19 AC 66 ms
75,976 KB
testcase_20 AC 57 ms
71,556 KB
testcase_21 AC 58 ms
71,276 KB
testcase_22 AC 63 ms
75,872 KB
testcase_23 AC 68 ms
76,604 KB
testcase_24 AC 74 ms
76,776 KB
testcase_25 AC 461 ms
105,308 KB
testcase_26 AC 88 ms
76,936 KB
testcase_27 AC 165 ms
83,484 KB
testcase_28 AC 312 ms
90,888 KB
testcase_29 AC 177 ms
83,736 KB
testcase_30 AC 1,042 ms
133,980 KB
testcase_31 AC 1,091 ms
134,092 KB
testcase_32 AC 99 ms
78,808 KB
testcase_33 AC 1,072 ms
134,032 KB
testcase_34 AC 1,048 ms
134,024 KB
testcase_35 AC 101 ms
78,712 KB
testcase_36 AC 84 ms
76,972 KB
testcase_37 AC 82 ms
77,064 KB
testcase_38 AC 94 ms
78,852 KB
testcase_39 AC 84 ms
76,992 KB
testcase_40 AC 439 ms
105,232 KB
testcase_41 AC 1,062 ms
133,772 KB
testcase_42 AC 1,063 ms
133,784 KB
testcase_43 AC 164 ms
83,796 KB
testcase_44 AC 1,028 ms
134,116 KB
testcase_45 AC 980 ms
134,148 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
a = [0]*n
b = [0]*n
for i in range(n):
    a[i],b[i] = map(int,input().split())

N = 1<<n
INF = 1<<30
dp = [[INF]*n for _ in range(N)]
for i in range(n):
    dp[1<<i][i] = 0

for mask in range(N):
    for i in range(n):
        if mask>>i&1==0: continue
        v = dp[mask][i]
        for j in range(n):
            if mask>>j&1: continue
            dp[mask|(1<<j)][j] = min(dp[mask|(1<<j)][j], max(v,a[j]+b[i]-a[i]))
print(min(dp[-1]))
0