DMOPC '20 Contest 1 P1 - Victor Gets Quizzed

View as PDF

Submit solution

Points: 3
Time limit: 1.0s
Memory limit: 256M

Problem type
Allowed languages
Ada, Assembly, Awk, Brain****, C, C#, C++, COBOL, CommonLisp, D, Dart, F#, Forth, Fortran, Go, Groovy, Haskell, Intercal, Java, JS, Kotlin, Lisp, Lua, Nim, ObjC, OCaml, Octave, Pascal, Perl, PHP, Pike, Prolog, Python, Racket, Ruby, Rust, Scala, Scheme, Sed, Swift, TCL, Text, Turing, VB, Zig

I actually [expletive] failed a quiz I knew all the answers to ~ Victor, 2019

Victor is being quizzed on an array of different subjects! However, Victor has a fatal flaw: he does poorly on quizzes on the subjects he knows well.
Given that Victor excels at math and computer science, help him determine if he will fail these quizzes!

Input Specifications

The first line will contain N (N \leq 10), the number of quizzes that Victor must write. The subjects present on the ith quiz are given as a string of distinct uppercase English letters S_i, with |S_i| \leq 5. The ith quiz will have math on it if the character M is in S_i and it will have computer science on it if the character C is in S_i.

Output Specifications

For each quiz, you must output one of three possible outcomes on a new line:

  • PASS if the quiz contains neither math nor computer science.
  • FAIL if the quiz contains one of math or computer science.
  • NEGATIVE MARKS if the quiz contains both math and computer sciencce.

Sample Input


Sample Output


Explanation of Sample Input

The first quiz contains both M and C, so the answer is NEGATIVE MARKS. Quiz 2 contains C but not M, and quiz 4 contains M but not C so the answer to both is FAIL. Quiz 3 contains neither M nor C so the answer is PASS.


There are no comments at the moment.