All submissions for this problem are available.
The mess authority of Hall 1, NIT Durgapur has decided to select a student representative. A special game is organized to select one from all the students. Everyone is sitting in the common room of Hall 1. The order in which the students will play is based on their respective CGPA.
First student based on the priority sits on the HOT seat with his back towards a projector displaying N strings sorted lexicographically and containing names of items related to the game of cricket. Countdown starts and the participant randomly announces a string. If the string is in the list, he wins. Otherwise game continues with other students.
You are given N number of strings and a string announced by Ravi. You need to answer whether Ravi won or not.
NOTE: every string contains only lowercase letters.
The first line of the input contains an integer T denoting the number of test cases. The description of T test cases follows. First line of each test case has integer N denoting the number of strings. Next N lines of each test case have N lexicographically sorted strings. Last line of each test case contains a string announced by Ravi. Length of each string won’t exceed 100.
For each test case, output only line containing “yes” if Ravi wins or “no” if he doesn’t.
- 1 ≤ T ≤ 1000
- 1 ≤ N ≤ 1000
Input: 1 2 pitch yorker virat Output: no
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, SCALA, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, PERL6, TEXT, SCM chicken, CLOJ, FS|
Fetching successful submissions