Ուղարկել | Բոլոր լուծումները | Լավագույն լուծումները | Վերադառնալ ցուցակին |
ACM_0120 - CHROMOSOME |
At a biomedical research center, the technician must examine a string of chromosome to see if it matches a particular pattern. Each string consists of any uppercase alphabet (i.e., A, B, C, …, Z). Currently, the technician must find if the string exactly matches the following rules:
- Starting with zero or exactly one alphabet from {A, B, C, D, E, F}
- Following by at least one or more of alphabet A
- Following by at least one or more alphabet F
- Following by at least one or more alphabet C
- Following by zero or exactly one alphabet from {A, B, C, D, E, F}
You job is to write a program that performs this check
Input
First line of input is a number of test cases T ≤ 20,
Each test case is a line contains only uppercase alphabet without any white-space and at most 200 alphabets.
Output
For each test case, display "Infected!" in one line if that string matches the pattern described above. Otherwise, output "Good" in one line.
Note: Do not output the ‘ " ’ symbol. It is used for clarification purpose.
Examples
№ |
stdin |
stdout |
1 |
15 AFC AAFC AAAFFCC BAFC QWEDFGHJMNB DFAFCB ABCDEFC DADC SDFGHJKLQWERTYU AAAAAAAAAAAAABBBBBBBBBBBBBBCCCCCCCCCCCCCCCCCCDDDDDDDDDDDEEEEEEEEEEEEEEEFFFFFFFFC AAAFFFFFBBBBCCCAAAFFFF ABCDEFAAAFFFCCCABCDEF AFCP AAFFCPP |
Infected! Infected! Infected! Infected! Infected! Good Good Good Good Good Good Good Good Good Good |
Ավելացրեց. | Հրանտ Հովհաննիսյան |
Ամսաթիվ. | 2014-02-02 |
Ժամանակի սահմանափակումը. | 1s |
Ծրագրի տեքստի սահմանափակումը. | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Լեզուներ. | Բոլորը բացի ASM32 ASM64 GAWK CLPS CLOJURE D ERL FSHARP FORTRAN GOSU HASK ICON ICK NEM NIM OBJC-CLANG PICO PIKE PYPY PYPY3 PY_NBC RUST SCM guile CHICKEN SED TCL WHITESPACE |
Աղբյուրը. | Thailand National 2013.D |