-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path16171.cpp
More file actions
49 lines (37 loc) ยท 738 Bytes
/
16171.cpp
File metadata and controls
49 lines (37 loc) ยท 738 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
//
// 16171.cpp
// algo
//
// Created by ๋ฐํจ์ on 2021/09/17.
//
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
using namespace std;
int main(){
cin.tie(0);
cout.tie(0);
string s1,s2;
cin>>s1>>s2;
map<string,int>m;
string tmp="";
for(int i=0;i<s1.size();i++){
if((s1[i]>='a'&&s1[i]<='z')||(s1[i]>='A'&&s1[i]<='Z')){
tmp+=s1[i];
}
}
for(int i=0;i<tmp.size();i++){
string s="";
for(int j=i;j<tmp.size();j++){
s+=tmp[j];
m[s]=1;
}
}
if(m[s2]==1){
cout<<1<<"\n";
}else{
cout<<0<<"\n";
}
return 0;
}