#P8964. Contestant Freopen Classification
Contestant Freopen Classification
Contestant Freopen Classification
In the contest PION2202, there are m problems and n contestants. For each problem, the contestants provide file input/output statements (using freopen in C/C++) for redirecting standard input and output. You are given the problem titles in order and, for each contestant, for each problem, exactly two lines representing their freopen statements. Based on these statements, contestants are classified into three categories:
-
Normal: For every problem, the contestant’s statements exactly match: [ \texttt{freopen(".in","r",stdin);}\ \texttt{freopen(".out","w",stdout);} ] where is replaced by the corresponding problem title.
-
Commented: If at least one of the lines (among all problems) is a commented freopen statement, i.e. it starts with
//freopen(
and ends with);
. -
Fun: Any contestant who is not Normal and does not have any commented freopen statements falls into this category.
Your task is to determine the type for each contestant. Output one line per contestant with one of the strings: normal, commented, or fun.
inputFormat
The first line contains two integers m and n, where m is the number of problems and n is the number of contestants. The second line contains m strings representing the problem titles. This is followed by n groups; each group describes one contestant. For each contestant, there are m blocks, and each block consists of exactly two lines which are the freopen statements for that problem.
outputFormat
Output n lines. The i-th line should be the classification of the i-th contestant: output normal
if the contestant’s statements for every problem match exactly the expected format, commented
if at least one line is a commented freopen statement, and fun
otherwise.
sample
2 3
A B
freopen("A.in","r",stdin);
freopen("A.out","w",stdout);
freopen("B.in","r",stdin);
freopen("B.out","w",stdout);
//freopen("A.in","r",stdin);
freopen("A.out","w",stdout);
freopen("B.in","r",stdin);
freopen("B.out","w",stdout);
freopen("A.in","r",stdin);
freopen("A.output","w",stdout);
freopen("B.in","r",stdin);
freopen("B.out","w",stdout);
normal
commented
fun
</p>