Have you ever wondered why "minimum" is so incredibly easy? That is because for today, your role as a contestant will be switched! YAY! In fact, your program will now be grading another contestant's submission with testcases!
In this problem, you will implement a grader function, that when given a testcase for "minimum", will:
- Evaluate the testcase and calculate the correct answer.
- Call the contestant's findMin() function with the testcase to get his answer.
- Check if the answer is identical and output the relevant verdict.
There are three possible verdicts that you can return as a string to the caller function.
- "Accepted", which means the function has produced correct output within a time limit of 500 milliseconds.
- "Wrong Answer", which means that the function has produced incorrect output within a time limit of 500 milliseconds.
- "Time Limit Exceeded", which means the function has exceeded the time limit of 500 milliseconds allowed for the evaluation of this testcase.
Your program will be provided with the following functions:
- int findMin(int N, int A), which simulates the contestant's findMin() function
- void startTime(), which simulates the starting of a timer that can be used to detect TLE.
- int stopTime(), which returns you the number of milliseconds since the last startTime() was called.
Your program must implement the following functions:
- string gradeMin(int N, int A);, which, when called with a "minimum" testcase, will return the verdict of the contestant's function.
Refer to the "minimum" input description.
Refer to the "minimum" output description.
Refer to the "minimum" limits.