結果
問題 | No.1639 最小通信路 |
ユーザー |
|
提出日時 | 2021-08-06 21:50:50 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 549 bytes |
コンパイル時間 | 3,426 ms |
コンパイル使用メモリ | 230,092 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-09-17 01:45:34 |
合計ジャッジ時間 | 6,537 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 21 RE * 22 |
ソースコード
#include <atcoder/all>#include <bits/stdc++.h>#include <cmath>using namespace std;using namespace atcoder;using ll = long long;#define all(A) A.begin(),A.end()using vll = vector<ll>;#define rep(i, n) for (long long i = 0; i < (long long)(n); i++)using Graph = vector<vector<ll>>;Graph G;vll E;vector<bool> seen;ll k = 0;int main() {ll N;cin >> N;dsu D(N);while (1) {ll A, B, C;cin >> A >> B >> C;A--; B--;if (!D.same(A, B));D.merge(A, B);if (D.size(A) == N) {cout << C << endl;return 0;}}}