Skip to content

Conversation

@tatsukikitamura
Copy link

Why is this change needed?

To fix a SampleDetectionError that occurs when running atcoder-tools gen ahc.
In AHC, there is a section titled "入力生成方法" (Input Generation Method). The current parser incorrectly identifies this as the "Input Format" section because startswith("入力") matches "入力生成方法", causing the correct input format to be overwritten.

(Japanese)
atcoder-tools gen ahc を実行した際に発生する SampleDetectionError を修正するため。
AHCには「入力生成方法」というセクションがあり、startswith("入力") という条件だとこれにもマッチしてしまい、正しい入力形式の情報が上書きされてエラーになっていました。

What did you implement?

Changed the condition for detecting the Input Format section in atcodertools/client/models/problem_content.py from startswith("入力") to an exact match == "入力".
This ensures that sections like "入力生成方法" are strictly excluded.

(Japanese)
atcodertools/client/models/problem_content.py における入力形式セクションの判定条件を、startswith("入力") から完全一致の == "入力" に変更しました。
これにより、「入力生成方法」のようなセクションが誤って検出されるのを防ぎます。

What behavior do you expect?

When executing the command atcoder-tools gen ahc001, the tool should successfully download samples without raising SampleDetectionError.

(Japanese)
atcoder-tools gen ahc001 コマンドを実行した際に、SampleDetectionError が発生せず、正常にサンプルがダウンロードされること。

Copilot AI review requested due to automatic review settings December 23, 2025 04:40
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a SampleDetectionError that occurs when parsing AtCoder Heuristic Contest (AHC) problems. AHC problems contain a section titled "入力生成方法" (Input Generation Method), which was incorrectly being matched as the input format section due to a loose string comparison using startswith("入力").

Key Changes:

  • Modified the input format section detection logic to use exact string matching instead of prefix matching

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant