ZhenlongDai/ACPR huggingface dataset:
Problem: p03150
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=input()
flag=1
for i in range(len(s)):
  for j in range(1,len(s)-i+1):
    if (s[:i]+s[i+j:])=='keyence':
      flag*=0
if flag==0:
  print('YES')
else:
  print('NO')

Failing test case input:
keyence

Expected output:
YES

Actual output:
NO


Fixed submission (verdict: Accepted):
s=input()
flag=1
if s=='keyence':
  flag=0
for i in range(len(s)):
  for j in range(1,len(s)-i+1):
    if (s[:i]+s[i+j:])=='keyence':
      flag*=0
if flag==0:
  print('YES')
else:
  print('NO')

Problem: p03150
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from sys import exit
import math
ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))

s=input()

key = "keyence"

for i in range(len(s)):
    j = i + len(s) -7
    if s[:i] + s[j:] == key:
        print("Yes")
        exit()
print("No")

Failing test case input:
eeeofscjymci

Expected output:
NO


Actual output:
No


Fixed submission (verdict: Accepted):
from sys import exit
import math
ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))

s=input()

key = "keyence"

for i in range(len(s)):
    j = i + len(s) -7
    if s[:i] + s[j:] == key:
        print("YES")
        exit()
print("NO")

Problem: p03150
Buggy submission (Python (3.4.3), verdict: Wrong Answer):


def simple_input():
    temp_input = input().rstrip().split(' ')
    if len(temp_input) > 1:
        return temp_input
    return temp_input[0]


if __name__ == '__main__':
    
    s = input()
    keyence = "keyence"

    result = "NO"
    
    matchcount = 0
    for i in range(7):
        si = s[i]
        ki = keyence[i]
        if(si == ki):
            matchcount = matchcount + 1
        else:
            break

    for i in range(7):
        i2 = i * -1 - 1
        si = s[i2]
        ki = keyence[i2]
        if(si == ki):
            matchcount = matchcount + 1
        else:
            break

    if(matchcount >= 7):
        result = "YES"
    
    print(matchcount)

    
    print(result)


Failing test case input:
mcygejriodfe

Expected output:
NO


Actual output:
1
NO


Fixed submission (verdict: Accepted):


def simple_input():
    temp_input = input().rstrip().split(' ')
    if len(temp_input) > 1:
        return temp_input
    return temp_input[0]


if __name__ == '__main__':
    
    s = input()
    keyence = "keyence"

    result = "NO"
    
    matchcount = 0
    for i in range(7):
        si = s[i]
        ki = keyence[i]
        if(si == ki):
            matchcount = matchcount + 1
        else:
            break

    for i in range(7):
        i2 = i * -1 - 1
        si = s[i2]
        ki = keyence[i2]
        if(si == ki):
            matchcount = matchcount + 1
        else:
            break

    if(matchcount >= 7):
        result = "YES"
    
    
    print(result)
Problem: p03150
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import re
m = re.match(r'^(\D+)keyence$|^k(\D+)eyence$|^ke(\D+)yence$|^key(\D+)ence$|^keye(\D+)nce$|^keyen(\D+)ce$|^keyenc(\D)+e$|^keyence(\D+)$',input())
print('YES' if m else 'NO')

Failing test case input:
keyence

Expected output:
YES

Actual output:
NO


Fixed submission (verdict: Accepted):
import re
m = re.match(r'^keyence$|^(\D+)keyence$|^k(\D+)eyence$|^ke(\D+)yence$|^key(\D+)ence$|^keye(\D+)nce$|^keyen(\D+)ce$|^keyenc(\D)+e$|^keyence(\D+)$',input())
print('YES' if m else 'NO')

Problem: p03150
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S=input()
if S=='keyence' or S[0:7]=='keyence' or S[-7:]=='keyence':
    print('YES')
    exit()
else:
    pass

if S[0]=='k':
    if S[-6:]=='eyence':
        print('YES')
    else:
        pass
if S[:2]=='ke':
    if S[-5:]=='yence':
        print('YES')
    else:
        pass
if S[:3]=='key':
    if S[-4:]=='ence':
        print('YES')
    else:
        pass
if S[:4]=='keye':
    if S[-3:]=='nce':
        print('YES')
    else:
        pass
if S[:5]=='keyen':
    if S[-2:]=='ce':
        print('YES')
    else:
        pass
if S[:6]=='keyen':
    if S[-1]=='e':
        print('YES')
    else:
        pass
print('NO')

Failing test case input:
keyofscience

Expected output:
YES

Actual output:
YES
NO


Fixed submission (verdict: Accepted):
S=input()
if S=='keyence' or S[0:7]=='keyence' or S[-7:]=='keyence':
    print('YES')
    exit()
else:
    pass

if S[0]=='k':
    if S[-6:]=='eyence':
        print('YES')
        exit()
    else:
        pass
if S[:2]=='ke':
    if S[-5:]=='yence':
        print('YES')
        exit()
    else:
        pass
if S[:3]=='key':
    if S[-4:]=='ence':
        print('YES')
        exit()
    else:
        pass
if S[:4]=='keye':
    if S[-3:]=='nce':
        print('YES')
        exit()
    else:
        pass
if S[:5]=='keyen':
    if S[-2:]=='ce':
        print('YES')
        exit()
    else:
        pass
if S[:6]=='keyenc':
    if S[-1]=='e':
        print('YES')
        exit()
    else:
        pass
print('NO')

Problem: p03150
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
for i in range(len(S)-7):
  S_cut = S[:i]+S[i+len(S)-7:]
  print(S_cut)
  if S_cut=='keyence':
    print('YES')
    exit()
print('NO')

Failing test case input:
slpt}n|fxb

Expected output:
NO


Actual output:
t}n|fxb
s}n|fxb
sln|fxb
NO


Fixed submission (verdict: Accepted):
S = input()
for i in range(len(S)-5):
  S_cut = S[:i]+S[i+len(S)-7:]
  
  if S_cut=='keyence':
    print('YES')
    exit()
print('NO')
Problem: p03150
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

s = input()
key = 'keyence'
key_r = 'ecneyek'
j = 0
for i in key:
    if s[j] == i:
        j += 1
    else:
        break
k = -1
for i in key_r:
    if s[k] == i:
        k -= 1
    else:
        break

s = s[:j] + s[k:]
if j >= k + 1:
    s = key
elif len(s) > 7:
    s = key
if s == key:
    print('YES')
else:
    print('NO')


Failing test case input:
eeyofscienci

Expected output:
NO


Actual output:
YES


