We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#include <cstdio> #include <cstring> #include <iostream> #include <algorithm> using namespace std; int main() { int singer1[6] = {8, 4, 6, 7, 5, 6}; int singer2[6] = {5, 6, 3, 6, 4, 2}; int singer3[6] = {3, 2, 4, 2, 3, 5}; int num; scanf("%d", &num); printf( "%d %d %d \n%d", singer1[num - 1], singer2[num - 1], singer3[num - 1], singer1[num - 1] + singer2[num - 1] + singer3[num -1] ); return 0; }
输出样例 1
8 5 3 16
用户输出
这是一个测试用的程序,注意 "%d %d %d \n%d" 中,\n 之前的空格会导致答案错误。因为 Judger 在比较「用户输出」和「标准输出」时,只抹掉了用户输出最后一行的空格和换行符,输出中间行末尾的空格没有处理。
"%d %d %d \n%d"
\n
我把输出比较函数改成了如下
def _compare_output(self, test_case_file_id, user_output_file): with open(user_output_file, "rb") as f: # 目前在上传测试用例时只去掉了最后一行的空格以及换行符,中间行末的空格没有去除,有待优化,但我们可以先帮用户 rstrip 掉 output_lines = f.readlines() stripped_output_lines = [line.rstrip() for line in output_lines] content = b'\n'.join(stripped_output_lines) output_md5 = hashlib.md5(content.rstrip()).hexdigest() result = output_md5 == self._get_test_case_file_info(test_case_file_id)["stripped_output_md5"] return output_md5, result
The text was updated successfully, but these errors were encountered:
这个改动容易造成历史 md5 不兼容,如果实现的话得是一个可配选项。
Sorry, something went wrong.
No branches or pull requests
输出样例 1
用户输出
这是一个测试用的程序,注意
"%d %d %d \n%d"
中,\n
之前的空格会导致答案错误。因为 Judger 在比较「用户输出」和「标准输出」时,只抹掉了用户输出最后一行的空格和换行符,输出中间行末尾的空格没有处理。我把输出比较函数改成了如下
The text was updated successfully, but these errors were encountered: