Submission #6185330
Source Code Expand
#include <bits/stdc++.h> using namespace std; #define fi first #define endl "\n" #define se second #define ll long long //priority_queue<int, vector<int>, greater<int> > pq; #define _CRT_SECURE_NO_DEPRECATE const int N = 300030; #define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end))) const ll mod = 1e9+7; int n,m; vector<int> g[N]; bool b[N]; void dfs(int x) { b[x]=1; for(int u:g[x]) { if(!b[u]) dfs(u); } return ; } int main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); cin>>n>>m; rep(i,0,n) { int sze; cin>>sze; while(sze--) { int x; cin>>x; g[i].push_back(n-1+x); g[n-1+x].push_back(i); } } dfs(0); bool ans=false; rep(i,0,n) ans&=b[i]; if(ans) cout<<"YES"; else cout<<"NO"; }
Submission Info
Submission Time | |
---|---|
Task | C - Interpretation |
User | Zoro627 |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 929 Byte |
Status | WA |
Exec Time | 36 ms |
Memory | 11008 KB |
Judge Result
Set Name | sample | dataset1 | dataset2 | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 200 | 0 / 200 | ||||||||||||
Status |
|
|
|
Set Name | Test Cases |
---|---|
sample | sample-01.txt, sample-02.txt |
dataset1 | sample-01.txt, sample-02.txt, 01-01.txt, 01-02.txt, 01-03.txt, 01-04.txt, 01-05.txt, 01-06.txt, 01-07.txt, 01-08.txt, 01-09.txt, 01-10.txt |
dataset2 | sample-01.txt, sample-02.txt, 01-01.txt, 01-02.txt, 01-03.txt, 01-04.txt, 01-05.txt, 01-06.txt, 01-07.txt, 01-08.txt, 01-09.txt, 01-10.txt, 02-01.txt, 02-02.txt, 02-03.txt, 02-04.txt, 02-05.txt, 02-06.txt, 02-07.txt, 02-08.txt, 02-09.txt, 02-10.txt, 02-11.txt, 02-12.txt, 02-13.txt, sample-01.txt, sample-02.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
01-01.txt | WA | 4 ms | 7296 KB |
01-02.txt | WA | 4 ms | 7296 KB |
01-03.txt | AC | 4 ms | 7296 KB |
01-04.txt | WA | 4 ms | 7296 KB |
01-05.txt | AC | 4 ms | 7296 KB |
01-06.txt | WA | 4 ms | 7296 KB |
01-07.txt | WA | 4 ms | 7296 KB |
01-08.txt | AC | 4 ms | 7296 KB |
01-09.txt | WA | 4 ms | 7296 KB |
01-10.txt | WA | 4 ms | 7296 KB |
02-01.txt | WA | 24 ms | 10368 KB |
02-02.txt | AC | 26 ms | 11008 KB |
02-03.txt | AC | 25 ms | 9984 KB |
02-04.txt | WA | 36 ms | 10624 KB |
02-05.txt | WA | 30 ms | 11008 KB |
02-06.txt | AC | 32 ms | 10624 KB |
02-07.txt | WA | 29 ms | 11008 KB |
02-08.txt | AC | 21 ms | 10872 KB |
02-09.txt | WA | 23 ms | 10872 KB |
02-10.txt | WA | 21 ms | 10872 KB |
02-11.txt | AC | 21 ms | 11000 KB |
02-12.txt | WA | 22 ms | 10880 KB |
02-13.txt | AC | 22 ms | 10880 KB |
sample-01.txt | WA | 4 ms | 7296 KB |
sample-02.txt | AC | 4 ms | 7296 KB |