cleanup window layout
This commit is contained in:
parent
3f49721657
commit
0db6fa96b4
9 changed files with 118 additions and 76 deletions
|
|
@ -68,7 +68,7 @@ def main():
|
|||
|
||||
contest_id = sys.argv[1]
|
||||
problem_letter = sys.argv[2]
|
||||
problem_id = contest_id + problem_letter
|
||||
problem_id = contest_id + problem_letter.lower()
|
||||
|
||||
url = parse_problem_url(contest_id, problem_letter)
|
||||
print(f"Scraping: {url}", file=sys.stderr)
|
||||
|
|
@ -88,6 +88,11 @@ def main():
|
|||
test_cases = []
|
||||
for input_data, output_data in tests:
|
||||
test_cases.append({"input": input_data, "output": output_data})
|
||||
|
||||
if test_cases:
|
||||
combined_input = str(len(test_cases)) + "\n" + "\n".join(tc["input"] for tc in test_cases)
|
||||
combined_output = "\n".join(tc["output"] for tc in test_cases)
|
||||
test_cases = [{"input": combined_input, "output": combined_output}]
|
||||
|
||||
result = {
|
||||
"success": True,
|
||||
|
|
|
|||
|
|
@ -43,16 +43,9 @@ def scrape(url: str):
|
|||
output_lines.append(line_div.get_text().strip())
|
||||
|
||||
if input_lines and output_lines:
|
||||
if len(input_lines) > 1 and input_lines[0].isdigit():
|
||||
test_count = int(input_lines[0])
|
||||
remaining_input = input_lines[1:]
|
||||
for i in range(min(test_count, len(output_lines))):
|
||||
if i < len(remaining_input):
|
||||
tests.append((remaining_input[i], output_lines[i]))
|
||||
else:
|
||||
input_text = "\n".join(input_lines)
|
||||
output_text = "\n".join(output_lines)
|
||||
tests.append((input_text, output_text))
|
||||
input_text = "\n".join(input_lines)
|
||||
output_text = "\n".join(output_lines)
|
||||
tests.append((input_text, output_text))
|
||||
|
||||
return tests
|
||||
|
||||
|
|
@ -84,7 +77,7 @@ def main():
|
|||
|
||||
contest_id = sys.argv[1]
|
||||
problem_letter = sys.argv[2]
|
||||
problem_id = contest_id + problem_letter.upper()
|
||||
problem_id = contest_id + problem_letter.lower()
|
||||
|
||||
url = parse_problem_url(contest_id, problem_letter)
|
||||
tests = scrape_sample_tests(url)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue