Repository navigation
Expand file tree
/
Copy pathchef_characters.cpp
More file actions
97 lines (97 loc) · 2.59 KB
/
Copy pathchef_characters.cpp
File metadata and controls
97 lines (97 loc) · 2.59 KB
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
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define pb push_back
#define mp make_pair
#define all(v) v.begin(),v.end()
#define Fl(i,a,b) for(ll i=a;i<b;i++)
#define Fll(i,a,b) for(ll i=a;i<=b;i++)
#define Fr(i,a,b) for(ll i=a;i>=0;i--)
//-------------------------------------------------------
#define ipair pair<ll,ll>
#define vll vector<ll>
#define vstr vector<string>
#define vchar vector<char>
#define sll set<ll>
#define mll map<ll,ll>
//---------------------------------------------------------
#define MIN -1
#define MAX 1e10
#define VER 101
#define fastread ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
vll adj[VER];
//----------------------------------------------------------------------------
void make_edge(ll a,ll b)
{
adj[a].pb(b);
adj[b].pb(a);
}
//-----------------------------------------------------------------------------
int main()
{
fastread
bool flag=false;
ll n,i,ans;
string s;
list<char> lovely;
cin>>n;
while(n--)
{
i=-1;
lovely.clear();
ans=0;
cin>>s;
while(s[++i]!='\0')
{
flag=false;
if(s[i]=='c' || s[i]=='h' || s[i]=='e' || s[i]=='f')
{
if(lovely.size()<4)
{
for(list<char> :: iterator it=lovely.begin();it!=lovely.end();it++)
{
if((*it)==s[i])
flag=true;
}
if(flag)
{
while(lovely.size()>0)
{
if(lovely.front()==s[i])
{
lovely.pop_front();
break;
}
lovely.pop_front();
}
}
lovely.pb(s[i]);
}
else
{
while(lovely.size()>0)
{
if(s[i]==lovely.front())
{
lovely.pop_front();
break;
}
lovely.pop_front();
}
lovely.pb(s[i]);
}
}
else
lovely.clear();
if(lovely.size()==4)
ans++;
}
if(ans==0)
cout<<"normal";
else
cout<<"lovely"<<" "<<ans;
cout<<"\n";
}
return 0;
}