結果
| 問題 |
No.90 品物の並び替え
|
| コンテスト | |
| ユーザー |
maspy
|
| 提出日時 | 2020-01-29 22:46:31 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 1,093 ms / 5,000 ms |
| コード長 | 425 bytes |
| コンパイル時間 | 224 ms |
| コンパイル使用メモリ | 12,416 KB |
| 実行使用メモリ | 113,048 KB |
| 最終ジャッジ日時 | 2024-09-16 02:54:23 |
| 合計ジャッジ時間 | 6,588 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 9 |
ソースコード
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
import numpy as np
import itertools
N,M = map(int,readline().split())
m = map(int,read().split())
ABC = zip(m,m,m)
perms = np.array(list(itertools.permutations(range(N))))
score = np.zeros(len(perms), np.int64)
for a,b,c in ABC:
score[perms[:,a] < perms[:,b]] += c
answer = score.max()
print(answer)
maspy