Submission #1678232
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; lg--; k[i].push_back(lg); l[lg].push_back(i); } } vector<bool> ku(n,false); for(int i = 0; i < m; ++i){ if(l[i].size() != 0){ ku[l[i][0]] = true; break; } } 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 | 849 Byte |
Status | WA |
Exec Time | 65 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 | 2 ms | 256 KB |
01-03.txt | AC | 2 ms | 384 KB |
01-04.txt | WA | 2 ms | 256 KB |
01-05.txt | AC | 2 ms | 256 KB |
01-06.txt | WA | 2 ms | 256 KB |
01-07.txt | WA | 2 ms | 256 KB |
01-08.txt | AC | 2 ms | 256 KB |
01-09.txt | WA | 2 ms | 256 KB |
01-10.txt | AC | 2 ms | 384 KB |
02-01.txt | WA | 46 ms | 5376 KB |
02-02.txt | AC | 50 ms | 6144 KB |
02-03.txt | AC | 45 ms | 3712 KB |
02-04.txt | WA | 60 ms | 7040 KB |
02-05.txt | WA | 56 ms | 5632 KB |
02-06.txt | AC | 65 ms | 7040 KB |
02-07.txt | WA | 58 ms | 6144 KB |
02-08.txt | AC | 42 ms | 6136 KB |
02-09.txt | AC | 57 ms | 8440 KB |
02-10.txt | WA | 47 ms | 6136 KB |
02-11.txt | AC | 47 ms | 6136 KB |
02-12.txt | WA | 46 ms | 6016 KB |
02-13.txt | AC | 48 ms | 6016 KB |
sample-01.txt | AC | 1 ms | 256 KB |
sample-02.txt | AC | 1 ms | 256 KB |