結果

問題 No.771 しおり
ユーザー 👑 KazunKazun
提出日時 2021-03-04 04:38:27
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,485 ms / 2,000 ms
コード長 581 bytes
コンパイル時間 217 ms
コンパイル使用メモリ 81,816 KB
実行使用メモリ 180,008 KB
最終ジャッジ日時 2023-10-20 06:47:19
合計ジャッジ時間 19,457 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,341 ms
179,920 KB
testcase_01 AC 193 ms
87,408 KB
testcase_02 AC 35 ms
53,448 KB
testcase_03 AC 38 ms
53,448 KB
testcase_04 AC 34 ms
53,448 KB
testcase_05 AC 36 ms
53,448 KB
testcase_06 AC 35 ms
53,448 KB
testcase_07 AC 35 ms
53,448 KB
testcase_08 AC 67 ms
73,136 KB
testcase_09 AC 35 ms
53,448 KB
testcase_10 AC 35 ms
53,448 KB
testcase_11 AC 36 ms
53,448 KB
testcase_12 AC 38 ms
53,448 KB
testcase_13 AC 35 ms
53,448 KB
testcase_14 AC 68 ms
72,620 KB
testcase_15 AC 34 ms
53,448 KB
testcase_16 AC 38 ms
59,464 KB
testcase_17 AC 54 ms
66,360 KB
testcase_18 AC 35 ms
53,448 KB
testcase_19 AC 39 ms
59,464 KB
testcase_20 AC 35 ms
53,448 KB
testcase_21 AC 34 ms
53,448 KB
testcase_22 AC 38 ms
59,464 KB
testcase_23 AC 46 ms
62,260 KB
testcase_24 AC 53 ms
66,340 KB
testcase_25 AC 614 ms
126,772 KB
testcase_26 AC 102 ms
76,776 KB
testcase_27 AC 201 ms
87,572 KB
testcase_28 AC 364 ms
100,184 KB
testcase_29 AC 200 ms
87,464 KB
testcase_30 AC 1,273 ms
179,928 KB
testcase_31 AC 1,485 ms
179,928 KB
testcase_32 AC 96 ms
77,516 KB
testcase_33 AC 1,299 ms
179,928 KB
testcase_34 AC 1,298 ms
179,920 KB
testcase_35 AC 99 ms
77,252 KB
testcase_36 AC 83 ms
76,512 KB
testcase_37 AC 83 ms
76,248 KB
testcase_38 AC 98 ms
77,516 KB
testcase_39 AC 86 ms
76,460 KB
testcase_40 AC 607 ms
126,800 KB
testcase_41 AC 1,380 ms
179,928 KB
testcase_42 AC 1,240 ms
179,928 KB
testcase_43 AC 191 ms
87,552 KB
testcase_44 AC 1,258 ms
179,928 KB
testcase_45 AC 1,223 ms
180,008 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
A=[0]*N
B=[0]*N

for i in range(N):
    A[i],B[i]=map(int,input().split())

Ugly=[[0]*N for _ in range(N)]
for i in range(N):
    for j in range(N):
        if i==j:
            continue
        Ugly[i][j]=(B[i]-A[i])+A[j]

inf=float("inf")
DP=[[inf]*N for _ in range(1<<N)]
for i in range(N):
    DP[1<<i][i]=0

for S in range(1,1<<N):
    E=DP[S]
    for u in range(N):
        if S&(1<<u)==0:
            continue

        for v in range(N):
            if S&(1<<v)==0:
                DP[S|(1<<v)][v]=min(DP[S|(1<<v)][v],max(E[u],Ugly[u][v]))

print(min(DP[-1]))
0