結果

問題 No.572 妖精の演奏
ユーザー bknbbknb
提出日時 2017-10-07 00:10:43
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 358 bytes
コンパイル時間 74 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-04-28 11:50:00
合計ジャッジ時間 1,451 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 AC 29 ms
10,752 KB
testcase_03 RE -
testcase_04 RE -
testcase_05 WA -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 RE -
testcase_19 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
m = int(input())
matrix = [[0]*m]*m
ml = [0]*m
ind = [0]*m
for i in range(m):
    box = list(map(int,input().split()))
    matrix[i] = box
    ml[i] = max(box)
    ind[i] = max(range(m), key=lambda i: box[i])

a = max(range(m), key=lambda i: ml[i])

s = ml[a]
b = ind[a]

for i in range(n-2):
    c = ml[b]
    s += c
    b = ind[c]
print(s)
0