fix/ahc-parsing-error #313
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why is this change needed?
To fix a
SampleDetectionErrorthat occurs when runningatcoder-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.pyfromstartswith("入力")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 raisingSampleDetectionError.(Japanese)
atcoder-tools gen ahc001コマンドを実行した際に、SampleDetectionErrorが発生せず、正常にサンプルがダウンロードされること。