mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-11-23 18:48:48 +00:00
CF1166E The LCMs Must be Large
https://www.luogu.com.cn/record/84597793
This commit is contained in:
parent
21757eb268
commit
f062b85fe4
40
Luogu/CF1166E/CF1166E.cpp
Normal file
40
Luogu/CF1166E/CF1166E.cpp
Normal file
@ -0,0 +1,40 @@
|
||||
#include <iostream>
|
||||
#include <bitset>
|
||||
|
||||
using std::cin;
|
||||
using std::cout;
|
||||
const char endl = '\n';
|
||||
|
||||
const int N = 1e4 + 5;
|
||||
|
||||
int m, n;
|
||||
std::bitset<N> s[55];
|
||||
|
||||
int main() {
|
||||
std::ios::sync_with_stdio(false);
|
||||
cin.tie(nullptr);
|
||||
|
||||
cin >> m >> n;
|
||||
|
||||
for (int i = 1, k; i <= m; i++) {
|
||||
cin >> k;
|
||||
|
||||
for (int j = 1, x; j <= k; j++) {
|
||||
cin >> x;
|
||||
|
||||
s[i].set(x);
|
||||
}
|
||||
|
||||
for (int j = 1; j < i; j++) {
|
||||
if (!(s[i] & s[j]).count()) {
|
||||
cout << "impossible" << endl;
|
||||
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
cout << "possible" << endl;
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user