AtCoderStudyBooster 0.4.0__py3-none-any.whl → 0.4.1__py3-none-any.whl
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.
- atcdr/download.py +32 -27
- atcdr/generate.py +19 -24
- atcdr/login.py +10 -11
- atcdr/logout.py +4 -3
- atcdr/markdown.py +9 -5
- atcdr/open.py +5 -4
- atcdr/submit.py +21 -24
- atcdr/test.py +21 -16
- atcdr/util/fileops.py +5 -4
- atcdr/util/gpt.py +10 -12
- atcdr/util/i18n.py +317 -0
- atcdr/util/parse.py +16 -11
- atcdr/util/problem.py +3 -2
- atcdr/util/session.py +15 -14
- atcoderstudybooster-0.4.1.dist-info/METADATA +248 -0
- atcoderstudybooster-0.4.1.dist-info/RECORD +22 -0
- atcoderstudybooster-0.4.0.dist-info/METADATA +0 -261
- atcoderstudybooster-0.4.0.dist-info/RECORD +0 -21
- {atcoderstudybooster-0.4.0.dist-info → atcoderstudybooster-0.4.1.dist-info}/WHEEL +0 -0
- {atcoderstudybooster-0.4.0.dist-info → atcoderstudybooster-0.4.1.dist-info}/entry_points.txt +0 -0
atcdr/util/session.py
CHANGED
@@ -9,6 +9,7 @@ from rich.panel import Panel
|
|
9
9
|
from rich.syntax import Syntax
|
10
10
|
from rich.table import Table
|
11
11
|
|
12
|
+
from atcdr.util.i18n import _
|
12
13
|
from atcdr.util.parse import get_username_from_html
|
13
14
|
|
14
15
|
COOKIE_PATH = os.path.join(os.path.expanduser('~'), '.cache', 'atcdr', 'session.json')
|
@@ -19,18 +20,18 @@ def print_rich_response(
|
|
19
20
|
response: requests.Response, body_range: tuple = (0, 24)
|
20
21
|
) -> None:
|
21
22
|
# レスポンス情報をテーブル形式で表示
|
22
|
-
info_table = Table(title='
|
23
|
-
info_table.add_column('
|
24
|
-
info_table.add_column('
|
23
|
+
info_table = Table(title=_('response_info'))
|
24
|
+
info_table.add_column(_('item'), justify='left', style='cyan', no_wrap=True)
|
25
|
+
info_table.add_column(_('content'), justify='left', style='magenta')
|
25
26
|
info_table.add_row('URL', response.url)
|
26
|
-
info_table.add_row('
|
27
|
-
info_table.add_row('
|
27
|
+
info_table.add_row(_('status_code'), str(response.status_code))
|
28
|
+
info_table.add_row(_('reason'), response.reason)
|
28
29
|
info_table = Align.center(info_table)
|
29
30
|
|
30
31
|
# ヘッダー情報をテーブル形式で表示
|
31
|
-
header_table = Table(title='
|
32
|
-
header_table.add_column('
|
33
|
-
header_table.add_column('
|
32
|
+
header_table = Table(title=_('response_headers'))
|
33
|
+
header_table.add_column(_('key'), style='cyan', no_wrap=True)
|
34
|
+
header_table.add_column(_('value'), style='magenta', overflow='fold')
|
34
35
|
for key, value in response.headers.items():
|
35
36
|
value = unquote(value)
|
36
37
|
header_table.add_row(key, value)
|
@@ -39,9 +40,9 @@ def print_rich_response(
|
|
39
40
|
# リダイレクトの歴史
|
40
41
|
redirect_table = None
|
41
42
|
if response.history:
|
42
|
-
redirect_table = Table(title='
|
43
|
-
redirect_table.add_column('
|
44
|
-
redirect_table.add_column('
|
43
|
+
redirect_table = Table(title=_('redirect_history'))
|
44
|
+
redirect_table.add_column(_('step'), style='cyan')
|
45
|
+
redirect_table.add_column(_('status_code'), style='magenta')
|
45
46
|
redirect_table.add_column('URL', style='green')
|
46
47
|
for i, redirect_response in enumerate(response.history):
|
47
48
|
redirect_table.add_row(
|
@@ -80,7 +81,7 @@ def print_rich_response(
|
|
80
81
|
if response.text
|
81
82
|
else None
|
82
83
|
)
|
83
|
-
body_panel = Panel(body, title='
|
84
|
+
body_panel = Panel(body, title=_('response_body')) if body else None
|
84
85
|
|
85
86
|
print(info_table)
|
86
87
|
print(header_table)
|
@@ -102,7 +103,7 @@ def load_session() -> requests.Session:
|
|
102
103
|
response = session.get(ATCODER_URL)
|
103
104
|
username = get_username_from_html(response.text)
|
104
105
|
if username:
|
105
|
-
print(
|
106
|
+
print(_('hello_user', username))
|
106
107
|
return session
|
107
108
|
else:
|
108
109
|
return requests.Session()
|
@@ -131,7 +132,7 @@ def validate_session(session: requests.Session) -> bool:
|
|
131
132
|
return False
|
132
133
|
return False
|
133
134
|
except requests.RequestException as e:
|
134
|
-
print(
|
135
|
+
print('[red][-][/] ' + _('session_check_error', e))
|
135
136
|
return False
|
136
137
|
|
137
138
|
|
@@ -0,0 +1,248 @@
|
|
1
|
+
Metadata-Version: 2.3
|
2
|
+
Name: AtCoderStudyBooster
|
3
|
+
Version: 0.4.1
|
4
|
+
Summary: A tool to download and manage AtCoder problems.
|
5
|
+
Project-URL: Homepage, https://github.com/yuta6/AtCoderStudyBooster
|
6
|
+
Author-email: yuta6 <46110512+yuta6@users.noreply.github.com>
|
7
|
+
License: MIT
|
8
|
+
Requires-Python: >=3.8
|
9
|
+
Requires-Dist: beautifulsoup4
|
10
|
+
Requires-Dist: click-aliases>=1.0.5
|
11
|
+
Requires-Dist: markdownify==0.13.1
|
12
|
+
Requires-Dist: pywebview>=5.4
|
13
|
+
Requires-Dist: questionary>=2.0.1
|
14
|
+
Requires-Dist: requests
|
15
|
+
Requires-Dist: rich-click>=1.8.8
|
16
|
+
Requires-Dist: rich>=13.7.1
|
17
|
+
Requires-Dist: tiktoken
|
18
|
+
Requires-Dist: types-beautifulsoup4>=4.12.0.20240511
|
19
|
+
Requires-Dist: types-requests>=2.32.0.20240712
|
20
|
+
Description-Content-Type: text/markdown
|
21
|
+
|
22
|
+
# AtCoderStudyBooster
|
23
|
+
|
24
|
+
[日本語版 README はこちら](README.ja.md)
|
25
|
+
|
26
|
+
## Overview
|
27
|
+
|
28
|
+
🚧 This project is still in experimental stage. We are continuously adding features to help with daily AtCoder practice.
|
29
|
+
|
30
|
+

|
31
|
+
|
32
|
+
AtCoderStudyBooster is a CLI tool designed to accelerate your AtCoder learning journey. It supports downloading problems locally, testing, submitting, and generating solutions. Python installation is required. If you have Python installed, you can install this tool with:
|
33
|
+
|
34
|
+
```sh
|
35
|
+
pip install AtCoderStudyBooster
|
36
|
+
```
|
37
|
+
|
38
|
+
(Python 3.8 or higher is required)
|
39
|
+
|
40
|
+
Even after CAPTCHA authentication was introduced, you can still login and submit semi-automatically from CLI. However, you need to manually solve the CAPTCHA through GUI. This tool does not bypass CAPTCHA authentication.
|
41
|
+
|
42
|
+
This project is strongly influenced by:
|
43
|
+
- [online-judge-tools](https://github.com/online-judge-tools)
|
44
|
+
- [atcoder-cli](https://github.com/Tatamo/atcoder-cli)
|
45
|
+
|
46
|
+
## Use Cases
|
47
|
+
|
48
|
+
Let's start by using the `download` command to download problems locally.
|
49
|
+
|
50
|
+
### 1. Download a Specific Contest
|
51
|
+
|
52
|
+
Examples for downloading problems from a single contest.
|
53
|
+
|
54
|
+
#### Download all problems from ABC350
|
55
|
+
```sh
|
56
|
+
❯ atcdr download abc350
|
57
|
+
```
|
58
|
+
|
59
|
+
#### Download problems A-D from ABC350
|
60
|
+
```sh
|
61
|
+
❯ atcdr download abc350 {A..D}
|
62
|
+
```
|
63
|
+
|
64
|
+
#### Download Typical 90 Problems
|
65
|
+
```sh
|
66
|
+
❯ atcdr download typical90
|
67
|
+
```
|
68
|
+
|
69
|
+
### 2. Batch Download Multiple Contests
|
70
|
+
|
71
|
+
Examples for downloading multiple contests at once. Utilizes bash brace expansion.
|
72
|
+
|
73
|
+
#### All problems from ABC001 to ABC010
|
74
|
+
```sh
|
75
|
+
❯ atcdr download abc{001..010}
|
76
|
+
```
|
77
|
+
|
78
|
+
#### Specific problems from multiple contests
|
79
|
+
```sh
|
80
|
+
❯ atcdr download abc{301..310} {A..C}
|
81
|
+
```
|
82
|
+
|
83
|
+
### 3. Download Specific Difficulty Problems
|
84
|
+
|
85
|
+
Examples for collecting problems of the same difficulty across different contests.
|
86
|
+
|
87
|
+
#### Download all A problems from ABC301-310
|
88
|
+
```sh
|
89
|
+
❯ atcdr download A abc{301..310}
|
90
|
+
```
|
91
|
+
|
92
|
+
This creates the following directory structure:
|
93
|
+
```
|
94
|
+
A/
|
95
|
+
├── abc301/
|
96
|
+
│ ├── Problem.html
|
97
|
+
│ └── Problem.md
|
98
|
+
├── abc302/
|
99
|
+
│ ├── Problem.html
|
100
|
+
│ └── Problem.md
|
101
|
+
└── ...
|
102
|
+
```
|
103
|
+
|
104
|
+
#### Download all B problems from ABC300-302
|
105
|
+
```sh
|
106
|
+
❯ atcdr download B abc{300..302}
|
107
|
+
```
|
108
|
+
|
109
|
+
Creates:
|
110
|
+
```
|
111
|
+
B/
|
112
|
+
├── abc300/
|
113
|
+
│ ├── Problem.html
|
114
|
+
│ └── Problem.md
|
115
|
+
├── abc301/
|
116
|
+
│ ├── Problem.html
|
117
|
+
│ └── Problem.md
|
118
|
+
└── abc302/
|
119
|
+
├── Problem.html
|
120
|
+
└── Problem.md
|
121
|
+
```
|
122
|
+
This directory structure allows you to efficiently practice problems of the same difficulty level in one place.
|
123
|
+
|
124
|
+
### Solving Problems
|
125
|
+
|
126
|
+
You can view problems by opening Markdown or HTML files with VS Code's HTML Preview or Markdown Preview. In VS Code, you can display the text editor on the left and work on problems while viewing them on the right.
|
127
|
+
|
128
|
+
### Testing Samples Locally
|
129
|
+
|
130
|
+
Navigate to the folder where you downloaded the problem.
|
131
|
+
|
132
|
+
```sh
|
133
|
+
❯ cd abc224/B
|
134
|
+
```
|
135
|
+
|
136
|
+
After creating your solution file in the folder, run the test command to test against sample cases.
|
137
|
+
|
138
|
+
```sh
|
139
|
+
~/.../abc224/B
|
140
|
+
❯ atcdr t
|
141
|
+
```
|
142
|
+
|
143
|
+
For Wrong Answer (WA) cases, the display looks like this:
|
144
|
+
|
145
|
+
### Submitting Solutions
|
146
|
+
|
147
|
+
```sh
|
148
|
+
~/.../abc224/B
|
149
|
+
❯ atcdr s
|
150
|
+
```
|
151
|
+
|
152
|
+
Running this command will submit your solution. Login to AtCoder website is required for submission.
|
153
|
+
|
154
|
+
### Generating Solutions with GPT
|
155
|
+
|
156
|
+
```sh
|
157
|
+
~/.../abc224/B
|
158
|
+
❯ atcdr g
|
159
|
+
```
|
160
|
+
|
161
|
+
This command generates a solution using OpenAI's GPT model. An OpenAI API key is required. On first run, you'll be prompted to input your API key.
|
162
|
+
|
163
|
+
### Login to AtCoder
|
164
|
+
|
165
|
+
```sh
|
166
|
+
❯ atcdr login
|
167
|
+
```
|
168
|
+
|
169
|
+
Logs into AtCoder. A browser window will open for CAPTCHA verification. After solving the CAPTCHA, login completes automatically.
|
170
|
+
|
171
|
+
### Create Markdown File
|
172
|
+
|
173
|
+
```sh
|
174
|
+
~/.../abc224/B
|
175
|
+
❯ atcdr m
|
176
|
+
```
|
177
|
+
|
178
|
+
Creates a Markdown file from the HTML file in the current directory. This command is automatically executed during `atcdr download`.
|
179
|
+
|
180
|
+
### Open Problem in Browser
|
181
|
+
|
182
|
+
```sh
|
183
|
+
~/.../abc224/B
|
184
|
+
❯ atcdr o
|
185
|
+
```
|
186
|
+
|
187
|
+
Opens the problem page in your browser. Convenient for checking detailed problem statements or constraints.
|
188
|
+
|
189
|
+
## Commands
|
190
|
+
|
191
|
+
| Command | Alias | Description |
|
192
|
+
|---------|-------|-------------|
|
193
|
+
| `atcdr download` | `atcdr d` | Download problems |
|
194
|
+
| `atcdr test` | `atcdr t` | Test with sample cases |
|
195
|
+
| `atcdr submit` | `atcdr s` | Submit solution |
|
196
|
+
| `atcdr generate` | `atcdr g` | Generate solution with GPT |
|
197
|
+
| `atcdr login` | - | Login to AtCoder |
|
198
|
+
| `atcdr logout` | - | Logout from AtCoder |
|
199
|
+
| `atcdr markdown` | `atcdr m` | Create Markdown file |
|
200
|
+
| `atcdr open` | `atcdr o` | Open problem in browser |
|
201
|
+
|
202
|
+
## GPT Code Generation
|
203
|
+
|
204
|
+
`atcdr generate` command uses GPT to generate solutions. It requires an OpenAI API key.
|
205
|
+
|
206
|
+
### Generate Solution with Test
|
207
|
+
|
208
|
+
By default, generated code is tested against sample cases:
|
209
|
+
|
210
|
+
```sh
|
211
|
+
~/.../abc224/B
|
212
|
+
❯ atcdr generate
|
213
|
+
```
|
214
|
+
|
215
|
+
### Specify Language
|
216
|
+
|
217
|
+
Specify the programming language for generation. Default is Python.
|
218
|
+
|
219
|
+
```sh
|
220
|
+
~/.../abc224/B
|
221
|
+
❯ atcdr generate --lang cpp
|
222
|
+
```
|
223
|
+
|
224
|
+
Supported languages:
|
225
|
+
- `python` (default)
|
226
|
+
- `cpp`
|
227
|
+
- `java`
|
228
|
+
- `rust`
|
229
|
+
|
230
|
+
### Specify GPT Model
|
231
|
+
|
232
|
+
```sh
|
233
|
+
~/.../abc224/B
|
234
|
+
❯ atcdr generate --gpt gpt-4o
|
235
|
+
```
|
236
|
+
|
237
|
+
Available models:
|
238
|
+
- `gpt-4o-mini` (default) - Fast and cost-effective
|
239
|
+
- `gpt-4o` - More accurate but slower
|
240
|
+
|
241
|
+
### Generate Code Only Without Testing
|
242
|
+
|
243
|
+
To generate code without testing:
|
244
|
+
|
245
|
+
```sh
|
246
|
+
~/.../abc224/B
|
247
|
+
❯ atcdr generate --lang rust --without_test
|
248
|
+
```
|
@@ -0,0 +1,22 @@
|
|
1
|
+
atcdr/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
|
+
atcdr/cli.py,sha256=xiCnGf14VHtLcRlVHXNpLKW3FIxOHS2duTRDTsG8a5w,2595
|
3
|
+
atcdr/download.py,sha256=sMILF_FKLTe3OBk_ZnA8pzvnlGz68jrHaU-lxDAy6pA,7678
|
4
|
+
atcdr/generate.py,sha256=FBOPJ2wU827GzkmYxsFrZKJYKXVC_h675_9-mZ7wRdc,7899
|
5
|
+
atcdr/login.py,sha256=3lyuo19EKOj3eaiOcOUnrkkgEEqWO0D1EnjLPKNxkPU,4655
|
6
|
+
atcdr/logout.py,sha256=XwyR5oSipg-iQzfdfkx4Cs0Q88ZWJ548FmdhlIhpUL8,777
|
7
|
+
atcdr/markdown.py,sha256=x0OORs1eun14c0XZWUap6HljTHhJ6UM6OfkJlDXeeSo,1587
|
8
|
+
atcdr/open.py,sha256=bxfoUGO0yo3BK1C9iswuN65GW_wp6OEa58IX7JgWAFU,1319
|
9
|
+
atcdr/submit.py,sha256=vVGZ-04K7NtjL5jv79Wx8IWosVK44XwEDCK19QAkKAo,9604
|
10
|
+
atcdr/test.py,sha256=tbjkBETQG48AuH1F_hBlla3lpfcQiVvFO1YjZ2QDB9A,13518
|
11
|
+
atcdr/util/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
12
|
+
atcdr/util/fileops.py,sha256=kvQDO85Ii5n__Wo8KmoE6Ecgbxx9MfmF7BDYz1sL5Sk,3200
|
13
|
+
atcdr/util/filetype.py,sha256=pceB08trkwNkdzKJx4fFfOWpz9jYMBRDwXLW4un0sRM,2254
|
14
|
+
atcdr/util/gpt.py,sha256=GNJqgV-eVQlxkQ3tnwNiGec27FV6O4QSpwaDiXbFM0w,3392
|
15
|
+
atcdr/util/i18n.py,sha256=WRptkwqRSYSpA7L2CeWwv4ufv_uK65KjnorAcOTOot8,17949
|
16
|
+
atcdr/util/parse.py,sha256=fo_LtEXLwz0g3871iUKZFHMitxbBh-bz9uBndpKfQeI,7130
|
17
|
+
atcdr/util/problem.py,sha256=ZLD-WvhC5SC6TGbyqmiOpTVZVSn-KuhOazWvAvHdyqI,1222
|
18
|
+
atcdr/util/session.py,sha256=xct266SY7QuC3bc1IKlkVginttvXE_qK5tepUx6hfWE,4820
|
19
|
+
atcoderstudybooster-0.4.1.dist-info/METADATA,sha256=yV1OZY9piILs7WW_qfKEsGk_az03Vh4ehgrbq1iO-nQ,6077
|
20
|
+
atcoderstudybooster-0.4.1.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
|
21
|
+
atcoderstudybooster-0.4.1.dist-info/entry_points.txt,sha256=-stL-IwnheQGlYAdm82RuZu8CGgSakU0aVIVlA7DmFA,40
|
22
|
+
atcoderstudybooster-0.4.1.dist-info/RECORD,,
|
@@ -1,261 +0,0 @@
|
|
1
|
-
Metadata-Version: 2.3
|
2
|
-
Name: AtCoderStudyBooster
|
3
|
-
Version: 0.4.0
|
4
|
-
Summary: A tool to download and manage AtCoder problems.
|
5
|
-
Project-URL: Homepage, https://github.com/yuta6/AtCoderStudyBooster
|
6
|
-
Author-email: yuta6 <46110512+yuta6@users.noreply.github.com>
|
7
|
-
License: MIT
|
8
|
-
Requires-Python: >=3.8
|
9
|
-
Requires-Dist: beautifulsoup4
|
10
|
-
Requires-Dist: click-aliases>=1.0.5
|
11
|
-
Requires-Dist: markdownify==0.13.1
|
12
|
-
Requires-Dist: pywebview>=5.4
|
13
|
-
Requires-Dist: questionary>=2.0.1
|
14
|
-
Requires-Dist: requests
|
15
|
-
Requires-Dist: rich-click>=1.8.8
|
16
|
-
Requires-Dist: rich>=13.7.1
|
17
|
-
Requires-Dist: tiktoken
|
18
|
-
Requires-Dist: types-beautifulsoup4>=4.12.0.20240511
|
19
|
-
Requires-Dist: types-requests>=2.32.0.20240712
|
20
|
-
Description-Content-Type: text/markdown
|
21
|
-
|
22
|
-
# AtCoderStudyBooster
|
23
|
-
|
24
|
-
## 概要
|
25
|
-
|
26
|
-
🚧 このプロジェクトはまだ実験段階です。日々のAtCoder学習に役立つ機能を順次追加しています。
|
27
|
-
|
28
|
-
AtCoderStudyBoosterはAtCoderの学習を加速させるためのCLIツールです。問題をローカルにダウンロードし、テスト、提出、解答の作成をサポートするツールです。Pythonが入っていることが必須です。Pythonが入っている環境なら、
|
29
|
-
|
30
|
-
```sh
|
31
|
-
pip install AtCoderStudyBooster
|
32
|
-
```
|
33
|
-
|
34
|
-
でインストールできます。(Python3.8以上が必要です)
|
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)
|
41
|
-
|
42
|
-
## 利用ケース
|
43
|
-
|
44
|
-
まずは`download`コマンドを利用して問題をローカルにダウンロードしてみましょう。
|
45
|
-
|
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}
|
58
|
-
```
|
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
|
-
|
148
|
-
### 問題を解く
|
149
|
-
|
150
|
-
MarkdownファイルあるいはHTMLファイルをVS CodeのHTML Preview, Markdown Previewで開くと問題を確認できます。VS Codeで開くと左側にテキストエディターを表示して、右側で問題をみながら問題に取り組めます。
|
151
|
-
|
152
|
-

|
153
|
-
|
154
|
-
### サンプルをローカルでテストする
|
155
|
-
|
156
|
-
問題をダウンロードしたフォルダーに移動します。
|
157
|
-
|
158
|
-
```sh
|
159
|
-
❯ cd abc224/B
|
160
|
-
```
|
161
|
-
|
162
|
-
移動したフォルダーで解答ファイルを作成後、testコマンドを実行すると、サンプルケースをテストします。
|
163
|
-
|
164
|
-
```sh
|
165
|
-
~/.../abc224/B
|
166
|
-
❯ atcdr t
|
167
|
-
```
|
168
|
-
|
169
|
-

|
170
|
-
|
171
|
-
WAの場合は以下のような表示になります。
|
172
|
-
|
173
|
-

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

|
213
|
-
|
214
|
-
### 複数のファイルを一度にテスト
|
215
|
-
|
216
|
-
```sh
|
217
|
-
~/.../abc224/B
|
218
|
-
❯ atcdr t *.py
|
219
|
-
```
|
220
|
-
|
221
|
-
でフォルダー内にあるすべてのPythonファイルを一度にテストします。
|
222
|
-
|
223
|
-
```sh
|
224
|
-
~/.../abc224/B
|
225
|
-
❯ atcdr t mon.py mon.c mon.cpp
|
226
|
-
```
|
227
|
-
|
228
|
-
フォルダー内に複数ファイルある場合は、インタラクティブに選択できます。
|
229
|
-
|
230
|
-
```sh
|
231
|
-
~/.../abc224/B
|
232
|
-
❯ atcdr t
|
233
|
-
```
|
234
|
-
|
235
|
-
```sh
|
236
|
-
~/.../abc224/B
|
237
|
-
❯ atcdr t
|
238
|
-
複数のファイルが見つかりました.ファイルを選択してください:
|
239
|
-
十字キーで移動, [enter]で実行
|
240
|
-
❯❯❯ mon.py
|
241
|
-
mon.c
|
242
|
-
mon.cpp
|
243
|
-
```
|
244
|
-
|
245
|
-
### プログラミング言語を指定してコードを生成
|
246
|
-
|
247
|
-
`--lang`オプションを使うと、生成したいプログラミング言語を指定できます。
|
248
|
-
|
249
|
-
```sh
|
250
|
-
~/.../abc224/B
|
251
|
-
❯ atcdr generate --lang rust
|
252
|
-
```
|
253
|
-
|
254
|
-
### テストをせずにコードのみ生成
|
255
|
-
|
256
|
-
デフォルトで`atcdr generate`コマンドは生成されたコードをテストしますが、テストせずにコードのみ生成できます。
|
257
|
-
|
258
|
-
```sh
|
259
|
-
~/.../abc224/B
|
260
|
-
❯ atcdr generate --lang rust --without_test
|
261
|
-
```
|
@@ -1,21 +0,0 @@
|
|
1
|
-
atcdr/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
|
-
atcdr/cli.py,sha256=xiCnGf14VHtLcRlVHXNpLKW3FIxOHS2duTRDTsG8a5w,2595
|
3
|
-
atcdr/download.py,sha256=R7hdhYupw3hppqjKpt7kchT-V2AJqHypitfb2qIwvtU,7926
|
4
|
-
atcdr/generate.py,sha256=i-rznjOQpBcAmlI0CGGC8CEY3Nx35SoxQgGaPSh6Oz8,8183
|
5
|
-
atcdr/login.py,sha256=gro9gj-nF4pGz4KepkaNSMj8PRGdSJtaVcBe7YKUPzU,4697
|
6
|
-
atcdr/logout.py,sha256=WYFifFDZtdcFZ0z3BhqsmdK_JbufjmBdF4q5dDkLbHQ,753
|
7
|
-
atcdr/markdown.py,sha256=RpYdXMWgBd2qcMj-WmUrSyF0VdLfyUms-FsTRXfdgRw,1485
|
8
|
-
atcdr/open.py,sha256=aRmhg7_TcZU6iPBM0u7lUQhTpPF5Eo227MxS3JUSm1M,1293
|
9
|
-
atcdr/submit.py,sha256=T579xpIyLeXp69D8UW_2mNC8vcjJ3d-iFT9rJvoVJ7I,9975
|
10
|
-
atcdr/test.py,sha256=y9ENvL4Gdirup07tfFBjJJXA-HeiWZpSW1ncpNwiKOs,13672
|
11
|
-
atcdr/util/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
12
|
-
atcdr/util/fileops.py,sha256=jxJ_d-R3XG-CLQemwwxgeNQcvNAE_7Q-3nOQ1npG3ig,3293
|
13
|
-
atcdr/util/filetype.py,sha256=pceB08trkwNkdzKJx4fFfOWpz9jYMBRDwXLW4un0sRM,2254
|
14
|
-
atcdr/util/gpt.py,sha256=vH10Waa7KXlz6-5pEUBuIbxTbDH3Hys7k9Tt7prvFX4,3772
|
15
|
-
atcdr/util/parse.py,sha256=SJ4khlH5iWaSwyORmQLi84npMwh5u2omCeg0q7ScEAE,6974
|
16
|
-
atcdr/util/problem.py,sha256=OERGf1uw4DIe4ZA6OPwt2ASoMxho2ped5HZ4fIb2XSE,1189
|
17
|
-
atcdr/util/session.py,sha256=LwlSN86sfnkE9a-opL4qvKYHsCgiMy7eFCdcXdo79eg,4889
|
18
|
-
atcoderstudybooster-0.4.0.dist-info/METADATA,sha256=J5wZhLmMh333Kgcaz_QBPQQIc6UB_BMZlbu_zKwsqEU,7641
|
19
|
-
atcoderstudybooster-0.4.0.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
|
20
|
-
atcoderstudybooster-0.4.0.dist-info/entry_points.txt,sha256=-stL-IwnheQGlYAdm82RuZu8CGgSakU0aVIVlA7DmFA,40
|
21
|
-
atcoderstudybooster-0.4.0.dist-info/RECORD,,
|
File without changes
|
{atcoderstudybooster-0.4.0.dist-info → atcoderstudybooster-0.4.1.dist-info}/entry_points.txt
RENAMED
File without changes
|