#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 bytes (KB). 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 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 |
|---|---|---|
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 , a reasonable value within the int range is taken. For example, when computing , it is quite likely to get .
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
京公网安备 11011102002149号