Automated Judge Script

2020年1月17日 1620点热度 0人点赞 0条评论

Automated Judge Script

时间: 1ms        内存:64M

描述:

Human programming contest judges are known to be very picky. To eliminate the need for them, write an automated judge script to judge submitted solution runs.

Your program should take a file containing the correct output as well as the output of submitted program and answer either Accepted, Presentation Error, or Wrong Answer, defined as follows:

Accepted:
You are to report ``Accepted'' if the team's output matches the standard solution exactly. All characters must match and must occur in the same order.

Presentation Error:
Give a ``Presentation Error'' if all numeric characters match in the same order, but there is at least one non-matching non-numeric character. For example, ``15 0'' and ``150'' would receive ``Presentation Error'', whereas ``15 0'' and ``1 0'' would receive ``Wrong Answer,'' described below.

Wrong Answer:
If the team output cannot be classified as above, then you have no alternative but to score the program a `Wrong Answer'.

输入:

The input will consist of an arbitrary number of input sets. Each input set begins with a line containing a positive integer n < 100, which describes the number of lines of the correct solution. The next n lines contain the correct solution. Then comes a positive integer m < 100, alone on its line, which describes the number of lines of the team's submitted output. The next m lines contain this output. The input is terminated by a value of n = 0, which should not be processed. No line will have more than 100 characters.

输出:

For each set, output one of the following:

Run #x: Accepted

Run #x: Presentation Error

Run #x: Wrong Answer

where x stands for the number of the input set (starting from 1).

示例输入:

2
The answer is: 10
The answer is: 5
2
The answer is: 10
The answer is: 5
2
The answer is: 10
The answer is: 5
2
The answer is: 10
The answer is: 15
2
The answer is: 10
The answer is:  5
2
The answer is: 10
The answer is: 5
3
Input Set #1: YES
Input Set #2: NO
Input Set #3: NO
3
Input Set #0: YES
Input Set #1: NO
Input Set #2: NO
1
1 0 1 0
1
1010
1
The judges are mean!
1
The judges are good!
0

示例输出:

Run #1: Accepted
Run #2: Wrong Answer
Run #3: Presentation Error
Run #4: Wrong Answer
Run #5: Presentation Error
Run #6: Presentation Error

提示:

参考答案:

解锁文章

没有看到答案?微信扫描二维码可免费解锁文章

微信扫描二维码解锁

使用微信扫描二维码打开广告页面后可以立即关闭,再刷新此页面即可正常浏览此文章

所跳转广告均由第三方提供,并不代表本站观点!

已经扫描此二维码?点此立即跳转

code

这个人很懒,什么都没留下

文章评论