結果
| 問題 |
No.2780 The Bottle Imp
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-06-07 21:46:04 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 435 bytes |
| コンパイル時間 | 4,947 ms |
| コンパイル使用メモリ | 257,152 KB |
| 最終ジャッジ日時 | 2025-02-21 20:08:13 |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 36 WA * 4 |
ソースコード
#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';
}