Fixed submission (verdict: Accepted):

s = input()
key = 'keyence'
key_r = 'ecneyek'
j = 0
for i in key:
    if s[j] == i:
        j += 1
    else:
        break
k = 1
for i in key_r:
    if s[-k] == i:
        k += 1
    else:
        break

s = s[:j] + s[-k+1:]
if j + k > 7:
    s = key
if s == key:
    print('YES')
else:
    print('NO')

Problem: p03150
Buggy submission (Python (3.4.3), verdict: Wrong Answer):


import re

S = input()

if "keyence" in S:
    print("YES")
else:
    patterns = ["^k*eyence$", "^ke*yence$", "^key*ence$", "^keye*nce$", "^keyen*ce$", "^keyenc*e$"]

    matched = False
    for pattern in patterns:
        matchOB = re.search(pattern, S)
        if matchOB:
            matched = True
            break
    if matched:
        print("YES")
    else:
        print("NO")




Failing test case input:
keyofscience

Expected output:
YES

Actual output:
NO


Fixed submission (verdict: Accepted):


import re

S = input()

if "keyence" == S:
    print("YES")
else:
    patterns = ["^keyence(.*)", "^k(.*)eyence$", "^ke(.*)yence$", "^key(.*)ence$", "^keye(.*)nce$", "^keyen(.*)ce$", "^keyenc(.*)e$", "keyence$"]

    matched = False
    for pattern in patterns:
        matchOB = re.search(pattern, S)
        if matchOB:
            matched = True
            break
    if matched:
        print("YES")
    else:
        print("NO")

Problem: p03150
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S=input()
length=len(S)
ans='NO'
if S[0:7]=='keyence':
    ans='Yes'
elif S[-7:]=='keyence':
    ans='Yes'
elif S[0]=='k' and S[-6:]=='eyence':
    ans='Yes'
elif S[0:2]=='ke' and S[-5:]=='yence':
    ans='Yes'
elif S[0:3]=='key' and S[-4:]=='ence':
    ans='Yes'
elif S[0:4]=='keye' and S[-3:]=='nce':
    ans='Yes'
elif S[0:5]=='keyen' and S[-2:]=='ce':
    ans='Yes'
elif S[0:6]=='keyenc' and S[-1:]=='e':
    ans='yes'

print(ans)

Failing test case input:
keyofscience

Expected output:
YES

Actual output:
Yes


Fixed submission (verdict: Accepted):
S=input()
length=len(S)
ans='NO'
if S[0:7]=='keyence':
    ans='YES'
elif S[-7:]=='keyence':
    ans='YES'
elif S[0]=='k' and S[-6:]=='eyence':
    ans='YES'
elif S[0:2]=='ke' and S[-5:]=='yence':
    ans='YES'
elif S[0:3]=='key' and S[-4:]=='ence':
    ans='YES'
elif S[0:4]=='keye' and S[-3:]=='nce':
    ans='YES'
elif S[0:5]=='keyen' and S[-2:]=='ce':
    ans='YES'
elif S[0:6]=='keyenc' and S[-1:]=='e':
    ans='YES'

print(ans)
Problem: p03150
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
a = "keyence"

b = input()

k = len(b)
j = 0
jj = 0
kk = [0 for i in range(8)]
if k == 7:
	if a == b:
		print("YES")
	else:
		print("NO")
elif k >= 8:
	for i in range(k):
		if b[i] == a[j] and (jj == 0 or jj == 1 or jj == 2):
			j += 1
			if jj == 1:
				jj += 1
		elif jj == 0:
			jj = 1
		elif jj >= 2:
			print("NO")
			break
		if j == 7:
			if i != k-1:
				print("NO")
				break
			else:
				print("YES")
				break
else:
	print("NO")


Failing test case input:
slps}n|fxb

Expected output:
NO


Actual output:

Fixed submission (verdict: Accepted):
a = "keyence"

b = input()
o = 0
k = len(b)
j = 0
jj = 0
kk = [0 for i in range(8)]
al = 0
if k == 7:
	if a == b:
		print("YES")
	else:
		print("NO")
elif k >= 8:
	for i in range(k):
		if j == 7:
			al = 1
			print("YES")
			break
		if b[i] == a[j] and jj == 0:
			j += 1
		else:
			jj = 1
			o = j
		if jj == 1 and o == 0:
			if b[-7:] == a:
				print("YES")
				break
			else:
				print("NO")
				break
		elif jj == 1:
			if b[-(7-o):] == a[o:]:
				print("YES")
				break
			else:
				print("NO")
				break
else:
	print("NO")

Problem: p03150
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = str(input())
for i in range(8):
    word = S[:i]+S[-7:][i:]
    if word == "keyence":
        print("Yes")
        exit()
print("No")

