結果
| 問題 | No.90 品物の並び替え |
| コンテスト | |
| ユーザー |
MtBotO
|
| 提出日時 | 2017-09-18 01:09:48 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 592 bytes |
| 記録 | |
| コンパイル時間 | 462 ms |
| コンパイル使用メモリ | 20,824 KB |
| 実行使用メモリ | 63,192 KB |
| 最終ジャッジ日時 | 2026-05-08 09:10:55 |
| 合計ジャッジ時間 | 9,026 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 8 TLE * 1 |
ソースコード
import itertools
def main():
N, M = map(int,input().split())
max_score = 0
score = []
for i in range(M):
score.append(list(map(int,input().split())))
data = list(itertools.permutations(range(N)))
for tg in data:
rt_score = check(list(tg), score)
if max_score < rt_score:
max_score = rt_score
print(max_score)
def check(tg ,score ):
rt_score = 0
for sc in score:
ind1 = tg.index(sc[0])
if sc[1] in tg[ind1:]:
rt_score += sc[2]
return rt_score
if __name__ == "__main__":
main()
MtBotO