結果
| 問題 | No.90 品物の並び替え |
| コンテスト | |
| ユーザー |
sugim48
|
| 提出日時 | 2014-12-07 19:47:33 |
| 言語 | C++11(廃止可能性あり) (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
CE
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 1,232 bytes |
| 記録 | |
| コンパイル時間 | 29 ms |
| 最終ジャッジ日時 | 2026-03-04 21:47:38 |
| 合計ジャッジ時間 | 248 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
コンパイルメッセージ
e5219b83e17d
[/j_bin/judge_tool judge 40000 ../CompileMemory.txt /dev/null sud /dev/null _ g++-15 -O2 -lm -std=gnu++11 -Wuninitialized -DONLINE_JUDGE -o a.out main.cpp]
strconv.Atoi: parsing "../CompileMemory.txt": invalid syntax
goroutine 1 [running]:
runtime/debug.Stack()
/home/yuki2006/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.25.0.linux-amd64/src/runtime/debug/stack.go:26 +0x5e
main.main.func1()
/home/yuki2006/gopath/src/yukicoder/judge/main.go:22 +0x57
panic({0x7d6880?, 0xc0000f6240?})
/home/yuki2006/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.25.0.linux-amd64/src/runtime/panic.go:783 +0x132
main.judgeMain({0xc000012150, 0x5?, 0x0?})
/home/yuki2006/gopath/src/yukicoder/judge/judge_linux.go:121 +0x4b1
main.main()
/home/yuki2006/gopath/src/yukicoder/judge/main.go:97 +0x277
ソースコード
#define _USE_MATH_DEFINES
#include <algorithm>
#include <cstdio>
#include <functional>
#include <iostream>
#include <cfloat>
#include <climits>
#include <cstring>
#include <cmath>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <time.h>
#include <vector>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> i_i;
typedef pair<ll, int> ll_i;
typedef pair<double, int> d_i;
typedef pair<ll, ll> ll_ll;
typedef pair<double, double> d_d;
struct edge { int u, v; ll w; };
ll MOD = 1000000007;
ll _MOD = 1000000009;
double EPS = 1e-9;
int main() {
int N, M; cin >> N >> M;
vector<int> a(M), b(M), c(M);
for (int j = 0; j < M; j++)
cin >> a[j] >> b[j] >> c[j];
vector<int> v(N);
for (int i = 0; i < N; i++)
v[i] = i;
int maxi = 0;
do {
vector< vector<bool> > p(N + 1, vector<bool>(N + 1));
for (int i = 0; i < N; i++)
for (int j = i + 1; j < N; j++)
p[v[i]][v[j]] = true;
int sum = 0;
for (int j = 0; j < M; j++)
if (p[a[j]][b[j]])
sum += c[j];
maxi = max(maxi, sum);
} while (next_permutation(v.begin(), v.end()));
cout << maxi << endl;
}
sugim48