#P5285. [十二省联考 2019] 骗分过样例

[十二省联考 2019] 骗分过样例

Description

The problem data are provided in the attached files.

Input Format

The first line contains a string, indicating the function ID of the software feature that needs to be run. The more similar two IDs are, the closer the algorithms for the corresponding two functions are.

Then, depending on the function, there may be input of any length. See the documentation for each function for details.

Output Format

See the documentation for each function for details.

Hint

Subtasks

“Where is the ‘documentation for each function’?”

“I don’t have it either, just like I don’t have a problem statement...”

“Alright... then can I just hardcode a table?...”

The code length limit is 102400\bold{102400} bytes (100100KB). You definitely can’t hardcode everything! However, if needed, you may hardcode some small tables...”

“Um...”

“Also, we will score your program separately for each test point, and sum them up to get the total score. By tradition, each test point gives full marks if correct, and 00 points if wrong. The points of each test point are not all the same, and the points, order, and difficulty of test points have no necessary relationship.”

Test Point Function ID Points
11 1_998244353\texttt{1\_998244353} 44
22
33
44 1?\texttt{1?} 77
55 1?+\texttt{1?+} 99
66 1wa_998244353\texttt{1wa\_998244353} 66
77 77
88 2p\texttt{2p} 44
99 66
1010 88
1111 2u\texttt{2u} 55
1212 66
1313 99
1414 2g\texttt{2g} 55
1515 77
1616 2g?\texttt{2g?} 99

Hint

When you use the int type in C/C++, if an overflow occurs, a likely situation is that under the assumption of congruence modulo 2322^{32}, a reasonable value within the int range is taken. For example, when computing 2147483647+22147483647 + 2, it is quite likely to get 2147483647-2147483647.

However, the C/C++ standard classifies this situation as “undefined behavior”. When your program tries to evaluate an int operation that would overflow, besides the result above, the compiler may also make your program produce an incorrect result, enter an infinite loop, crash at runtime, etc. All of these are compliant with the C/C++ standard.

If your program wants to make use of the natural overflow behavior of int, please switch to unsigned operations. For example, rewrite a + b as (int) ((unsigned) a + (unsigned) b), to avoid unexpected errors.

Translated by ChatGPT 5