AtCoderStudyBooster 0.3.2__tar.gz → 0.4.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {atcoderstudybooster-0.3.2 → atcoderstudybooster-0.4.0}/PKG-INFO +140 -92
- atcoderstudybooster-0.4.0/README.md +240 -0
- atcoderstudybooster-0.4.0/atcdr/download.py +222 -0
- atcoderstudybooster-0.4.0/atcdr/util/problem.py +47 -0
- {atcoderstudybooster-0.3.2 → atcoderstudybooster-0.4.0}/pyproject.toml +2 -2
- atcoderstudybooster-0.3.2/README.md +0 -192
- atcoderstudybooster-0.3.2/atcdr/download.py +0 -322
- atcoderstudybooster-0.3.2/atcdr/util/problem.py +0 -94
- {atcoderstudybooster-0.3.2 → atcoderstudybooster-0.4.0}/.github/workflows/deploy.yaml +0 -0
- {atcoderstudybooster-0.3.2 → atcoderstudybooster-0.4.0}/.gitignore +0 -0
- {atcoderstudybooster-0.3.2 → atcoderstudybooster-0.4.0}/.images/demo1.png +0 -0
- {atcoderstudybooster-0.3.2 → atcoderstudybooster-0.4.0}/.images/demo2.png +0 -0
- {atcoderstudybooster-0.3.2 → atcoderstudybooster-0.4.0}/.images/demo3.png +0 -0
- {atcoderstudybooster-0.3.2 → atcoderstudybooster-0.4.0}/.images/demo4.png +0 -0
- {atcoderstudybooster-0.3.2 → atcoderstudybooster-0.4.0}/.pre-commit-config.yaml +0 -0
- {atcoderstudybooster-0.3.2 → atcoderstudybooster-0.4.0}/.python-version +0 -0
- {atcoderstudybooster-0.3.2 → atcoderstudybooster-0.4.0}/.vscode/extensions.json +0 -0
- {atcoderstudybooster-0.3.2 → atcoderstudybooster-0.4.0}/.vscode/setting.json +0 -0
- {atcoderstudybooster-0.3.2 → atcoderstudybooster-0.4.0}/.vscode/tasks.json +0 -0
- {atcoderstudybooster-0.3.2 → atcoderstudybooster-0.4.0}/atcdr/__init__.py +0 -0
- {atcoderstudybooster-0.3.2 → atcoderstudybooster-0.4.0}/atcdr/cli.py +0 -0
- {atcoderstudybooster-0.3.2 → atcoderstudybooster-0.4.0}/atcdr/generate.py +0 -0
- {atcoderstudybooster-0.3.2 → atcoderstudybooster-0.4.0}/atcdr/login.py +0 -0
- {atcoderstudybooster-0.3.2 → atcoderstudybooster-0.4.0}/atcdr/logout.py +0 -0
- {atcoderstudybooster-0.3.2 → atcoderstudybooster-0.4.0}/atcdr/markdown.py +0 -0
- {atcoderstudybooster-0.3.2 → atcoderstudybooster-0.4.0}/atcdr/open.py +0 -0
- {atcoderstudybooster-0.3.2 → atcoderstudybooster-0.4.0}/atcdr/submit.py +0 -0
- {atcoderstudybooster-0.3.2 → atcoderstudybooster-0.4.0}/atcdr/test.py +0 -0
- {atcoderstudybooster-0.3.2 → atcoderstudybooster-0.4.0}/atcdr/util/__init__.py +0 -0
- {atcoderstudybooster-0.3.2 → atcoderstudybooster-0.4.0}/atcdr/util/fileops.py +0 -0
- {atcoderstudybooster-0.3.2 → atcoderstudybooster-0.4.0}/atcdr/util/filetype.py +0 -0
- {atcoderstudybooster-0.3.2 → atcoderstudybooster-0.4.0}/atcdr/util/gpt.py +0 -0
- {atcoderstudybooster-0.3.2 → atcoderstudybooster-0.4.0}/atcdr/util/parse.py +0 -0
- {atcoderstudybooster-0.3.2 → atcoderstudybooster-0.4.0}/atcdr/util/session.py +0 -0
- {atcoderstudybooster-0.3.2 → atcoderstudybooster-0.4.0}/requirements-dev.lock +0 -0
- {atcoderstudybooster-0.3.2 → atcoderstudybooster-0.4.0}/requirements.lock +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: AtCoderStudyBooster
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.4.0
|
4
4
|
Summary: A tool to download and manage AtCoder problems.
|
5
5
|
Project-URL: Homepage, https://github.com/yuta6/AtCoderStudyBooster
|
6
6
|
Author-email: yuta6 <46110512+yuta6@users.noreply.github.com>
|
@@ -8,7 +8,7 @@ License: MIT
|
|
8
8
|
Requires-Python: >=3.8
|
9
9
|
Requires-Dist: beautifulsoup4
|
10
10
|
Requires-Dist: click-aliases>=1.0.5
|
11
|
-
Requires-Dist: markdownify
|
11
|
+
Requires-Dist: markdownify==0.13.1
|
12
12
|
Requires-Dist: pywebview>=5.4
|
13
13
|
Requires-Dist: questionary>=2.0.1
|
14
14
|
Requires-Dist: requests
|
@@ -25,86 +25,126 @@ Description-Content-Type: text/markdown
|
|
25
25
|
|
26
26
|
🚧 このプロジェクトはまだ実験段階です。日々のAtCoder学習に役立つ機能を順次追加しています。
|
27
27
|
|
28
|
-
AtCoderStudyBoosterはAtCoderの学習を加速させるためのCLIツールです。問題をローカルにダウンロードし、テスト、提出、解答の作成をサポートするツールです。Pythonが入っていることが必須です。Python
|
28
|
+
AtCoderStudyBoosterはAtCoderの学習を加速させるためのCLIツールです。問題をローカルにダウンロードし、テスト、提出、解答の作成をサポートするツールです。Pythonが入っていることが必須です。Pythonが入っている環境なら、
|
29
29
|
|
30
|
-
|
30
|
+
```sh
|
31
|
+
pip install AtCoderStudyBooster
|
32
|
+
```
|
31
33
|
|
32
|
-
|
33
|
-
[online-judge-tools](https://github.com/online-judge-tools)
|
34
|
-
[atcoder-cli](https://github.com/Tatamo/atcoder-cli)
|
34
|
+
でインストールできます。(Python3.8以上が必要です)
|
35
35
|
|
36
|
+
キャプチャ認証が導入されたあとでも、CLIから半自動でログイン&提出できます。ただしキャプチャをGUIから人力で解く必要があります。キャプチャー認証をバイパスするものではありません。
|
37
|
+
|
38
|
+
このツールは以下のプロジェクトに強く影響を受けています。
|
39
|
+
- [online-judge-tools](https://github.com/online-judge-tools)
|
40
|
+
- [atcoder-cli](https://github.com/Tatamo/atcoder-cli)
|
36
41
|
|
37
42
|
## 利用ケース
|
38
43
|
|
39
44
|
まずは`download`コマンドを利用して問題をローカルにダウンロードしてみましょう。
|
40
45
|
|
41
|
-
###
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
```
|
52
|
-
|
53
|
-
├── 223
|
54
|
-
│ ├── StringShifting.html
|
55
|
-
│ └── StringShifting.md
|
56
|
-
├── 224
|
57
|
-
│ ├── Mongeness.html
|
58
|
-
│ └── Mongeness.md
|
59
|
-
├── 225
|
60
|
-
│ ├── StarorNot.html
|
61
|
-
│ └── StarorNot.md
|
62
|
-
└── 226
|
63
|
-
├── CountingArrays.html
|
64
|
-
└── CountingArrays.md
|
65
|
-
```
|
66
|
-
|
67
|
-
### 特定のコンテストの問題に取り組みたい場合
|
68
|
-
|
69
|
-
```sh
|
70
|
-
❯ atcdr download 223..225 A..C
|
71
|
-
```
|
72
|
-
のように実行すると以下のようなフォルダーを生成します.
|
73
|
-
|
74
|
-
```css
|
75
|
-
.
|
76
|
-
├── 223
|
77
|
-
│ ├── A
|
78
|
-
│ │ ├── ExactPrice.html
|
79
|
-
│ │ └── ExactPrice.md
|
80
|
-
│ ├── B
|
81
|
-
│ │ ├── StringShifting.html
|
82
|
-
│ │ └── StringShifting.md
|
83
|
-
│ └── C
|
84
|
-
│ ├── Doukasen.html
|
85
|
-
│ └── Doukasen.md
|
86
|
-
├── 224
|
87
|
-
│ ├── A
|
88
|
-
│ │ ├── Tires.html
|
89
|
-
│ │ └── Tires.md
|
90
|
-
│ ├── B
|
91
|
-
│ │ ├── Mongeness.html
|
92
|
-
│ │ └── Mongeness.md
|
93
|
-
│ └── C
|
94
|
-
│ ├── Triangle.html
|
95
|
-
│ └── Triangle.md
|
96
|
-
└── 225
|
97
|
-
├── A
|
98
|
-
│ ├── DistinctStrings.html
|
99
|
-
│ └── DistinctStrings.md
|
100
|
-
├── B
|
101
|
-
│ ├── StarorNot.html
|
102
|
-
│ └── StarorNot.md
|
103
|
-
└── C
|
104
|
-
├── CalendarValidator.html
|
105
|
-
└── CalendarValidator.md
|
46
|
+
### 1. 特定のコンテストをダウンロードする
|
47
|
+
|
48
|
+
1つのコンテストの問題をダウンロードしたい場合の例です。
|
49
|
+
|
50
|
+
#### ABC350の全問題をダウンロード
|
51
|
+
```sh
|
52
|
+
❯ atcdr download abc350
|
53
|
+
```
|
54
|
+
|
55
|
+
#### ABC350のA〜D問題をダウンロード
|
56
|
+
```sh
|
57
|
+
❯ atcdr download abc350 {A..D}
|
106
58
|
```
|
107
59
|
|
60
|
+
#### 競プロ典型90問のダウンロード
|
61
|
+
```sh
|
62
|
+
❯ atcdr download typical90
|
63
|
+
```
|
64
|
+
|
65
|
+
### 2. 複数のコンテストを一括でダウンロードする
|
66
|
+
|
67
|
+
複数のコンテストを一度にダウンロードしたい場合の例です。bashのブレース展開を活用します。
|
68
|
+
|
69
|
+
#### ABC001〜ABC010までの全問題
|
70
|
+
```sh
|
71
|
+
❯ atcdr download abc{001..010}
|
72
|
+
```
|
73
|
+
|
74
|
+
#### ABC320〜ABC325までのA〜C問題
|
75
|
+
```sh
|
76
|
+
❯ atcdr download abc{320..325} {A..C}
|
77
|
+
```
|
78
|
+
|
79
|
+
次のようなフォルダー構造が生成されます:
|
80
|
+
|
81
|
+
```
|
82
|
+
abc320/
|
83
|
+
├── A/
|
84
|
+
│ ├── Problem.html
|
85
|
+
│ └── Problem.md
|
86
|
+
├── B/
|
87
|
+
│ ├── Problem.html
|
88
|
+
│ └── Problem.md
|
89
|
+
└── C/
|
90
|
+
├── Problem.html
|
91
|
+
└── Problem.md
|
92
|
+
abc321/
|
93
|
+
├── A/
|
94
|
+
...(以下同様)
|
95
|
+
```
|
96
|
+
|
97
|
+
### 3. 特定の問題(A問題、B問題など)を集中的に演習したい場合
|
98
|
+
|
99
|
+
特定の難易度の問題だけを集めて練習したい場合は、**問題ラベルを先に指定**すると便利です。
|
100
|
+
|
101
|
+
#### B問題だけを集中的に練習
|
102
|
+
```sh
|
103
|
+
❯ atcdr download B abc{250..260}
|
104
|
+
```
|
105
|
+
|
106
|
+
問題ラベルを先に指定すると、問題ラベルごとにフォルダが作成され、その中にコンテスト名のフォルダが配置されます。
|
107
|
+
|
108
|
+
```
|
109
|
+
B/
|
110
|
+
├── abc250/
|
111
|
+
│ ├── Problem.html
|
112
|
+
│ └── Problem.md
|
113
|
+
├── abc251/
|
114
|
+
│ ├── Problem.html
|
115
|
+
│ └── Problem.md
|
116
|
+
├── abc252/
|
117
|
+
│ ├── Problem.html
|
118
|
+
│ └── Problem.md
|
119
|
+
└── ...(以下同様)
|
120
|
+
```
|
121
|
+
|
122
|
+
A問題とB問題を集める場合(`{A,B} abc{300..302}`):
|
123
|
+
|
124
|
+
```
|
125
|
+
A/
|
126
|
+
├── abc300/
|
127
|
+
│ ├── Problem.html
|
128
|
+
│ └── Problem.md
|
129
|
+
├── abc301/
|
130
|
+
│ ├── Problem.html
|
131
|
+
│ └── Problem.md
|
132
|
+
└── abc302/
|
133
|
+
├── Problem.html
|
134
|
+
└── Problem.md
|
135
|
+
B/
|
136
|
+
├── abc300/
|
137
|
+
│ ├── Problem.html
|
138
|
+
│ └── Problem.md
|
139
|
+
├── abc301/
|
140
|
+
│ ├── Problem.html
|
141
|
+
│ └── Problem.md
|
142
|
+
└── abc302/
|
143
|
+
├── Problem.html
|
144
|
+
└── Problem.md
|
145
|
+
```
|
146
|
+
このディレクトリ構造により、同じ難易度の問題を一箇所に集めて効率的に演習できます。
|
147
|
+
|
108
148
|
### 問題を解く
|
109
149
|
|
110
150
|
MarkdownファイルあるいはHTMLファイルをVS CodeのHTML Preview, Markdown Previewで開くと問題を確認できます。VS Codeで開くと左側にテキストエディターを表示して、右側で問題をみながら問題に取り組めます。
|
@@ -116,13 +156,13 @@ MarkdownファイルあるいはHTMLファイルをVS CodeのHTML Preview, Markd
|
|
116
156
|
問題をダウンロードしたフォルダーに移動します。
|
117
157
|
|
118
158
|
```sh
|
119
|
-
❯ cd
|
159
|
+
❯ cd abc224/B
|
120
160
|
```
|
121
161
|
|
122
|
-
|
162
|
+
移動したフォルダーで解答ファイルを作成後、testコマンドを実行すると、サンプルケースをテストします。
|
123
163
|
|
124
164
|
```sh
|
125
|
-
~/.../
|
165
|
+
~/.../abc224/B
|
126
166
|
❯ atcdr t
|
127
167
|
```
|
128
168
|
|
@@ -132,82 +172,90 @@ WAの場合は以下のような表示になります。
|
|
132
172
|
|
133
173
|

|
134
174
|
|
135
|
-
|
136
175
|
### 提出する
|
137
176
|
|
138
177
|
```sh
|
139
|
-
~/.../
|
178
|
+
~/.../abc224/B
|
140
179
|
❯ atcdr s
|
141
180
|
```
|
142
|
-
|
181
|
+
|
182
|
+
を実行すると、提出することができます。提出にはAtCoderのサイトへのログインが必要です。
|
143
183
|
|
144
184
|
### 解答をGPTで生成する
|
145
185
|
|
146
186
|
```sh
|
147
|
-
~/.../
|
187
|
+
~/.../abc224/B
|
148
188
|
❯ atcdr g
|
149
189
|
```
|
190
|
+
|
150
191
|
で解答をGPTで生成します。Chat GPTのAPIキーが必要です。さらに、生成されたファイルはサンプルケースが自動でテストされ、**テストをパスしなかった場合、テスト結果がGPTにフィードバックされ解答が再生成**されます。
|
151
192
|
|
152
193
|
GPTとプログラムとのやり取りのログはJSONファイルで保存されます。
|
153
194
|
|
154
195
|
## 解答生成機能generateコマンドに関する注意点
|
155
196
|
|
156
|
-
[AtCoder生成AI対策ルール](https://info.atcoder.jp/entry/llm-rules-ja)によるとAtCoder Beginner Contest(以下、ABCとする)および AtCoder Regular Contest (Div. 2) においてに問題文を生成AI
|
197
|
+
[AtCoder生成AI対策ルール](https://info.atcoder.jp/entry/llm-rules-ja)によるとAtCoder Beginner Contest(以下、ABCとする)および AtCoder Regular Contest (Div. 2) においてに問題文を生成AIに直接与えることは禁止されています。ただし、このルールは過去問を練習している際には適用されません。該当のコンテスト中にこの機能を使用しないでください。
|
157
198
|
|
158
199
|
## その他の機能
|
159
200
|
|
160
201
|
### markdownコマンド
|
161
202
|
|
162
203
|
完全なCLI環境方向けのコマンドです。
|
204
|
+
|
163
205
|
```sh
|
164
|
-
~/.../
|
206
|
+
~/.../abc224/B
|
165
207
|
❯ atcdr md
|
166
208
|
```
|
167
|
-
|
209
|
+
|
210
|
+
を実行すると、問題をプリントします。
|
168
211
|
|
169
212
|

|
170
213
|
|
171
214
|
### 複数のファイルを一度にテスト
|
172
215
|
|
173
216
|
```sh
|
174
|
-
~/.../
|
217
|
+
~/.../abc224/B
|
175
218
|
❯ atcdr t *.py
|
176
219
|
```
|
220
|
+
|
177
221
|
でフォルダー内にあるすべてのPythonファイルを一度にテストします。
|
222
|
+
|
178
223
|
```sh
|
179
|
-
~/.../
|
224
|
+
~/.../abc224/B
|
180
225
|
❯ atcdr t mon.py mon.c mon.cpp
|
181
226
|
```
|
182
227
|
|
183
228
|
フォルダー内に複数ファイルある場合は、インタラクティブに選択できます。
|
229
|
+
|
184
230
|
```sh
|
185
|
-
~/.../
|
231
|
+
~/.../abc224/B
|
186
232
|
❯ atcdr t
|
187
233
|
```
|
188
234
|
|
189
235
|
```sh
|
190
|
-
~/.../
|
236
|
+
~/.../abc224/B
|
191
237
|
❯ atcdr t
|
192
|
-
|
238
|
+
複数のファイルが見つかりました.ファイルを選択してください:
|
193
239
|
十字キーで移動, [enter]で実行
|
194
|
-
|
195
|
-
|
196
|
-
|
240
|
+
❯❯❯ mon.py
|
241
|
+
mon.c
|
242
|
+
mon.cpp
|
197
243
|
```
|
198
244
|
|
199
245
|
### プログラミング言語を指定してコードを生成
|
200
246
|
|
201
247
|
`--lang`オプションを使うと、生成したいプログラミング言語を指定できます。
|
248
|
+
|
202
249
|
```sh
|
203
|
-
~/.../
|
250
|
+
~/.../abc224/B
|
204
251
|
❯ atcdr generate --lang rust
|
205
252
|
```
|
253
|
+
|
206
254
|
### テストをせずにコードのみ生成
|
207
255
|
|
208
256
|
デフォルトで`atcdr generate`コマンドは生成されたコードをテストしますが、テストせずにコードのみ生成できます。
|
209
257
|
|
210
258
|
```sh
|
211
|
-
~/.../
|
259
|
+
~/.../abc224/B
|
212
260
|
❯ atcdr generate --lang rust --without_test
|
213
261
|
```
|
@@ -0,0 +1,240 @@
|
|
1
|
+
# AtCoderStudyBooster
|
2
|
+
|
3
|
+
## 概要
|
4
|
+
|
5
|
+
🚧 このプロジェクトはまだ実験段階です。日々のAtCoder学習に役立つ機能を順次追加しています。
|
6
|
+
|
7
|
+
AtCoderStudyBoosterはAtCoderの学習を加速させるためのCLIツールです。問題をローカルにダウンロードし、テスト、提出、解答の作成をサポートするツールです。Pythonが入っていることが必須です。Pythonが入っている環境なら、
|
8
|
+
|
9
|
+
```sh
|
10
|
+
pip install AtCoderStudyBooster
|
11
|
+
```
|
12
|
+
|
13
|
+
でインストールできます。(Python3.8以上が必要です)
|
14
|
+
|
15
|
+
キャプチャ認証が導入されたあとでも、CLIから半自動でログイン&提出できます。ただしキャプチャをGUIから人力で解く必要があります。キャプチャー認証をバイパスするものではありません。
|
16
|
+
|
17
|
+
このツールは以下のプロジェクトに強く影響を受けています。
|
18
|
+
- [online-judge-tools](https://github.com/online-judge-tools)
|
19
|
+
- [atcoder-cli](https://github.com/Tatamo/atcoder-cli)
|
20
|
+
|
21
|
+
## 利用ケース
|
22
|
+
|
23
|
+
まずは`download`コマンドを利用して問題をローカルにダウンロードしてみましょう。
|
24
|
+
|
25
|
+
### 1. 特定のコンテストをダウンロードする
|
26
|
+
|
27
|
+
1つのコンテストの問題をダウンロードしたい場合の例です。
|
28
|
+
|
29
|
+
#### ABC350の全問題をダウンロード
|
30
|
+
```sh
|
31
|
+
❯ atcdr download abc350
|
32
|
+
```
|
33
|
+
|
34
|
+
#### ABC350のA〜D問題をダウンロード
|
35
|
+
```sh
|
36
|
+
❯ atcdr download abc350 {A..D}
|
37
|
+
```
|
38
|
+
|
39
|
+
#### 競プロ典型90問のダウンロード
|
40
|
+
```sh
|
41
|
+
❯ atcdr download typical90
|
42
|
+
```
|
43
|
+
|
44
|
+
### 2. 複数のコンテストを一括でダウンロードする
|
45
|
+
|
46
|
+
複数のコンテストを一度にダウンロードしたい場合の例です。bashのブレース展開を活用します。
|
47
|
+
|
48
|
+
#### ABC001〜ABC010までの全問題
|
49
|
+
```sh
|
50
|
+
❯ atcdr download abc{001..010}
|
51
|
+
```
|
52
|
+
|
53
|
+
#### ABC320〜ABC325までのA〜C問題
|
54
|
+
```sh
|
55
|
+
❯ atcdr download abc{320..325} {A..C}
|
56
|
+
```
|
57
|
+
|
58
|
+
次のようなフォルダー構造が生成されます:
|
59
|
+
|
60
|
+
```
|
61
|
+
abc320/
|
62
|
+
├── A/
|
63
|
+
│ ├── Problem.html
|
64
|
+
│ └── Problem.md
|
65
|
+
├── B/
|
66
|
+
│ ├── Problem.html
|
67
|
+
│ └── Problem.md
|
68
|
+
└── C/
|
69
|
+
├── Problem.html
|
70
|
+
└── Problem.md
|
71
|
+
abc321/
|
72
|
+
├── A/
|
73
|
+
...(以下同様)
|
74
|
+
```
|
75
|
+
|
76
|
+
### 3. 特定の問題(A問題、B問題など)を集中的に演習したい場合
|
77
|
+
|
78
|
+
特定の難易度の問題だけを集めて練習したい場合は、**問題ラベルを先に指定**すると便利です。
|
79
|
+
|
80
|
+
#### B問題だけを集中的に練習
|
81
|
+
```sh
|
82
|
+
❯ atcdr download B abc{250..260}
|
83
|
+
```
|
84
|
+
|
85
|
+
問題ラベルを先に指定すると、問題ラベルごとにフォルダが作成され、その中にコンテスト名のフォルダが配置されます。
|
86
|
+
|
87
|
+
```
|
88
|
+
B/
|
89
|
+
├── abc250/
|
90
|
+
│ ├── Problem.html
|
91
|
+
│ └── Problem.md
|
92
|
+
├── abc251/
|
93
|
+
│ ├── Problem.html
|
94
|
+
│ └── Problem.md
|
95
|
+
├── abc252/
|
96
|
+
│ ├── Problem.html
|
97
|
+
│ └── Problem.md
|
98
|
+
└── ...(以下同様)
|
99
|
+
```
|
100
|
+
|
101
|
+
A問題とB問題を集める場合(`{A,B} abc{300..302}`):
|
102
|
+
|
103
|
+
```
|
104
|
+
A/
|
105
|
+
├── abc300/
|
106
|
+
│ ├── Problem.html
|
107
|
+
│ └── Problem.md
|
108
|
+
├── abc301/
|
109
|
+
│ ├── Problem.html
|
110
|
+
│ └── Problem.md
|
111
|
+
└── abc302/
|
112
|
+
├── Problem.html
|
113
|
+
└── Problem.md
|
114
|
+
B/
|
115
|
+
├── abc300/
|
116
|
+
│ ├── Problem.html
|
117
|
+
│ └── Problem.md
|
118
|
+
├── abc301/
|
119
|
+
│ ├── Problem.html
|
120
|
+
│ └── Problem.md
|
121
|
+
└── abc302/
|
122
|
+
├── Problem.html
|
123
|
+
└── Problem.md
|
124
|
+
```
|
125
|
+
このディレクトリ構造により、同じ難易度の問題を一箇所に集めて効率的に演習できます。
|
126
|
+
|
127
|
+
### 問題を解く
|
128
|
+
|
129
|
+
MarkdownファイルあるいはHTMLファイルをVS CodeのHTML Preview, Markdown Previewで開くと問題を確認できます。VS Codeで開くと左側にテキストエディターを表示して、右側で問題をみながら問題に取り組めます。
|
130
|
+
|
131
|
+

|
132
|
+
|
133
|
+
### サンプルをローカルでテストする
|
134
|
+
|
135
|
+
問題をダウンロードしたフォルダーに移動します。
|
136
|
+
|
137
|
+
```sh
|
138
|
+
❯ cd abc224/B
|
139
|
+
```
|
140
|
+
|
141
|
+
移動したフォルダーで解答ファイルを作成後、testコマンドを実行すると、サンプルケースをテストします。
|
142
|
+
|
143
|
+
```sh
|
144
|
+
~/.../abc224/B
|
145
|
+
❯ atcdr t
|
146
|
+
```
|
147
|
+
|
148
|
+

|
149
|
+
|
150
|
+
WAの場合は以下のような表示になります。
|
151
|
+
|
152
|
+

|
153
|
+
|
154
|
+
### 提出する
|
155
|
+
|
156
|
+
```sh
|
157
|
+
~/.../abc224/B
|
158
|
+
❯ atcdr s
|
159
|
+
```
|
160
|
+
|
161
|
+
を実行すると、提出することができます。提出にはAtCoderのサイトへのログインが必要です。
|
162
|
+
|
163
|
+
### 解答をGPTで生成する
|
164
|
+
|
165
|
+
```sh
|
166
|
+
~/.../abc224/B
|
167
|
+
❯ atcdr g
|
168
|
+
```
|
169
|
+
|
170
|
+
で解答をGPTで生成します。Chat GPTのAPIキーが必要です。さらに、生成されたファイルはサンプルケースが自動でテストされ、**テストをパスしなかった場合、テスト結果がGPTにフィードバックされ解答が再生成**されます。
|
171
|
+
|
172
|
+
GPTとプログラムとのやり取りのログはJSONファイルで保存されます。
|
173
|
+
|
174
|
+
## 解答生成機能generateコマンドに関する注意点
|
175
|
+
|
176
|
+
[AtCoder生成AI対策ルール](https://info.atcoder.jp/entry/llm-rules-ja)によるとAtCoder Beginner Contest(以下、ABCとする)および AtCoder Regular Contest (Div. 2) においてに問題文を生成AIに直接与えることは禁止されています。ただし、このルールは過去問を練習している際には適用されません。該当のコンテスト中にこの機能を使用しないでください。
|
177
|
+
|
178
|
+
## その他の機能
|
179
|
+
|
180
|
+
### markdownコマンド
|
181
|
+
|
182
|
+
完全なCLI環境方向けのコマンドです。
|
183
|
+
|
184
|
+
```sh
|
185
|
+
~/.../abc224/B
|
186
|
+
❯ atcdr md
|
187
|
+
```
|
188
|
+
|
189
|
+
を実行すると、問題をプリントします。
|
190
|
+
|
191
|
+

|
192
|
+
|
193
|
+
### 複数のファイルを一度にテスト
|
194
|
+
|
195
|
+
```sh
|
196
|
+
~/.../abc224/B
|
197
|
+
❯ atcdr t *.py
|
198
|
+
```
|
199
|
+
|
200
|
+
でフォルダー内にあるすべてのPythonファイルを一度にテストします。
|
201
|
+
|
202
|
+
```sh
|
203
|
+
~/.../abc224/B
|
204
|
+
❯ atcdr t mon.py mon.c mon.cpp
|
205
|
+
```
|
206
|
+
|
207
|
+
フォルダー内に複数ファイルある場合は、インタラクティブに選択できます。
|
208
|
+
|
209
|
+
```sh
|
210
|
+
~/.../abc224/B
|
211
|
+
❯ atcdr t
|
212
|
+
```
|
213
|
+
|
214
|
+
```sh
|
215
|
+
~/.../abc224/B
|
216
|
+
❯ atcdr t
|
217
|
+
複数のファイルが見つかりました.ファイルを選択してください:
|
218
|
+
十字キーで移動, [enter]で実行
|
219
|
+
❯❯❯ mon.py
|
220
|
+
mon.c
|
221
|
+
mon.cpp
|
222
|
+
```
|
223
|
+
|
224
|
+
### プログラミング言語を指定してコードを生成
|
225
|
+
|
226
|
+
`--lang`オプションを使うと、生成したいプログラミング言語を指定できます。
|
227
|
+
|
228
|
+
```sh
|
229
|
+
~/.../abc224/B
|
230
|
+
❯ atcdr generate --lang rust
|
231
|
+
```
|
232
|
+
|
233
|
+
### テストをせずにコードのみ生成
|
234
|
+
|
235
|
+
デフォルトで`atcdr generate`コマンドは生成されたコードをテストしますが、テストせずにコードのみ生成できます。
|
236
|
+
|
237
|
+
```sh
|
238
|
+
~/.../abc224/B
|
239
|
+
❯ atcdr generate --lang rust --without_test
|
240
|
+
```
|