結果
| 問題 | No.90 品物の並び替え |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-01-19 07:13:24 |
| 言語 | Nim (2.2.12 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 46 ms / 5,000 ms |
| + 123µs | |
| コード長 | 640 bytes |
| 記録 | |
| コンパイル時間 | 3,575 ms |
| コンパイル使用メモリ | 68,872 KB |
| 実行使用メモリ | 9,916 KB |
| 最終ジャッジ日時 | 2026-10-12 01:46:30 |
| 合計ジャッジ時間 | 3,204 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge4_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 10 |
ソースコード
import sequtils,algorithm
template times*(n:int,body) = (for _ in 0..<n: body)
template `max=`*(x,y) = x = max(x,y)
proc getchar_unlocked():char {. importc:"getchar_unlocked",header: "<stdio.h>" .}
proc scan(): int =
while true:
var k = getchar_unlocked()
if k < '0' or k > '9': break
else: result = 10 * result + k.ord - '0'.ord
let n = scan()
let m = scan()
var N = newSeqWith(n,newSeq[int](n))
m.times:
let (i1,i2,s) = (scan(),scan(),scan())
N[i1][i2] = s
var p = toSeq(0..<n)
var ans = 0
while p.nextPermutation():
var x = 0
for i in 0..<n:
for j in (i+1)..<n:
x += N[p[i]][p[j]]
ans .max= x
echo ans