結果

問題 No.19 ステージの選択
ユーザー szkhtsszkhts
提出日時 2022-11-06 07:56:38
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
MLE  
実行時間 -
コード長 466 bytes
コンパイル時間 307 ms
コンパイル使用メモリ 10,756 KB
実行使用メモリ 816,860 KB
最終ジャッジ日時 2023-09-27 05:08:52
合計ジャッジ時間 3,663 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
8,088 KB
testcase_01 AC 16 ms
8,248 KB
testcase_02 AC 16 ms
8,216 KB
testcase_03 MLE -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import itertools

N = int(input())
LS = []
for i in range(N):
    LS.append(list(map(int, input().split())))

turn = [x for x in range(N)]
turn_list = list(itertools.permutations(turn, N))

ans = float('inf')
for t in turn_list:
    sum = 0
    area = [False] * N
    for t_i in t:
        if area[LS[t_i][1] - 1]:
            sum += LS[t_i][0] / 2
        else:
            sum += LS[t_i][0]
        area[t_i] = True

    if ans > sum:
        ans = sum

print(ans)
0