-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtruedare.cpp
124 lines (112 loc) · 2.4 KB
/
truedare.cpp
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
#include <iostream>
#include <vector>
using namespace std;
/*
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
vector<int> result;
int t;
cin>>t;
for(int l=0;l<t;l++)
{
bool truth = false;
bool dare = false;
//tr dr ts ds
int n_tr;
cin>>n_tr;
int tr[n_tr];
for(int i=0;i<n_tr;i++)
{
cin>>tr[i];
}
int n_dr;
cin>>n_dr;
int dr[n_dr];
for(int i=0;i<n_dr;i++)
{
cin>>dr[i];
}
int n_ts;
cin>>n_ts;
int ts[n_ts];
for(int i=0;i<n_ts;i++)
{
cin>>ts[i];
}
int n_ds;
cin>>n_ds;
int ds[n_ds];
for(int i=0;i<n_ds;i++)
{
cin>>ds[i];
}
//checking subset for truth case
{ int count=0;
for(int i=0;i<n_ts;i++)
{
bool check = false;
for (int j=0; j<n_tr; j++)
{
if (ts[i] == tr[j])
{
check = true;
}
}
if (check == true)
{
count++;
}
}
if (count == n_ts)
{
truth = true;
}
}
//checking subset for dare case
{
int count=0;
for(int i=0;i<n_ds;i++)
{
bool check = false;
for (int j=0; j<n_dr; j++)
{
if (ds[i] == dr[j])
{
check = true;
}
}
if (check == true)
{
count++;
}
}
if (count == n_ds)
{
dare = true;
}
}
if(truth == true && dare == true)
{
result.push_back(1);
}
else
{
result.push_back(0);
}
}
//outside test case wala scope
for (int k=0;k<t;k++)
{
if(result[k] == 1)
{
cout<<"yes"<<"\n";
}
else
{
cout<<"no"<<"\n";
}
}
return 0;
}*/