結果

問題 No.2780 The Bottle Imp
ユーザー t98slidert98slider
提出日時 2024-06-07 21:46:04
言語 C++17(gcc12)
(gcc 12.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 435 bytes
コンパイル時間 6,380 ms
コンパイル使用メモリ 267,620 KB
実行使用メモリ 25,828 KB
最終ジャッジ日時 2024-12-27 13:39:33
合計ジャッジ時間 7,013 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 36 WA * 4
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using ll = long long;

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	int n;
	cin >> n;
	atcoder::scc_graph g(n);
	for(int i = 0; i < n; i++){
		int m, j;
		cin >> m;
		while(m--){
			cin >> j;
			g.add_edge(i, j - 1);
		}
	}
	auto G = g.scc();
	sort(G[0].begin(), G[0].end());
	cout << (binary_search(G[0].begin(), G[0].end(), 0) ? "Yes" : "No") << '\n';
}
0