Woburn Challenge 2018-19 Round 1 - Junior Division

Problem 2: Making the Cut

The computer science club at H.S. High School has just posted a special list of five student names. These students have qualified to represent the school at an upcoming programming competition, hosted by Ontario's Organization for Computing Education (OOCE)! The i-th name on this team roster is Si, a non-empty string consisting of at most 20 lowercase letters ("a".."z"), and all five names are distinct.

A certain student is looking at this team roster, and wants to see whether or not they made the cut and will get to compete. This student's name is N, which is similarly a non-empty string consisting of at most 20 lowercase letters. Unfortunately, though their programming skills are strong, their reading skills aren't so strong, so they're having trouble looking for their name on the list. Help them determine whether or not any of the five names S1..5 on the team rosters are equal to their own name N. Output "Y" (without quotes) if their name is present, or "N" if it isn't.

Input Format

The first line of input consists of a single string, N.
Five lines follow, the i-th of which consists of a single string, Si, for i = 1..5.

Output Format

Output a single character, either "Y" if any of the five names on the team roster are equal to N, or "N" otherwise.

Sample Input 1

bob
alice
bob
christine
david
erika

Sample Output 1

Y

Sample Input 2

alice
frank
georgia
hans
ilia
james

Sample Output 2

N

Sample Explanation

In the first case, "bob" is the second of the five names on the team roster.

In the second case, "alice" is not present on the team roster.

All Submissions
Best Solutions


Point Value: 3 (partial)
Time Limit: 2.00s
Memory Limit: 16M
Added: Nov 17, 2018
Author: SourSpinach

Languages Allowed:
C++03, PAS, C, HASK, ASM, RUBY, PYTH2, JAVA, PHP, SCM, CAML, PERL, C#, C++11, PYTH3

Comments (Search)

It's quiet in here...