Failing test case input:
{pfbl{szns

Expected output:
NO


Actual output:
No


Fixed submission (verdict: Accepted):
S = str(input())
for i in range(8):
    word = S[:i]+S[-7:][i:]
    if word == "keyence":
        print("YES")
        exit()
print("NO")

Problem: p03150
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
S = list(input())
Ans_list=['k','e','y','e','n','c','e']
Ans = 0
for i in range(len(S)):
    for j in range(i,len(S),+1):
        
        if (S[:i:]+S[j::]) == Ans_list:
           Ans = 1
           print(Ans)
           sys.exit()
print(Ans)

Failing test case input:
eedoirjeygcm

Expected output:
NO


Actual output:
0


Fixed submission (verdict: Accepted):
import sys
S = list(input())
Ans_list=['k','e','y','e','n','c','e']
Ans = 'NO'
for i in range(len(S)):
    for j in range(i,len(S),+1):
        
        if (S[:i:]+S[j::]) == Ans_list:
           Ans = 'YES'
           print(Ans)
           sys.exit()
print(Ans)
Problem: p03150
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S=input()
key='keyence'
ans='NO'
for i in range(len(key)):
    key1=key[:i]
    key2=key[i:]
    A=key1+'0'*(len(S)-len(key))+key2
    for l in range(len(S)):
        if all([S[l]==A[l] or A[l]=='0' for l in range(len(S))]):
            ans='YES'
            print(A)
print(ans)

Failing test case input:
keyence

Expected output:
YES

Actual output:
keyence
keyence
keyence
keyence
keyence
keyence
keyence
keyence
keyence
keyence
keyence
keyence
keyence
keyence
keyence
keyence
keyence
keyence
keyence
keyence
keyence
keyence
keyence
keyence
keyence
keyence
keyence
keyence
keyence
keyence
keyence
keyence
keyence
keyence
keyence
keyence
keyence
keyence
keyence
keyence
keyence
keyence
keyence
keyence
keyence
keyence
keyence
keyence
keyence
YES


Fixed submission (verdict: Accepted):
S=input()
key='keyence'
ans='NO'
for i in range(len(key)):
    key1=key[:i]
    key2=key[i:]
    A=key1+'0'*(len(S)-len(key))+key2
    if all([S[l]==A[l] or A[l]=='0' for l in range(len(S))]):
        ans='YES'
print(ans)

Problem: p03150
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
def input(): return sys.stdin.readline().rstrip()
def main():
    s=input()
    ke="keyence"
    cunt=0
    if len(s)>8:
        print("NO")
        sys.exit()
    for i in range(len(s)):
        if s[i]==ke[cunt]:
            cunt+=1
            if cunt==7:
                print("YES")
                break
    else:print("NO")

if __name__=='__main__':
    main()

Failing test case input:
keyofscience

Expected output:
YES

Actual output:
NO


Fixed submission (verdict: Accepted):
import sys
def input(): return sys.stdin.readline().rstrip()
def main():
    s=input()
    n=len(s)
    target="keyence"
    if s==target:
        print("YES")
        sys.exit()
    for i in range(n):
        for j in range(n):
            for k in range(i,j+1):
                
                s_exp=s[:i]+s[j+1:]
                if s_exp==target:
                    print("YES")
                    sys.exit()
    print("NO")



if __name__=='__main__':
    main()

Problem: p03150
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
target = "keyence"
for i in range(len(target) + 1):
    if target == s[:i] + s[len(s) - len(target) + i:]:
        print("YES")
        break
    else:
        print("NO")

Failing test case input:
ahfykhra

Expected output:
NO


Actual output:
NO
NO
NO
NO
NO
NO
NO
NO


Fixed submission (verdict: Accepted):
s = input()
target = "keyence"
ans = "NO"
for i in range(len(target) + 1):
    if target == s[:i] + s[len(s) - len(target) + i:]:
        ans = "YES"
        break
print(ans)
Problem: p03150
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = str(input())
n = len(s)
if s == "keyence":
 print("YES")
 exit()
else:
 for I in range(8):
  t = s[0:I]+s[I+n-7:n]
  print(t)
  if t == "keyence":
   print("YES")
   exit()
print("NO")

Failing test case input:
mnyszsb{pf

Expected output:
NO


Actual output:
szsb{pf
mzsb{pf
mnsb{pf
mnyb{pf
mnys{pf
mnyszpf
mnyszsf
mnyszsb
NO


Fixed submission (verdict: Accepted):
s = str(input())
n = len(s)
if s == "keyence":
 print("YES")
 exit()
else:
 for I in range(8):
  t = s[0:I]+s[I+n-7:n]
  if t == "keyence":
   print("YES")
   exit()
print("NO")

Problem: p03150
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
target = input()
search_string = 'keyence'
split_index = 8
while 0 < split_index:
    split_index -= 1
    head = search_string[0:split_index]
    tail = search_string[split_index:]
    find_index = target.find(head)
    rfind_index = target.rfind(tail)
    
    
    if head == '' and rfind_index != -1:
        print('YES')
        exit()
    if tail == '' and find_index != 1:
        print('YES')
        exit()
    if find_index == -1 or rfind_index == -1:
        continue
    if (find_index + len(head)) <= rfind_index:
        print('YES')
        exit()
print('NO')

Failing test case input:
{pfbl{szns

Expected output:
NO


Actual output:
YES


Fixed submission (verdict: Accepted):
import sys

target = input()
search_string = 'keyence'

if target.find(search_string) != -1:
    print('YES')
    sys.exit()

split_index = 7
while 0 < split_index:
    split_index -= 1
    head = search_string[0:split_index]
    tail = search_string[split_index:]
    find_index = target.find(head)
    rfind_index = target.rfind(tail)
    rfind_tail_index = rfind_index + len(tail)
    
    
    if find_index == -1 or rfind_index == -1:
        continue
    if (find_index + len(head)) > rfind_index:
        continue
    if find_index == 0 and rfind_tail_index == len(target):
        print('YES')
        sys.exit()
print('NO')

Problem: p03150
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import re

S = input()
pattern = r"(.+keyence|k.+eyence|ke.+yence|key.+ence|keye.+nce|keyen.+ce|keyenc.+e|keyence.+)"
if re.fullmatch(pattern, S):
    print("YES")
else:
    print("NO")


Failing test case input:
keyence

Expected output:
YES

Actual output:
NO


Fixed submission (verdict: Accepted):
import re

S = input()
pattern = r"(.*keyence|k.*eyence|ke.*yence|key.*ence|keye.*nce|keyen.*ce|keyenc.*e|keyence.*)"
if re.fullmatch(pattern, S) is None:
    print("NO")
else:
    print("YES")

Problem: p03150
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
Ss = input()

for i in range(8):
    print(i, Ss[:i] + Ss[-7+i:])
    if Ss[:i] + Ss[-7+i:] == 'keyence':
        print('YES')
        break
else:
    print('NO')


Failing test case input:
{pfbn{szls

Expected output:
NO


Actual output:
0 bn{szls
1 {n{szls
2 {p{szls
3 {pfszls
4 {pfbzls
5 {pfbnls
6 {pfbn{s
7 {pfbn{s{pfbn{szls
NO


Fixed submission (verdict: Accepted):
Ss = input()

for i in range(8):
    if Ss[:i] + Ss[-7+i:] == 'keyence':
        print('YES')
        break
else:
    print('NO')
Problem: p03150
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S=input()
if S=='keyence':
    print('YES')
else:
    pass
if S[:6]=='keyence' or S[-7:-1]=='keyence':
    print('YES')
else:
    pass
if S[0]=='k':
    if S[-6:-1]=='eyence':
        print('YES')
    else:
        pass
if S[:1]=='ke':
    if S[-5:-1]=='yence':
        print('YES')
    else:
        pass
if S[:2]=='key':
    if S[-4:-1]=='ence':
        print('YES')
    else:
        pass
if S[:3]=='keye':
    if S[-3:-1]=='nce':
        print('YES')
    else:
        pass
if S[:4]=='keyen':
    if S[-2:-1]=='ce':
        print('YES')
    else:
        pass
if S[:5]=='keyen':
    if S[-1]=='e':
        print('YES')
    else:
        pass


Failing test case input:
snzs{mbfp{

Expected output:
NO


Actual output:

Fixed submission (verdict: Accepted):
S=input()
if S=='keyence' or S[0:7]=='keyence' or S[-7:]=='keyence':
    print('YES')
    exit()
else:
    pass

if S[0]=='k':
    if S[-6:]=='eyence':
        print('YES')
        exit()
    else:
        pass
if S[:2]=='ke':
    if S[-5:]=='yence':
        print('YES')
        exit()
    else:
        pass
if S[:3]=='key':
    if S[-4:]=='ence':
        print('YES')
        exit()
    else:
        pass
if S[:4]=='keye':
    if S[-3:]=='nce':
        print('YES')
        exit()
    else:
        pass
if S[:5]=='keyen':
    if S[-2:]=='ce':
        print('YES')
        exit()
    else:
        pass
if S[:6]=='keyenc':
    if S[-1]=='e':
        print('YES')
        exit()
    else:
        pass
print('NO')

Problem: p03150
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import itertools

S = list(input())
KEY = list('keyence')
LK = len(KEY)
L = len(S)
ok = False
for s,t in itertools.combinations(range(L),2):
  idx = 0
  sub_S = S[0:s] + S[t:]
  if sub_S == KEY:
    ok = True
    
if ok:
  print('YES')
else:
  print('NO')

Failing test case input:
keyence

Expected output:
YES

Actual output:
NO


Fixed submission (verdict: Accepted):
import itertools

S = list(input())
KEY = list('keyence')
LK = len(KEY)
L = len(S)
ok = False
for s,t in itertools.combinations(range(L),2):
  idx = 0
  sub_S = S[0:s] + S[t:]
  if sub_S == KEY:
    ok = True
    
if ok or S == KEY:
  print('YES')
else:
  print('NO')

Problem: p03150
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
S = input()
K = "keyence"
for i in range(len(K)):
  print(S[:i], S[(i-(len(K))):])
  if (K[:i] == S[:i]) and (K[(i-(len(K))):] == S[(i-(len(K))):]):
    print("Yes")
    exit()
if K == S[:len(K)] or K == S[(-len(K)):]:
  print("Yes")
  exit()
print("No")

Failing test case input:
eeeofscjymci

Expected output:
NO


Actual output:
 scjymci
e cjymci
ee jymci
eee ymci
eeeo mci
eeeof ci
eeeofs i
No


Fixed submission (verdict: Accepted):
S = input()
K = "keyence"
for i in range(len(K)):
  if (K[:i] == S[:i]) and (K[(i-(len(K))):] == S[(i-(len(K))):]):
    print("YES")
    exit()
if K == S[:len(K)] or K == S[(-len(K)):]:
  print("YES")
  exit()
print("NO")
Problem: p03150
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys, re
input = sys.stdin.readline

S = input()

if S == 'keyence' or re.fullmatch(r'[a-z]+keyence', S) or re.match(r'k[a-z]+eyence', S) or re.match(r'ke[a-z]+yence', S) or re.match(r'key[a-z]+ence', S) or re.match(r'keye[a-z]+nce', S) or re.match(r'keyen[a-z]+ce', S) or re.match(r'keyenc[a-z]+e', S) or re.fullmatch(r'keyence[a-z]+', S):
  print('YES')
else:
  print('NO')

Failing test case input:
keyence

Expected output:
YES

Actual output:
NO


Fixed submission (verdict: Accepted):
import re

S = input()

if S == 'keyence' or re.fullmatch(r'[a-z]+keyence', S) or re.fullmatch(r'k[a-z]+eyence', S) or re.fullmatch(r'ke[a-z]+yence', S) or re.fullmatch(r'key[a-z]+ence', S) or re.fullmatch(r'keye[a-z]+nce', S) or re.fullmatch(r'keyen[a-z]+ce', S) or re.fullmatch(r'keyenc[a-z]+e', S) or re.fullmatch(r'keyence[a-z]+', S):
  print('YES')
else:
  print('NO')

Problem: p03150
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=str(input())
f=False
for i in range(len(s)-1):
  for j in range(i+1,len(s)+1):
    if s[:i]+s[j:]=="keyence":
      f=True
      break
print("YES" if f==True else "NO")

Failing test case input:
keyence

Expected output:
YES

Actual output:
NO


Fixed submission (verdict: Accepted):
s=str(input())
if s=="keyence":
  print("YES")
  exit()
f=False
for i in range(len(s)-1):
  for j in range(i+1,len(s)):
    if s[:i]+s[j:]=="keyence":
      f=True
      break
print("YES" if f==True else "NO")

Problem: p03150
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=input()
word='keyence'
flag=0
if s[:6]==word:
    flag=1
if s[-7:]==word:
    flag=1
for i in range(7):
    if s[:i]+s[-(6-i):]==word:
        flag=1
print('YES' if flag else 'NO')

Failing test case input:
keyofscience

Expected output:
YES

Actual output:
NO


Fixed submission (verdict: Accepted):
s=input()
word='keyence'
flag=0
if s[:6]==word:
    flag=1
if s[-7:]==word:
    flag=1
for i in range(7):
    if s[:i]+s[-(7-i):]==word:
        flag=1
print('YES' if flag else 'NO')

Problem: p03150
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
s=input()
n=len(s)
if s[0]!='k':
  if s[n-8:n]=='keyence':
    print('YES')
  else:
    print('NO')
elif s[n-1]!='e':
  if s[0:8]=='keyence':
    print('YES')
  else:
    print('NO')
elif s[0]=='k' and s[n-1]=='e':
  for i in range(1,7):
    if s[:i]+s[n-7+i:n]=='keyence':
      print('YES')
      exit()
print('NO')

Failing test case input:
mcjydjsfodee

Expected output:
NO


Actual output:
NO
NO


Fixed submission (verdict: Accepted):
s=input()
res='keyence'
n=len(s)
if s[0]!='k':
  if s[n-7:n]=='keyence':
    print('YES')
  else:
    print('NO')
elif s[n-1]!='e':
  if s[:7]=='keyence':
    print('YES')
  else:
    print('NO')
elif s[0]=='k' and s[n-1]=='e':
  lb=1
  while lb<6:
    if s[lb]==res[lb]:
      lb+=1
    else:
      break
  ub=1
  while ub<7-lb:
    if s[n-ub-1]==res[6-ub]:
      ub+=1
    else:
      break
  if ub+lb==7:
    print('YES')
  else:
    print('NO')
Problem: p03150
Buggy submission (Python (3.4.3), verdict: Wrong Answer):


import re

S = input()

if "keyence" == S:
    print("YES")
else:
    patterns = ["^keyence", "^k*eyence$", "^ke*yence$", "^key*ence$", "^keye*nce$", "^keyen*ce$", "^keyenc*e$", "keyence$"]

    matched = False
    for pattern in patterns:
        matchOB = re.search(pattern, S)
        if matchOB:
            matched = True
            break
    if matched:
        print("YES")
    else:
        print("NO")




Failing test case input:
keyofscience

Expected output:
YES

Actual output:
NO


Fixed submission (verdict: Accepted):


import re

S = input()

if "keyence" == S:
    print("YES")
else:
    patterns = ["^keyence(.*)", "^k(.*)eyence$", "^ke(.*)yence$", "^key(.*)ence$", "^keye(.*)nce$", "^keyen(.*)ce$", "^keyenc(.*)e$", "keyence$"]

    matched = False
    for pattern in patterns:
        matchOB = re.search(pattern, S)
        if matchOB:
            matched = True
            break
    if matched:
        print("YES")
    else:
        print("NO")

Problem: p03150
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()

word = "keyence"

for i in range(len(word)):
    a = s.find(word[:i])
    b = s.rfind(word[i:])
    if(a == b or (a == 0 and b == len(s)-len(word[i:]))):
        print("YES")
        exit()

print("NO")

Failing test case input:
fbmzrhk`

Expected output:
NO


Actual output:
YES


Fixed submission (verdict: Accepted):
s = input()

word = "keyence"

for i in range(len(word)):
    a = s.find(word[:i])
    b = s.rfind(word[i:])
    if((a == 0 and b == 0) or (a == 0 and b == len(s)-len(word[i:]))):
        print("YES")
        exit()

print("NO")

Problem: p03150
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
s = str(input()); n = len(s)
kn = 7
if n < kn:
  print("NO")
for i in range(kn):
  temp = s[:i] + s[n-kn+i:]
  if temp == "keyence":
    print("YES")
    exit()
print("No")

Failing test case input:
arhkzfhb

Expected output:
NO


Actual output:
No


Fixed submission (verdict: Accepted):
s = str(input()); n = len(s)
kn = 7
if n < kn:
  print("NO")
  exit()
for i in range(kn):
  temp = s[:i] + s[n-kn+i:]
  if temp == "keyence":
    print("YES")
    exit()
print("NO")
Problem: p03150
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
S = input()

match = "keyence"
check = ""
revcheck = ""

flag = False

for x in range(len(S)):
    if x == len(match):
        break
    if match[x] == S[x]:
        check += S[x]
    else:
        flag = True
        break

if flag:
    remainFlag = False
    remain = S[x + 1:]
    revS = "".join(reversed(S))
    revMatch = "".join(reversed(remain))
    for y in range(len(revS)):
        
        if y == len(revMatch):
            remainFlag = True
            break
        if revMatch[y] == revS[y]:
            revcheck += revS[y]
        else:
            break
    if remainFlag:
        print("YES")
    else:
        print("NO")
elif check == match:
    print("YES")
else:
    print("NO")


Failing test case input:
bxf|n}spls

Expected output:
NO


Actual output:
YES


Fixed submission (verdict: Accepted):
S = input()

match = "keyence"
check = ""
revcheck = ""

flag = False

for x in range(len(S)):
    if x == len(match):
        break
    if match[x] == S[x]:
        check += S[x]
    else:
        flag = True
        break

if flag:
    remainFlag = False
    remain = match[x:]
    revS = "".join(reversed(S))
    revMatch = "".join(reversed(remain))
    for y in range(len(revS)):
        
        if y == len(revMatch):
            remainFlag = True
            break
        if revMatch[y] == revS[y]:
            revcheck += revS[y]
        else:
            break
    if remainFlag:
        print("YES")
    else:
        print("NO")
elif check == match:
    print("YES")
else:
    print("NO")

Problem: p03150
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
str1 = "keyence"
count = 0
for i in range(len(S)):
    for j in range(i,len(S)):
        new_str = S[:i] + S[j:]
        if new_str == str1:
            print("YES")
            count = 1
if(count != 1):
    print("NO")


Failing test case input:
keyence

Expected output:
YES

Actual output:
YES
YES
YES
YES
YES
YES
YES


Fixed submission (verdict: Accepted):
S = input()
str1 = "keyence"
count = 0

for i in range(8):
  if(i != 7):
   str2 = S[:i] + S[-(7-i):]
  else:
   str2 = S[:i]
  
  if(str2 == str1):
   print("YES")
   count = 1
   break 
if(count != 1):
    print("NO")

Problem: p03150
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()


x = "keyence"

if S[:7] == x:
    print("YES")
    exit()

for i in range(0,len(x)):
    print(S[:i]== x[:i] , S[-(7-i):] == x[i:])
    if S[:i]== x[:i] and S[-(7-i):] == x[i:] :
        print("YES")
        exit()
    
    
    
    
    
    
    
    
    
    
print("NO")

Failing test case input:
|xfbn}spls

Expected output:
NO


Actual output:
True False
False False
False False
False False
False False
False False
False False
NO


Fixed submission (verdict: Accepted):
S = input()


x = "keyence"

if S[:7] == x:
    print("YES")
    exit()

for i in range(0,len(x)):
    if S[:i]== x[:i] and S[-(7-i):] == x[i:] :
        print("YES")
        exit()
    
    
    
    
    
    
    
    
    
    
print("NO")
Problem: p03150
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()

if s.startswith('k') and s.startswith('eyence'):
  print('YES')
elif s.startswith('ke') and s.startswith('yence'):
  print('YES')
elif s.startswith('key') and s.startswith('ence'):
  print('YES')
elif s.startswith('keye') and s.startswith('nce'):
  print('YES')
elif s.startswith('keyen') and s.startswith('ce'):
  print('YES')
elif s.startswith('keyenc') and s.startswith('e'):
  print('YES')
else:
  print('NO')

Failing test case input:
keyofscience

Expected output:
YES

Actual output:
NO


Fixed submission (verdict: Accepted):
s = input()

if s.startswith('k') and s.endswith('eyence'):
  print('YES')
elif s.startswith('ke') and s.endswith('yence'):
  print('YES')
elif s.startswith('key') and s.endswith('ence'):
  print('YES')
elif s.startswith('keye') and s.endswith('nce'):
  print('YES')
elif s.startswith('keyen') and s.endswith('ce'):
  print('YES')
elif s.startswith('keyenc') and s.endswith('e'):
  print('YES')
else:
  print('NO')

Problem: p03150
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def resolve():
    s = input()
    key = "keyence"
    if key in s:
        print("YES")
        return 0
    for i in range(1, len(key)):
        k1, k2 = key[:i], key[i:]
        if s.find(k1) < s.find(k2):
            print("YES")
            return 0
    print("NO")
    return 0


if __name__ == "__main__":
    resolve()


Failing test case input:
mcjyejsgodee

Expected output:
NO


Actual output:
YES


Fixed submission (verdict: Accepted):
def resolve():
    s = input()
    ls = len(s)
    for i in range(ls):
        for j in range(i, ls):
            if s[:i] + s[j:] == "keyence":
                print("YES")
                return 0
    print("NO")
    return 0


if __name__ == "__main__":
    resolve()

Problem: p03150
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

s = input()
key = 'keyence'
key_r = 'ecneyek'
j = 0
for i in key:
    if s[j] == i:
        j += 1
    else:
        break
k = 1
for i in key_r:
    if s[-k] == i:
        k += 1
    else:
        break

s = s[:j] + s[-k+1:]
if s == key:
    print('YES')
elif len(s) > 7:
    print('YES')
else:
    print('NO')

Failing test case input:
arhkzjbf

Expected output:
NO


Actual output:
YES


Fixed submission (verdict: Accepted):

s = input()
key = 'keyence'
key_r = 'ecneyek'
j = 0
for i in key:
    if s[j] == i:
        j += 1
    else:
        break
k = 1
for i in key_r:
    if s[-k] == i:
        k += 1
    else:
        break

s = s[:j] + s[-k+1:]
if j + k > 7:
    s = key
if s == key:
    print('YES')
else:
    print('NO')
Problem: p03150
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
S = input()
a = len(S)
count=0
for i in range(a):
  for j in range(i+1,a):
    XX= S[:i] +S[j:a]
    
    if XX == 'keyence':
      count +=1
if count == 0:
  print('NO')
else:
  print('YES')

Failing test case input:
keyence

Expected output:
YES

Actual output:
NO


Fixed submission (verdict: Accepted):
S = input()
a = len(S)
count=0
for i in range(a):
  for j in range(i,a):
    XX= S[:i] +S[j:a]
    
    if XX == 'keyence':
      count +=1
if count == 0:
  print('NO')
else:
  print('YES')

Problem: p03150
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S=input()
T="keyence"
ans=0
for i in range(8):
  X=1
  K=0
  for j in range(len(S)-i):
    if(j<i or j>i+len(S)-6):
      if(S[K]!=T[K]):
        X*=0
      K+=1
  ans+=X
if(ans):
  print("YES")
else:
  print("NO")

Failing test case input:
dcxemen

Expected output:
NO


Actual output:
YES


Fixed submission (verdict: Accepted):
S=input()
T="keyence"
X,Y=0,0
for i in range(7):
  if(S[i]==T[i]):
    X+=1;
  else:
    break
for i in range(7):
  if(S[len(S)-1-i]==T[6-i]):
    Y+=1;
  else:
    break
if(X+Y>=7):
  print("YES")
else:
  print("NO")

Problem: p03150
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = list(map(str,input()))

flg = 0

if ''.join(n) == 'keyence':
    print('Yes')
    flg = 1
else:
    for i in range(8):
        arr = list(''.join(n)) 
        del arr[i:i+len(n)-7]
        tmp = ''.join(arr)
        if tmp == 'keyence':
            print('YES')
            flg = 1
            break

if flg == 0:
    print('NO')


Failing test case input:
keyence

Expected output:
YES

Actual output:
Yes


Fixed submission (verdict: Accepted):
n = list(map(str,input()))

flg = 0

if ''.join(n) == 'keyence':
    print('YES')
    flg = 1
else:
    for i in range(8):
        arr = list(''.join(n)) 
        del arr[i:i+len(n)-7]
        tmp = ''.join(arr)
        if tmp == 'keyence':
            print('YES')
            flg = 1
            break

if flg == 0:
    print('NO')

Problem: p03150
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=input()
str1="keyence"
count=0
num=len(s)
if s==str1:
    yn=0
elif s[:7]==str1:
    yn=0
elif s[num-8:]==str1:
    yn=0
else:
    for i in range(7):
        if str1[i]==s[i]:
            count+=1
        else:
            break
    if s[(num-(count+1)):]==str1[6-count:]:
        yn=0
    else:
        yn=1
if yn==0:
    print("YES")
else:
    print("NO")


Failing test case input:
neyemce

Expected output:
NO


Actual output:
YES


Fixed submission (verdict: Accepted):
s=input()
str1="keyence"
count=0
num=len(s)
if s==str1:
    yn=0
elif s[:7]==str1:
    yn=0
elif s[num-8:]==str1:
    yn=0
else:
    for i in range(7):
        if str1[i]==s[i]:
            count+=1
        else:
            break
    if s[num-7+count:]==str1[count:]:
        yn=0
    else:
        yn=1
if yn==0:
    print("YES")
else:
    print("NO")
Problem: p03150
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
target_S = "keyence"
 
if S.startswith(target_S) or S.endswith(target_S):
    print("YES")
else:
    for i in range(len(target_S)):
        target_left = target_S[:i]
        target_right = target_S[i:]
        
        if S.startswith(target_left) and S.endswith(target_right):
            print("YES")
            break

Failing test case input:
eeeofsjdyjcm

Expected output:
NO


Actual output:

Fixed submission (verdict: Accepted):
S = input()
target_S = "keyence"
flg = 0
 
if S.startswith(target_S) or S.endswith(target_S):
    flg = 1
else:
    for i in range(len(target_S)):
        target_left = target_S[:i]
        target_right = target_S[i:]
        
        if S.startswith(target_left) and S.endswith(target_right):
            flg = 1

print("YES") if flg == 1 else print("NO")

Problem: p03150
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
for i in range(7):
    if s[i] + s[-7 + i:] == "keyence":
        print("YES")
        exit()
print("NO")

Failing test case input:
keyence

Expected output:
YES

Actual output:
NO


Fixed submission (verdict: Accepted):
s = input()
for i in range(7):
    if s[:i] + s[-7 + i:] == "keyence":
        print("YES")
        exit()
print("NO")

Problem: p03150
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
for i in range(7):
    if S[:i] + S[-7+i] == 'keyence':
        print('YES')
        exit()
print('NO')

Failing test case input:
keyofscience

Expected output:
YES

Actual output:
NO


Fixed submission (verdict: Accepted):
S = input()
for i in range(7):
    if S[:i] + S[-7+i:] == 'keyence':
        print('YES')
        exit()
print('NO')

Problem: p03150
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
s=input()
ans='No'
for i in range(1,len(s)):
  for j in range(i,len(s)):
    if s[:i]+s[j:]=='keyence':
      ans='Yes'
      break
print(ans)

Failing test case input:
arhkzfha

Expected output:
NO


Actual output:
No


Fixed submission (verdict: Accepted):
s=input()
ans='NO'
for i in range(1,len(s)):
  for j in range(i,len(s)):
    if s[:i]+s[j:]=='keyence':
      ans='YES'
      break
print(ans)

Problem: p03150
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def m():
    S = input()
    a = 'keyence'
    x = 0
    flag = 0
    for i in S:
        if x >=6:
            break
        if i == a[x]:
            x += 1
            continue
        flag += 1
        if flag > 1:
            return 'NO'

    if x >=6:
        return 'YES'
    else:
        return 'NO'

print(m())

Failing test case input:
keyofscience

Expected output:
YES

Actual output:
NO


Fixed submission (verdict: Accepted):
def m():
    S = input()
    a = 'keyence'
    x = 0
    if S[0] == 'k':
        for i in range(len(S)):
            if S[i] == a[x]:
                x += 1
                continue
            else:
                break
        if S[-7+x:] == a[-7+x:]:
            return 'YES'
        else:
            return 'NO'


    else:
        if a == S[-7:]:
            return 'YES'
        else:
            return 'NO'



print(m())
Problem: p03150
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=input()
ans='keyence'
i=0 
index=0 
isCut=0
canRestart=0
restart=0
lenS=len(s)
while i<lenS:
    
    if isCut==1: 
        if index>6: 
            if canRestart:
                canRestart=0
                isCut=-1
                i=restartI
                index=restartIndex-1
            else:
                break
        if s[i]==ans[index]:
            index+=1
        else:
            if canRestart:
                canRestart=0
                isCut=-1
                i=restartI
                index=restartIndex-1
            else:
                break
    elif isCut==-1: 
        if s[i]==ans[index]:
            
            restartIndex=index
            restartI=i
            canRestart=1
            isCut=1
            index+=1
    else: 
        if s[i]==ans[index]:
            index+=1
        else:
            isCut=-1
    i+=1
    
if index<=6|i<lenS|isCut==-1: 
    print('NO')
else:
    print('YES')


Failing test case input:
dcxenfn

Expected output:
NO


Actual output:
YES


Fixed submission (verdict: Accepted):
s=input()
ans='keyence'
i=0 
index=0 
isCut=0
canRestart=0
restart=0
lenS=len(s)
while i<lenS:
    
    if isCut==1: 
        if index>6: 
            if canRestart:
                canRestart=0
                isCut=-1
                i=restartI
                index=restartIndex
            else:
                break
        else:
            if s[i]==ans[index]:
                index+=1
            else:
                if canRestart:
                    canRestart=0
                    isCut=-1
                    i=restartI
                    index=restartIndex
                else:
                    break
    elif isCut==-1: 
        if s[i]==ans[index]:
            
            restartIndex=index
            restartI=i
            canRestart=1
            isCut=1
            index+=1
    else: 
        if s[i]==ans[index]:
            index+=1
        else:
            isCut=-1
    i+=1
    
if (index<=6)|(i<lenS)|(isCut==-1): 
    print('NO')
else:
    print('YES')

Problem: p03150
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
search="keyence"
idx=0
flg = False
ans="NO"
for c in s:
    if c == search[idx]:
        idx += 1
    if idx >= 7:
        flg=True
        break
if flg:
    idx = -1
    for i in range(7):
        x=s.find(search[0:i])
        
        if s[x+i+1:].find(search[i+1:]):
            ans = "YES"
            break
    print(ans)
else:
    print(ans)

Failing test case input:
keyence

Expected output:
YES

Actual output:
NO


Fixed submission (verdict: Accepted):
s = input()
search="keyence"
idx=0
flg = False
ans="NO"
n = len(s)
if s[0:7] == search:
    print("YES")
elif (s[-7:] == search):
    print("YES")
else:
    for i in range(7):
        if s[0:i+1] == search[0:i+1]:
            
            
            if (s[(-7+i+1):] == search[i+1:]):
                ans = "YES"
                break
    print(ans)
Problem: p03150
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
input = sys.stdin.readline


def is_keyence_string():
	for i in range(1, len(key)):
		left = key[:i]
		right = key[i-len(key):]
		
		if S.startswith(left) and S.endswith(right):
			return True
	
	return False


S = input()
key = 'keyence'

if S.startswith(key):
	print('YES')
elif S.endswith(key):
	print('YES')
else:
	if is_keyence_string():
		print('YES')
	else:
		print('NO')


Failing test case input:
keyofscience

Expected output:
YES

Actual output:
NO


Fixed submission (verdict: Accepted):

def is_keyence_string():
	for i in range(1, len(key)):
		left = key[:i]
		right = key[i-len(key):]
		
		if S.startswith(left) and S.endswith(right):
			return True
	
	return False


S = input().strip()
key = 'keyence'

if S.startswith(key):
	print('YES')
elif S.endswith(key):
	print('YES')
elif is_keyence_string():
	print('YES')
else:
	print('NO')

Problem: p03150
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S=input()
if S=='keyence':
    print('YES')
else:
    pass
if S[:6]=='keyence' or S[-7:-1]=='keyence':
    print('YES')
else:
    pass
if S[0]=='k':
    if S[-6:-1]=='eyence':
        print('YES')
    else:
        pass
if S[:1]=='ke':
    if S[-5:-1]=='yence':
        print('YES')
    else:
        pass
if S[:2]=='key':
    if S[-4:-1]=='ence':
        print('YES')
    else:
        pass
if S[:3]=='keye':
    if S[-3:-1]=='nce':
        print('YES')
    else:
        pass
if S[:4]=='keyen':
    if S[-2:-1]=='ce':
        print('YES')
    else:
        pass
if S[:5]=='keyen':
    if S[-1]=='e':
        print('YES')
    else:
        pass
print('NO')

Failing test case input:
keyofscience

Expected output:
YES

Actual output:
NO


Fixed submission (verdict: Accepted):
S=input()
if S=='keyence' or S[0:7]=='keyence' or S[-7:]=='keyence':
    print('YES')
    exit()
else:
    pass

if S[0]=='k':
    if S[-6:]=='eyence':
        print('YES')
        exit()
    else:
        pass
if S[:2]=='ke':
    if S[-5:]=='yence':
        print('YES')
        exit()
    else:
        pass
if S[:3]=='key':
    if S[-4:]=='ence':
        print('YES')
        exit()
    else:
        pass
if S[:4]=='keye':
    if S[-3:]=='nce':
        print('YES')
        exit()
    else:
        pass
if S[:5]=='keyen':
    if S[-2:]=='ce':
        print('YES')
        exit()
    else:
        pass
if S[:6]=='keyenc':
    if S[-1]=='e':
        print('YES')
        exit()
    else:
        pass
print('NO')
Problem: p03150
Buggy submission (Python (3.8.2), verdict: Wrong Answer):

KEY = "keyence"

def main():
    s = input()

    if s.startswith(KEY) or s.endswith(KEY):
        print("YES")
        return

    for i in range(1, len(KEY)):
        st = KEY[0:i]
        ed = KEY[i:]

        if s.startswith(st) and s.endswith(ed):
            print("YES")
            return

    print("No")

main()


Failing test case input:
bxf|n}spls

Expected output:
NO


Actual output:
No


Fixed submission (verdict: Accepted):

KEY = "keyence"

def main():
    s = input()

    if s.startswith(KEY) or s.endswith(KEY):
        print("YES")
        return

    for i in range(1, len(KEY)):
        st = KEY[0:i]
        ed = KEY[i:]

        if s.startswith(st) and s.endswith(ed):
            print("YES")
            return

    print("NO")

main()

Problem: p03150
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
check = 'keyence'

if s[0] != 'k' and s[-1] != 'e':
    print('NO')
else:
    if s[:7] == check or s[-7:] == check:
        print('YES')
    else:
        for i in range(1, 7):
            if s[:i] + s[-(7 - i):] == check:
                print('YES')
                exit()
            
    print('NO')


Failing test case input:
keyence

Expected output:
YES

Actual output:
YES
NO


Fixed submission (verdict: Accepted):
s = input()
check = 'keyence'

if s[0] != 'k' and s[-1] != 'e':
    print('NO')
else:
    if s[:7] == check or s[-7:] == check:
        print('YES')
        exit()
    else:
        for i in range(1, 7):
            if s[:i] + s[-(7 - i):] == check:
                print('YES')
                exit()
                
    print('NO')

Problem: p03150
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
s=input()
n=len(s)
if s[0]!='k':
  if s[n-7:n]=='keyence':
    print('YES')
  else:
    print('NO')
elif s[n-1]!='e':
  if s[0:8]=='keyence':
    print('YES')
  else:
    print('NO')
elif s[0]=='k' and s[n-1]=='e':
  for i in range(1,7):
    if s[:i]+s[n-7+i:n]=='keyence':
      print('YES')
      exit()
print('NO')

Failing test case input:
mkfrazch

Expected output:
NO


Actual output:
NO
NO


Fixed submission (verdict: Accepted):
s=input()
res='keyence'
n=len(s)
if s[0]!='k':
  if s[n-7:n]=='keyence':
    print('YES')
  else:
    print('NO')
elif s[n-1]!='e':
  if s[:7]=='keyence':
    print('YES')
  else:
    print('NO')
elif s[0]=='k' and s[n-1]=='e':
  lb=1
  while lb<6:
    if s[lb]==res[lb]:
      lb+=1
    else:
      break
  ub=1
  while ub<7-lb:
    if s[n-ub-1]==res[6-ub]:
      ub+=1
    else:
      break
  if ub+lb==7:
    print('YES')
  else:
    print('NO')
Problem: p03150
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
s = input()
ans = "NO"
ls = len(s)
if s[:7] == "keyence":
    ans = "YES"
elif s[-7:] == "keyence":
    ans = "YES"
else:
    for i in range(6):
        print(s[:i+1],s[ls-6+i:])
        if s[:i+1]+s[ls-6+i:] == "keyence":
            ans = "YES"
print(ans)

Failing test case input:
arhkzfha

Expected output:
NO


Actual output:
a hkzfha
ar kzfha
arh zfha
arhk fha
arhkz ha
arhkzf a
NO


Fixed submission (verdict: Accepted):
s = input()
ans = "NO"
ls = len(s)
if s[:7] == "keyence":
    ans = "YES"
elif s[-7:] == "keyence":
    ans = "YES"
else:
    for i in range(6):

        if s[:i+1]+s[ls-6+i:] == "keyence":
            ans = "YES"
print(ans)

Problem: p03150
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
for i in range(len(s)):
    for j in range(i, len(s)):
        if s[:i] + s[j:] == 'keyence':
            print('Yes')
            exit()
print('No')

Failing test case input:
ahfykhra

Expected output:
NO


Actual output:
No


Fixed submission (verdict: Accepted):
s = input()
for i in range(len(s)):
    for j in range(i, len(s)):
        if s[:i] + s[j:] == 'keyence':
            print('YES')
            exit()
print('NO')

Problem: p03150
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S=input()
l=len(S)
a=0
for i in range(l):
  for j in range(i,l):
    print(S[:i]+S[j:])
    if S[:i]+S[j:]=="keyence":
      a=1
      break
  if a==1:
    break
print(["NO","YES"][a])

Failing test case input:
dcxenfn

Expected output:
NO


Actual output:
dcxenfn
cxenfn
xenfn
enfn
nfn
fn
n
dcxenfn
dxenfn
denfn
dnfn
dfn
dn
dcxenfn
dcenfn
dcnfn
dcfn
dcn
dcxenfn
dcxnfn
dcxfn
dcxn
dcxenfn
dcxefn
dcxen
dcxenfn
dcxenn
dcxenfn
NO


Fixed submission (verdict: Accepted):
S=input()
l=len(S)
a=0
for i in range(l):
  for j in range(i,l):
    if S[:i]+S[j:]=="keyence":
      a=1
      break
  if a==1:
    break
print(["NO","YES"][a])

Problem: p03150
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import re
s = input()
k = 'keyence'
ans = 'NO'
for i in range(len(k)):
    a = '^'+k[:i]+'.*?'+k[i:]+'$'
    print(a)
    if re.match(a,s):
        ans = 'YES'
print(ans)


Failing test case input:
arhkzfha

Expected output:
NO


Actual output:
^.*?keyence$
^k.*?eyence$
^ke.*?yence$
^key.*?ence$
^keye.*?nce$
^keyen.*?ce$
^keyenc.*?e$
NO


Fixed submission (verdict: Accepted):
import re
s = input()
k = 'keyence'
ans = 'NO'
for i in range(len(k)):
    a = '^'+k[:i]+'.*?'+k[i:]+'$'
    if re.match(a,s):
        ans = 'YES'
print(ans)