-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path310-2.cpp
More file actions
47 lines (45 loc) · 863 Bytes
/
310-2.cpp
File metadata and controls
47 lines (45 loc) · 863 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#include <bits/stdc++.h>
using namespace std;
typedef struct node
{
int p,c;
set<int> s;
} node;
int main()
{
int n,m;
cin>>n>>m;
vector<node> a(n);
for(auto &t:a)
{
cin>>t.p>>t.c;
for(int i=1;i<=t.c;i++)
{
int y;
cin>>y;
t.s.insert(y);
}
}
bool tag=0;
for(int i=0;i<n;i++)
for(int j=0;j<n;j++)
{
if(tag)break;
if(a[i].p>=a[j].p)
{
set<int> sn(a[j].s);
sn.insert(a[i].s.begin(),a[i].s.end());
if(sn.size()==a[j].s.size())
{
if(a[i].p>a[j].p||a[j].s.size()>a[i].s.size())
{
tag=1;
}
}
}
}
if(tag)cout<<"Yes"<<endl;
else cout<<"No"<<endl;
system("pause");
return 0;
}