結果
問題 | No.90 品物の並び替え |
ユーザー |
![]() |
提出日時 | 2014-12-09 18:56:38 |
言語 | PyPy2 (7.3.15) |
結果 |
AC
|
実行時間 | 247 ms / 5,000 ms |
コード長 | 399 bytes |
コンパイル時間 | 1,048 ms |
コンパイル使用メモリ | 76,920 KB |
実行使用メモリ | 78,056 KB |
最終ジャッジ日時 | 2024-06-11 18:56:28 |
合計ジャッジ時間 | 1,706 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 9 |
ソースコード
score = [0] * 1000N, M = map(int, raw_input().split())for t in xrange(M):a, b, c = map(int, raw_input().split())score[a * N + b] = cdef solve(m):res = 0for i in xrange(0, N):if (m >> i) & 1 == 0:tmp = 0for j in xrange(0, N):if (m >> j) & 1 == 1:tmp += score[j * N + i]res = max(res, tmp + solve(m | (1 << i)))return resprint solve(0)