結果
| 問題 | No.1639 最小通信路 |
| コンテスト | |
| ユーザー |
Kude
|
| 提出日時 | 2021-08-06 21:54:00 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
CE
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 1,092 bytes |
| 記録 | |
| コンパイル時間 | 402 ms |
| コンパイル使用メモリ | 67,912 KB |
| 最終ジャッジ日時 | 2026-01-05 05:05:24 |
| 合計ジャッジ時間 | 1,246 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
コンパイルメッセージ
main.cpp:15:9: 致命的エラー: boost/multiprecision/cpp_int.hpp: そのようなファイルやディレクトリはありません
15 | #include<boost/multiprecision/cpp_int.hpp>
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
コンパイルを停止しました。
ソースコード
#include<bits/stdc++.h>
#include<atcoder/all>
using namespace std;
using namespace atcoder;
#define rep(i,n)for (int i = 0; i < int(n); ++i)
#define rrep(i,n)for (int i = int(n)-1; i >= 0; --i)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
template<class T> void chmax(T& a, const T& b) {a = max(a, b);}
template<class T> void chmin(T& a, const T& b) {a = min(a, b);}
using P = pair<int,int>;
using VI = vector<int>;
using VVI = vector<VI>;
#include<boost/multiprecision/cpp_int.hpp>
using ll = boost::multiprecision::cpp_int;
using VL = vector<ll>;
using VVL = vector<VL>;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int n;
cin >> n;
int m = n * (n - 1) / 2;
VI a(m), b(m);
VL c(m);
rep(i, m) cin >> a[i] >> b[i] >> c[i], a[i]--, b[i]--;
VI ord(m);
iota(all(ord), 0);
sort(all(ord), [&](const ll& x, const ll& y) {return x < y;});
dsu d(n);
for(int i: ord) {
d.merge(a[i], b[i]);
if (d.size(a[i]) == n) {
cout << c[i] << '\n';
return 0;
}
}
}
Kude