Skip to content
New issue

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

从 codeforces 导入交互题或其他输入输出特别指定的题时显示的样例为实际的测试数据 #63

Open
cubercsl opened this issue May 19, 2020 · 0 comments

Comments

@cubercsl
Copy link
Contributor

test_id = 0
tests, samples = [], []
for test_node in testset_node.find('tests').findall('test'):
test_id += 1
with open(os.path.join(self.directory, input_pattern % test_id), 'rb') as test_input:
# process CRLF
input_text = test_input.read().replace(b"\r\n", b"\n")
with open(os.path.join(self.directory, answer_pattern % test_id), 'rb') as test_answer:
answer_text = test_answer.read().replace(b"\r\n", b"\n")
hash_str = case_hash(self.problem.id, input_text, answer_text)
input_path, answer_path = get_input_path(hash_str), get_output_path(hash_str)
with open(input_path, "wb") as test_input, open(answer_path, "wb") as test_answer:
test_input.write(input_text)
test_answer.write(answer_text)
if 'sample' in test_node.attrib and test_node.attrib["sample"] == "true":
samples.append(hash_str)
tests.append(hash_str)

样例应该从 statements 里面来读取的样子(

@cubercsl cubercsl changed the title 从 codeforces 导入交互题或其他输入输出特别指定的题时导入了实际的测试数据 从 codeforces 导入交互题或其他输入输出特别指定的题时显示的样例为实际的测试数据 May 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant