Submission #1331115
Source Code Expand
#include<bits/stdc++.h> using namespace std; #define ran 222222 int n,m; vector<int> e[ran]; bool vis[ran]; void dfs(int x){ if(vis[x])return; vis[x] = true; for(vector<int>::iterator it = e[x].begin(); it!=e[x].end(); it++){ dfs(*it); } } int main(){ scanf("%d%d",&n,&m); for(int i=1; i<=n; i++){ int x,y; for(scanf("%d",&x); x--;){ scanf("%d",&y); y += n; e[i].push_back(y); e[y].push_back(i); } } dfs(1); bool fl = true; for(int i=1; i<=n; i++)if(!vis[i]) fl = false; puts(fl?"YES":"NO"); return 0; }
Submission Info
Submission Time | |
---|---|
Task | C - Interpretation |
User | maryanna2016 |
Language | C++14 (GCC 5.4.1) |
Score | 400 |
Code Size | 569 Byte |
Status | AC |
Exec Time | 40 ms |
Memory | 9216 KB |
Compile Error
./Main.cpp: In function ‘int main()’: ./Main.cpp:15:21: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] scanf("%d%d",&n,&m); ^ ./Main.cpp:18:21: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] for(scanf("%d",&x); x--;){ ^ ./Main.cpp:19:18: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] scanf("%d",&y); ^
Judge Result
Set Name | sample | dataset1 | dataset2 | ||||||
---|---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 200 / 200 | 200 / 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 | AC | 3 ms | 5504 KB |
01-02.txt | AC | 4 ms | 5504 KB |
01-03.txt | AC | 4 ms | 5504 KB |
01-04.txt | AC | 4 ms | 5504 KB |
01-05.txt | AC | 4 ms | 5504 KB |
01-06.txt | AC | 4 ms | 5504 KB |
01-07.txt | AC | 4 ms | 5504 KB |
01-08.txt | AC | 4 ms | 5504 KB |
01-09.txt | AC | 4 ms | 5504 KB |
01-10.txt | AC | 4 ms | 5504 KB |
02-01.txt | AC | 27 ms | 8448 KB |
02-02.txt | AC | 30 ms | 9216 KB |
02-03.txt | AC | 28 ms | 8192 KB |
02-04.txt | AC | 40 ms | 8704 KB |
02-05.txt | AC | 33 ms | 9216 KB |
02-06.txt | AC | 36 ms | 8704 KB |
02-07.txt | AC | 34 ms | 9088 KB |
02-08.txt | AC | 26 ms | 9080 KB |
02-09.txt | AC | 29 ms | 9080 KB |
02-10.txt | AC | 24 ms | 9080 KB |
02-11.txt | AC | 24 ms | 9080 KB |
02-12.txt | AC | 24 ms | 8960 KB |
02-13.txt | AC | 24 ms | 8960 KB |
sample-01.txt | AC | 3 ms | 5504 KB |
sample-02.txt | AC | 3 ms | 5504 KB |