Submission #1678215
Source Code Expand
#include <bits/stdc++.h> using namespace std; int main(){ int n,m; cin >> n >> m; vector<int> k[n]; vector<int> l[m]; for(int i = 0; i < n; ++i){ int lmax; cin >> lmax; for(int j = 0; j < lmax; ++j){ int lg; cin >> lg; k[i].push_back(lg); l[lg-1].push_back(i); } } vector<bool> ku(n,false); ku[l[0][0]] = true; for(int i = 0; i < m; ++i){ bool f = false; for(int j = 0; j < l[i].size(); ++j){ int pos = l[i][j]; if(!f && ku[pos]){ f = true; j = 0; } if(f && !ku[pos]){ ku[pos] = true; } } } bool flag = true; for(int i = 0; i < n; ++i){ if(!ku[i]){ flag = false; break; } } if(flag) cout << "YES" << endl; else cout << "NO" << endl; return 0; }
Submission Info
Submission Time | |
---|---|
Task | C - Interpretation |
User | rsy3244 |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 764 Byte |
Status | RE |
Exec Time | 291 ms |
Memory | 8440 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 | AC | 1 ms | 256 KB |
01-02.txt | WA | 1 ms | 256 KB |
01-03.txt | RE | 291 ms | 384 KB |
01-04.txt | WA | 2 ms | 256 KB |
01-05.txt | AC | 2 ms | 256 KB |
01-06.txt | RE | 97 ms | 256 KB |
01-07.txt | RE | 97 ms | 256 KB |
01-08.txt | RE | 96 ms | 256 KB |
01-09.txt | WA | 2 ms | 256 KB |
01-10.txt | RE | 96 ms | 256 KB |
02-01.txt | RE | 134 ms | 5376 KB |
02-02.txt | AC | 46 ms | 6144 KB |
02-03.txt | AC | 42 ms | 3712 KB |
02-04.txt | WA | 54 ms | 7040 KB |
02-05.txt | WA | 50 ms | 5632 KB |
02-06.txt | RE | 144 ms | 7040 KB |
02-07.txt | WA | 51 ms | 6144 KB |
02-08.txt | AC | 39 ms | 6136 KB |
02-09.txt | RE | 149 ms | 8440 KB |
02-10.txt | WA | 44 ms | 6136 KB |
02-11.txt | AC | 44 ms | 6136 KB |
02-12.txt | WA | 44 ms | 6016 KB |
02-13.txt | AC | 45 ms | 6016 KB |
sample-01.txt | AC | 1 ms | 256 KB |
sample-02.txt | AC | 1 ms | 256 KB |