A higher resolution is required to access the IDE
- 151
Learning Opportunities
This puzzle can be solved using the following concepts. Practice using these concepts and improve your skills.
Statement
Goal
You are a professional Among Us gamer, however, you don't know who the impostor is! Luckily, you're hacking, so you know the exact path each crewmate took before the EMERGENCY MEETING. You notice that certain crewmates are acting SUSSY - they are moving much faster than they should! You know that there are vents connecting all of the rooms, so there is only 1 possible explanation. Your task is to figure out who isThe rooms are labelled arranged in cyclic fashion. For example, for a room layout
For each crewmate, you will receive a string of length K. This string is ordered so that the first character represents the position of the crewmate at the first minute, and so on.
Sometimes, the hacks you're using may freeze (because of the bloatware you installed with it), so you will be missing some data. In this case, the character you will be given will be
For example, assuming the room layout
For input
For input
For input
Input
Line 1: An integer L representing the length of the room layout.
Line 2: A string F representing the room layout, consisting of L characters.
Line 3: 2 space separated integers, N and K, representing the number of crewmates and the duration of their path recordings in minutes.
Next N lines: A string crewmate representing the path taken by a crewmate. The string consists of K characters, each of which is either an uppercase letter or a number sign (# ).
Line 2: A string F representing the room layout, consisting of L characters.
Line 3: 2 space separated integers, N and K, representing the number of crewmates and the duration of their path recordings in minutes.
Next N lines: A string crewmate representing the path taken by a crewmate. The string consists of K characters, each of which is either an uppercase letter or a number sign (
Output
N lines: A string corresponding to each crewmate in the same order as input: SUS if the crewmate is suspicious, or NOT SUS otherwise.
Constraints
6 ≤ L ≤ 26
5 ≤ N ≤ 40
2 ≤ K ≤ 50
All characters in F are uppercase and unique.
It is guaranteed that the letters in crewmate are present in F.
5 ≤ N ≤ 40
2 ≤ K ≤ 50
All characters in F are uppercase and unique.
It is guaranteed that the letters in crewmate are present in F.
Example
Input
6 ABCDEF 5 3 ABC AFE CDC DBC AAA
Output
NOT SUS NOT SUS NOT SUS SUS NOT SUS
A higher resolution is required to access the IDE