#P8964. 梦幻 | Reopening of Dream
梦幻 | Reopening of Dream
Background
Hope you have never failed at the last moment because of this.
Flowers bloom not to wither, but to shine more brightly.
At the beginning, you only had ideals and confidence, but everything started to grow and intertwine from here. Keeping on walking along the road paved with effort and sweat is not a wrong choice—at least you have experienced joy, anger, sorrow, and happiness for it.
May every contestant with ideals achieve ideal results!
Problem Description
The contestants' code for PION2202 has been published. As someone who has been writing confusing code for ten years in a row, of course you want to be the first to spread all kinds of stories from their code.
The first thing to check is whether everyone wrote file input/output correctly. You have asked Xiao E to整理 (zhengli, “organize”) the problem titles and each contestant’s freopen statements.
There are problems in PION2202, and contestants. You decide to divide contestants into three categories:
- Normal: the most standard
freopenstatements; - Ancestor-seeking:
freopenstatements that are commented out; - Fun-seeking:
freopenstatements in other forms.
Formally, for a normal contestant, for every problem, the freopen statements must be exactly:
freopen("<title>.in","r",stdin);
freopen("<title>.out","w",stdout);
where <title> should be replaced with the corresponding problem title.
For an ancestor-seeking contestant, among their freopen statements there exists at least one line (for at least one problem) that starts with //freopen( and ends with );.
If a contestant’s freopen statements satisfy neither of the above two conditions, then the contestant is called fun-seeking.
You need to determine whether each contestant is normal, ancestor-seeking, or fun-seeking.
Input Format
The first line contains a positive integer , indicating the subtask id.
The second line contains two positive integers , indicating the number of contestants and the number of problems.
The next lines each contain a string consisting only of lowercase letters. The -th of these lines is the title of the -th problem. It is guaranteed that the length of each title is between and .
The next lines describe the freopen statements. For each block of lines: the first line is an empty line; the next lines are all freopen statements of one contestant for all problems, given in problem order. The first two lines are the freopen statements for the first problem, and so on; the last two lines are for the last problem.
It is guaranteed that for every character in every freopen statement, its ASCII code is between and , i.e., it contains no invisible characters such as spaces.
It is guaranteed that the length of each freopen statement line is between and .
Output Format
Output lines. The -th line indicates the category of the -th contestant.
If the contestant is normal, wish them RP++, so output PION2202 RP++..
If the contestant is ancestor-seeking, output Wrong file operation takes you to your ancestors along with your 3 years' efforts on OI..
If the contestant is fun-seeking, wish them to be careful not to make mistakes while having fun, so output Good luck and have fun..
3
4 4
tnalp
woem
kcarrab
hctam
freopen("tnalp.in","r",stdin);
freopen("tnalp.out","w",stdout);
freopen("woem.in","r",stdin);
freopen("woem.out","w",stdout);
freopen("kcarrab.in","r",stdin);
freopen("kcarrab.out","w",stdout);
freopen("hctam.in","r",stdin);
freopen("hctam.out","w",stdout);
freopen("tnalp.in","r",stdin);
freopen("tnalp.out","w",stdout);
//freopen("woem.in","r",stdin);
freopen("woem.out","w",stdout);
freopen("kcarrab.in","r",stdin);
//I_AK_IOI!!!
freopen("hctam.in","r",stdin);
freopen("hctam.out","w",stdout);
freopen("tnalp.in","r",stdin);
freopen("tnalp.out","w",stdout)
freopen("owem.in","r",stdin);
freopen("woem.out","w",stdout);
freopen("kcarrab.in","r",stdout);
freopen("kcarrab.out","w",stdin);
freopen("hctam.out","w",stdout);
freopen("hctam.in","r",stdin);
freopen("tnalp.in","r",stdin);//I_LOVE_CCF
freopen("tnalp.out","w",stdout);
freopen("woem.in","r",stdin);//I_HATE_THIS
freopen("woem.out","w",stdout);
freopen("kcarrab.in"/*I_FORGET_HOW_TO_FIND_BRIDGES!!!!!!*/,"r",stdin);
freopen("kcarrab.out","w",stdout);
freopen("hctam.in","r",stdin);//I_CAN_GET_ONLY_8PTSqwq
freopen("hctam.out","w",stdout);
PION2202 RP++.
Wrong file operation takes you to your ancestors along with your 3 years' efforts on OI.
Good luck and have fun.
Good luck and have fun.
Hint
[Sample Explanation]
The first contestant’s freopen statements are all standard, so they are normal.
The second contestant commented out the input file statement for problem woem, so they are ancestor-seeking. Although this contestant also did fun-seeking behavior in problem kcarrab, since they already satisfy the ancestor-seeking condition, they are classified as ancestor-seeking.
The third contestant’s freopen statements for all four problems are not standard. The output file statement for tnalp is missing a semicolon; woem was mistyped as owem; stdin and stdout are swapped in problem kcarrab; and the two statements for hctam are in reversed order. In this problem, they are considered fun-seeking.
The fourth contestant’s freopen statements can work correctly, but since they are different from the standard freopen statements, they are considered fun-seeking in this problem.
[Constraints]
This problem uses bundled tests.
Subtask 1 (30 points): . and the problem title is yxalag. However, if you output No, general!, you will not get points.
Subtask 2 (30 points): . It is guaranteed that there are no ancestor-seeking contestants.
Subtask 3 (40 points): . No special properties.
For of the data:
- It is guaranteed that .
- It is guaranteed that .
- It is guaranteed that .
- It is guaranteed that the length of each problem title is between and .
- It is guaranteed that the length of each
freopenstatement line is between and .
Translated by ChatGPT 5