結果
| 問題 | No.357 品物の並び替え (Middle) |
| コンテスト | |
| ユーザー |
Snark86
|
| 提出日時 | 2016-04-01 23:56:18 |
| 言語 | PyPy2 (7.3.15) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 322 bytes |
| 記録 | |
| コンパイル時間 | 431 ms |
| コンパイル使用メモリ | 76,976 KB |
| 最終ジャッジ日時 | 2025-12-03 20:04:36 |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 8 TLE * 1 -- * 9 |
ソースコード
import itertools import sys lines = sys.stdin.readlines() n = map(int,lines[0].split()) sl = [map(int,lines[i+1].split()) for i in range(n[1])] best = 0 for i in itertools.permutations(range(n[0])): score = 0 for s in sl: if i.index(s[0]) > i.index(s[1]): score += s[2] if score > best: best = score print best
Snark86