0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

はじめに

前回
今日は一問だけです。

#54

問題

考えたこと
文字列の操作に関する問題は苦手なので、この問題にしました。前に一度解いたのですが、逃げていたので解きます。
$S$の長さが十分に小さいので、切り分ける点を全探索します。一つの点でのみ、切り分けることに注意。

s = input()

flag = False
n = len(s)
for i in range(n):
    for j in range(i,n):
        if 'keyence' == s[:i] +s[j:]:
            flag = True

if flag:
    print('YES')
else:
    print('NO')

まとめ

今日のABCで茶色になりたい。今日のABCがんばりましょう! ではまた。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?