This repository make it possible for programmers to create C++ programming contest environment by 2-Click.
It is very tedious job to install all necessary compilers and tools to local computer. There might be some errors to overcome to submit C++ program to programming contest service. What programmers want to do is not developping environment but developping program.
This repository uses VSCode Dev Container to create the environment with 2-Click.
- Windows 10
- Mac with Intel Chip
- Mac with Apple Chip
Install the following applications.
Open this repository with VSCode. Click left bottom corner of the VSCode window as follows, then choose "Reopen in Container".
Wait for a while. After builds and setups, you can write code in dev container environment. (First time, it takes for long time, but next time, it's quick to open the environment.)
This environment contains the following tools.
For example, let's solve AtCoder Library Practice Contest .
There are three tasks to do.
- Login (Once)
- Download problem
- Solve and submit
First, login to the contest page to submit code afterwards.
To login/download/submit problem, the dev container uses oj
tool.
In this repository, there is the specific VSCode task to login contest site.
Choose Terminal -> Run Task
from VSCode menu, then choose login
.
You should enter, https://atcoder.jp/contests/practice2
as url, your atcoder username
as password and your atcoder password
as password. If you haven't created account, please create it for register.
Second, choose Terminal -> Run Task
from VSCode menu, then choose download code
.
Enter the problem URL https://atcoder.jp/contests/practice2
to the input and click enter.
Inside the task, oj-prepare https://atcoder.jp/contests/practice2
is executed, automatically problem set is donwloaded to under contest/atcoder.jp/practice2
directory.
Open, contest/atcoder.jp/practice2/practice2_a/main.cpp
in VSCode, then solve the problem.
Lastly, you can submit the code to AtCoder.
Choose Terminal -> Run Task
from VSCode menu while opening the solved main.cpp
code, then choose submit code
.
Boom! The code is tested and submitted to the contest. If it has any error, you can see it on Terminal.
To debug code, click Run start Debugging
in menu while opening code.
Then, input should be put in terminal. The following shows how to debug the code.
cpp-env.mp4
Any file under content
directory, it is ignored by .gitignore
.
You can delete contest
line from .gitignore
to commit these files.