結果

問題 No.710 チーム戦
ユーザー convexineqconvexineq
提出日時 2021-03-18 17:00:45
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 583 ms / 3,000 ms
コード長 303 bytes
コンパイル時間 721 ms
コンパイル使用メモリ 81,920 KB
実行使用メモリ 243,604 KB
最終ジャッジ日時 2024-04-28 07:01:20
合計ジャッジ時間 3,360 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
51,712 KB
testcase_01 AC 40 ms
51,712 KB
testcase_02 AC 65 ms
73,216 KB
testcase_03 AC 61 ms
68,608 KB
testcase_04 AC 67 ms
73,856 KB
testcase_05 AC 66 ms
72,320 KB
testcase_06 AC 63 ms
71,552 KB
testcase_07 AC 68 ms
71,168 KB
testcase_08 AC 67 ms
72,832 KB
testcase_09 AC 74 ms
75,520 KB
testcase_10 AC 64 ms
71,296 KB
testcase_11 AC 68 ms
73,344 KB
testcase_12 AC 67 ms
71,552 KB
testcase_13 AC 67 ms
72,064 KB
testcase_14 AC 66 ms
71,808 KB
testcase_15 AC 66 ms
71,680 KB
testcase_16 AC 68 ms
73,216 KB
testcase_17 AC 66 ms
72,832 KB
testcase_18 AC 66 ms
73,344 KB
testcase_19 AC 67 ms
73,344 KB
testcase_20 AC 68 ms
70,784 KB
testcase_21 AC 66 ms
72,448 KB
testcase_22 AC 46 ms
59,392 KB
testcase_23 AC 51 ms
59,520 KB
testcase_24 AC 583 ms
243,604 KB
testcase_25 AC 39 ms
51,968 KB
testcase_26 AC 39 ms
51,712 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
M = 1<<30
dp = [0]
for _ in range(n):
    a,b = map(int,input().split())
    bmax = M
    ndp = []
    for x in dp:
        if x%M >= bmax: continue
        bmax = x%M
        ndp.append(x+a*M)
        ndp.append(x+b)
    dp = ndp
    dp.sort()

print(min(max(divmod(x,M)) for x in dp))
0