結果

問題 No.771 しおり
ユーザー AEnAEn
提出日時 2022-06-21 00:33:14
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,699 ms / 2,000 ms
コード長 499 bytes
コンパイル時間 311 ms
コンパイル使用メモリ 87,088 KB
実行使用メモリ 134,400 KB
最終ジャッジ日時 2023-09-29 13:12:51
合計ジャッジ時間 23,541 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,699 ms
134,272 KB
testcase_01 AC 226 ms
84,120 KB
testcase_02 AC 74 ms
71,532 KB
testcase_03 AC 75 ms
71,340 KB
testcase_04 AC 75 ms
71,396 KB
testcase_05 AC 75 ms
71,460 KB
testcase_06 AC 72 ms
71,416 KB
testcase_07 AC 74 ms
71,252 KB
testcase_08 AC 108 ms
77,688 KB
testcase_09 AC 72 ms
71,292 KB
testcase_10 AC 75 ms
71,340 KB
testcase_11 AC 73 ms
71,160 KB
testcase_12 AC 75 ms
71,588 KB
testcase_13 AC 75 ms
71,404 KB
testcase_14 AC 110 ms
77,236 KB
testcase_15 AC 73 ms
71,332 KB
testcase_16 AC 80 ms
75,996 KB
testcase_17 AC 95 ms
76,620 KB
testcase_18 AC 73 ms
71,332 KB
testcase_19 AC 79 ms
76,088 KB
testcase_20 AC 74 ms
71,236 KB
testcase_21 AC 73 ms
71,404 KB
testcase_22 AC 76 ms
76,228 KB
testcase_23 AC 83 ms
76,276 KB
testcase_24 AC 95 ms
76,764 KB
testcase_25 AC 753 ms
105,588 KB
testcase_26 AC 125 ms
78,364 KB
testcase_27 AC 229 ms
84,128 KB
testcase_28 AC 407 ms
90,900 KB
testcase_29 AC 238 ms
83,992 KB
testcase_30 AC 1,587 ms
134,164 KB
testcase_31 AC 1,633 ms
134,228 KB
testcase_32 AC 131 ms
79,164 KB
testcase_33 AC 1,625 ms
134,244 KB
testcase_34 AC 1,561 ms
134,400 KB
testcase_35 AC 133 ms
78,968 KB
testcase_36 AC 116 ms
77,684 KB
testcase_37 AC 111 ms
77,984 KB
testcase_38 AC 130 ms
79,272 KB
testcase_39 AC 115 ms
78,080 KB
testcase_40 AC 648 ms
105,348 KB
testcase_41 AC 1,659 ms
134,232 KB
testcase_42 AC 1,535 ms
134,184 KB
testcase_43 AC 228 ms
84,196 KB
testcase_44 AC 1,578 ms
134,316 KB
testcase_45 AC 1,559 ms
133,980 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
c=[]
for i in range(N):
    l,r=map(int,input().split())
    c.append([l,r-l])
dp=[[0]*N for _ in range(1<<N)]
for i in range(1,1<<N):
    for j in range(N):
        if not i&(1<<j):continue
        for k in range(N):
            kk=1<<k
            cc=c[j][1]+c[k][0]
            if j==k or i&(1<<k):continue
            if dp[i^kk][k]==0:
                dp[i^kk][k]=max(dp[i][j],cc)
            else:
                dp[i^kk][k]=min(dp[i^kk][k],max(dp[i][j],cc))
print(min(dp[-1]))
0