-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathCF_442_div2_A.cpp
More file actions
36 lines (36 loc) · 797 Bytes
/
CF_442_div2_A.cpp
File metadata and controls
36 lines (36 loc) · 797 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
#include<bits/stdc++.h>
using namespace std;
int main()
{
char s[101];
cin>>s;
int ans=0,k=0;
// char s1[8];
for(int i=0;s[i]!='\0';i++)
{
k=0;
char s1[8]={'\0'};
for(int j=i;s[j]!='\0'&&k<=6;j++)
{
s1[k]=s[j];
k++;
if(k>=3&&k<=6)
{ // cout<<s1<<endl;
if(!strcmp(s1,"Danil"))
ans++;
if(!strcmp(s1,"Olya"))
ans++;
if(!strcmp(s1,"Slava"))
ans++;
if(!strcmp(s1,"Ann"))
ans++;
if(!strcmp(s1,"Nikita"))
ans++;
}
}
}
if(ans==1)
cout<<"YES"<<endl;
else
cout<<"NO"<<endl;
}