-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLUCKYSTR.cpp
More file actions
55 lines (49 loc) · 930 Bytes
/
LUCKYSTR.cpp
File metadata and controls
55 lines (49 loc) · 930 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
48
49
50
51
52
53
54
55
#include <iostream>
#include <algorithm>
#include <vector>
#include <cstring>
#include <map>
using namespace std;
int main(){
#ifndef ONLINE_JUDGE
// for getting input from input.txt
freopen("input.txt", "r", stdin);
// for writing output to output.txt
freopen("output.txt", "w", stdout);
#endif
int k,n;
cin>>k>>n;
vector <string > favSubs, bStr;
for(int i=0;i<k;i++){
string s;
cin>>s;
favSubs.push_back(s);
}
for(int i=0;i<n;i++){
string s;
cin>>s;
bStr.push_back(s);
}
bool isGood=false;
for ( auto i : bStr){
isGood=false;
if(i.size()>=47){
isGood=true;
}
if(!isGood){
for(auto x : favSubs){
if(i.find(x)!=string::npos){
isGood=true;
break;
}
}
}
if(isGood){
cout<<"Good\n";
}
else{
cout<<"Bad\n";
}
}
return 0;
}