結果

問題 No.330 Eigenvalue Decomposition
ユーザー yurukumoyurukumo
提出日時 2021-09-22 19:36:49
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 186 ms / 5,000 ms
コード長 1,318 bytes
コンパイル時間 3,925 ms
コンパイル使用メモリ 230,728 KB
実行使用メモリ 9,716 KB
最終ジャッジ日時 2023-09-18 19:41:51
合計ジャッジ時間 7,815 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 84 ms
7,136 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 4 ms
4,380 KB
testcase_03 AC 83 ms
6,956 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 3 ms
4,376 KB
testcase_06 AC 93 ms
7,040 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 62 ms
5,692 KB
testcase_09 AC 155 ms
4,376 KB
testcase_10 AC 1 ms
4,376 KB
testcase_11 AC 49 ms
4,380 KB
testcase_12 AC 184 ms
7,332 KB
testcase_13 AC 1 ms
4,376 KB
testcase_14 AC 47 ms
4,376 KB
testcase_15 AC 16 ms
9,652 KB
testcase_16 AC 1 ms
4,376 KB
testcase_17 AC 6 ms
4,380 KB
testcase_18 AC 38 ms
8,804 KB
testcase_19 AC 2 ms
4,380 KB
testcase_20 AC 9 ms
4,376 KB
testcase_21 AC 186 ms
6,996 KB
testcase_22 AC 5 ms
4,376 KB
testcase_23 AC 12 ms
4,380 KB
testcase_24 AC 153 ms
4,376 KB
testcase_25 AC 2 ms
4,380 KB
testcase_26 AC 7 ms
4,376 KB
testcase_27 AC 12 ms
9,716 KB
testcase_28 AC 2 ms
4,376 KB
testcase_29 AC 7 ms
6,156 KB
testcase_30 AC 1 ms
4,376 KB
testcase_31 AC 1 ms
4,380 KB
testcase_32 AC 2 ms
4,380 KB
testcase_33 AC 1 ms
4,380 KB
testcase_34 AC 1 ms
4,376 KB
testcase_35 AC 2 ms
4,376 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: 関数 ‘void read(Args& ...)’ 内:
main.cpp:34:25: 警告: fold-expressions only available with ‘-std=c++17’ or ‘-std=gnu++17’ [-Wc++17-extensions]
   34 |    ( std::cin >> ... >> args );
      |                         ^~~~

ソースコード

diff #

#include <bits/stdc++.h>
#include <atcoder/all>
#define int long long
#define endl "\n"
#define all(n) n.begin(),n.end()
#define rall(n) n.rbegin(),n.rend()
#define rep(i, s, n) for (int i = s; i < (int)(n); i++)
#define floatset(n) fixed<<setprecision(n)
#define rangeout(x,y,h,w) (x<0||y<0||h-1<x||w-1<y)
using namespace std;
using namespace atcoder;
template<class T>using vec=vector<T>;
template<class T>using min_queue=priority_queue<T,vector<T>,greater<T>>;
using ll = long long;
using ld = long double;
using pll = pair<ll,ll>;
using Graph = vector<vector<int>>;
constexpr ll INF = 1e18;
constexpr ll mod = 1000000007;
constexpr ll MOD = 998244353;
constexpr int dx[4]={1,0,-1,0};
constexpr int dy[4]={0,1,0,-1};
template<typename T>
bool chmin(T&a,T b){return a>b?a=b,true:false;}
template<typename T>
bool chmax(T&a,T b){return a<b?a=b,true:false;}
bool Flag(int bit,int i){return (bit&(1LL<<i));}
template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    fill( (T*)array, (T*)(array+N), val );
}
template <typename ...Args>
void read(Args &...args) {
   ( std::cin >> ... >> args );
}
signed main(){
    int N,M;
    read(N,M);
    dsu uf(N);
    for(int i=0;i<M;i++){
        int a,b,c;
        read(a,b,c);
        uf.merge(--a,--b);
    }
    cout<<uf.groups().size()<<endl;
}
0