No.2862 NOT FOUND 404
タグ : / 解いたユーザー数 179
作問者 :
寝癖
👑 Story
Yu-san hates it when 404 is Not Found. In other words, Yu-san hates digit strings in which 404 cannot be found.
Surely, some of the people about to tackle this problem feel the same way.
Your job is to write, for such people, code that determines whether a given digit string is one where "404 is Not Found".
Problem Statement
You are given a digit string $S$ of length $N$.
Determine whether $S$ satisfies the following condition.
No contiguous substring of $3$ characters in $S$ is 404
Print NotFound if the condition is satisfied, and Found otherwise.
(Note that NotFound must not contain a space, as in Not Found.)
Input
$N$ $S$
Constraints
- $3\leq N \leq 100$
- $S$ is a digit string of length $N$
Output
Print the answer on a single line, followed by a newline.
Sample
Sample 1
Input
10 1843404261
Output
Found
The characters from the $5$-th to the $7$-th are 404.
Sample 2
Input
11 45616572034
Output
NotFound
There is no contiguous substring equal to 404.
Sample 3
Input
10 0404404404
Output
Found
There may be multiple contiguous substrings equal to 404. Also, the digit string may start with 0.
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。