-
Notifications
You must be signed in to change notification settings - Fork 0
/
9935.cpp
39 lines (31 loc) · 792 Bytes
/
9935.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
#include<iostream>
#include<string>
#include<vector>
using namespace std;
int main()
{
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
int i, j;
vector<char> v;
string str, target;
cin >> str >> target;
for(i=0; i<str.size(); i++){
v.push_back(str[i]);
if(v.size()>=target.length()){
bool exit=false;
for(j=0; j<target.length(); j++){
if(target[j]!=v[v.size()-target.length()+j]){
exit=true;
break;
}
}
if(exit) continue;
for(j=0; j<target.length(); j++) v.pop_back();
}
}
string ans(v.begin(), v.end());
if(v.size()==0) ans="FRULA";
cout << ans;
return 0;
}