結果

問題 No.2780 The Bottle Imp
ユーザー AwashAmityOak
提出日時 2024-06-07 22:25:23
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 1,743 bytes
コンパイル時間 5,766 ms
コンパイル使用メモリ 308,036 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-27 14:04:19
合計ジャッジ時間 7,440 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 31 WA * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
using ll = long long;
using ld = long double;
#define int ll
#define OVERLOAD_REP(_1, _2, _3, name, ...) name
#define REP2(i, l, r) for (int i = (int)(l); i < (int)(r); ++i)
#define REP1(i, n) REP2(i, 0, n)
#define rep(...) OVERLOAD_REP(__VA_ARGS__, REP2, REP1)(__VA_ARGS__)
#define RREP2(i, r, l) for (int i = (int)(r)-1; i >= (int)(l); --i)
#define RREP1(i, n) RREP2(i, n, 0)
#define rrep(...) OVERLOAD_REP(__VA_ARGS__, RREP2, RREP1)(__VA_ARGS__)
#define all(x) begin(x), end(x)
#define rall(x) rbegin(x), rend(x)
#define debug(x) cerr << #x << ": " << (x) << endl
#define pb push_back
#define mp make_pair
#define mt make_tuple
const int INF = 4e18;
const int MOD = 998244353;
const int MOD1 = 1e9 + 7;
template<class T> inline bool chmax(T &a, T b) { return a < b ? a = b, 1 : 0; }
template<class T> inline bool chmin(T &a, T b) { return a > b ? a = b, 1 : 0; }
template<class T> T pow(T a, T b, T m) { return b ? b&1 ? a*pow(a, b^1, m)%m : pow(a*a%m, b>>1, m)%m : 1; }
template<class T> T pow(T a, T b) { return b ? b&1 ? pow(a, b^1)*a : pow(a*a, b>>1) : 1; }
template<class... T> void input(T&... args) { ((cin >> args), ...); }
template<class... T> void print(T... args) { ((cout << args << " "), ...); }
template<class... T> void println(T... args) { print(args...); cout << endl; }
template<class T> void println(vector<T> A) { for (T a : A) print(a); cout << endl; }

// struct UnionFind

signed main() {
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
    
	int N;
	input(N);
	dsu uf(N);
	rep(i, N) {
		int M;
		input(M);
		rep(j, M) {
			int A;
			input(A);
			--A;
			uf.merge(i, A);
		}
	}
	println(uf.size(0) == N ? "Yes" : "No");
}
0