Skip to content

Commit 9b261ba

Browse files
committed
bug fix issue #2
1 parent 1d6f30d commit 9b261ba

File tree

18 files changed

+162
-68
lines changed

18 files changed

+162
-68
lines changed

.devcontainer/Dockerfile

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
FROM ubuntu:20.04
2+
3+
ENV DEBIAN_FRONTEND=noninteractive
4+
5+
RUN apt update \
6+
&& apt -y upgrade \
7+
#
8+
# ロケールの設定(これは要らないかもしれない)
9+
&& apt -y install --no-install-recommends \
10+
language-pack-ja \
11+
&& update-locale LANG=ja_JP.UTF-8 \
12+
#
13+
# g++9 のインストールを進める
14+
&& apt -y install --no-install-recommends \
15+
build-essential \
16+
manpages-dev \
17+
software-properties-common \
18+
&& add-apt-repository ppa:ubuntu-toolchain-r/test \
19+
&& apt -y install --no-install-recommends \
20+
gcc-9 \
21+
g++-9 \
22+
gdb \
23+
&& update-alternatives --install \
24+
/usr/bin/gcc gcc /usr/bin/gcc-9 90 \
25+
--slave /usr/bin/g++ g++ /usr/bin/g++-9 \
26+
--slave /usr/bin/gcov gcov /usr/bin/gcov-9 \
27+
#
28+
# boost のインストール
29+
&& apt -y install --no-install-recommends libboost-all-dev \
30+
#
31+
#
32+
&& apt install -y python3-pip \
33+
#
34+
# online-judge-toolsのインストール
35+
&& pip3 install online-judge-tools \
36+
#
37+
# atcoder-cliのインストール
38+
&& apt install -y npm \
39+
&& npm install -g atcoder-cli \
40+
#
41+
# Clean up
42+
&& apt autoremove -y \
43+
&& apt clean -y
44+
45+
ENV DEBIAN_FRONTEND=dialog

.devcontainer/devcontainer.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"name": "Existing Docker Compose (Extend)",
3+
"dockerComposeFile": [
4+
"docker-compose.yml"
5+
],
6+
7+
"service": "atcoder",
8+
"workspaceFolder": "/root",
9+
"settings": {
10+
"terminal.integrated.shell.linux": "/bin/bash"
11+
},
12+
"extensions": [
13+
"ms-vscode.cpptools",
14+
]
15+
}

docker-compose.yml renamed to .devcontainer/docker-compose.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,5 @@ services:
55
container_name: 'atcoder'
66
tty: true
77
volumes:
8-
- ./contests:/contests
9-
- ./config:/root/.config/atcoder-cli-nodejs/
8+
- ../:/root/
109

.gitignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
/contests/
2-
session.json
3-
settings.json
2+
.*
3+
!.devcontainer
4+
!.vscode

.vscode/launch.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
// IntelliSense を使用して利用可能な属性を学べます。
3+
// 既存の属性の説明をホバーして表示します。
4+
// 詳細情報は次を確認してください: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"name": "(gdb) Launch",
9+
"type": "cppdbg",
10+
"request": "launch",
11+
"program": "${workspaceRoot}/a.out",
12+
"args": [],
13+
"stopAtEntry": false,
14+
"cwd": "${workspaceFolder}",
15+
"environment": [],
16+
"externalConsole": false,
17+
"MIMode": "gdb",
18+
"miDebuggerPath": "/usr/bin/gdb",
19+
"setupCommands": [
20+
{
21+
"description": "gdb の再フォーマットを有効にする",
22+
"text": "-enable-pretty-printing",
23+
"ignoreFailures": true
24+
}
25+
]
26+
}
27+
]
28+
}

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"editor.formatOnSave": true, // 保存のたびにコードを整形する
3+
}

.vscode/snippets.code-snippets

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
// Place your snippets for cpp here. Each snippet is defined under a snippet name and has a prefix, body and
3+
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
4+
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
5+
// same ids are connected.
6+
// Example:
7+
// "Print to console": {
8+
// "prefix": "log",
9+
// "body": [
10+
// "console.log('$1');",
11+
// "$2"
12+
// ],
13+
// "description": "Log output to console"
14+
// }
15+
"Kyopro": {
16+
"prefix": "kyopro",
17+
"body": [
18+
"#include <bits/stdc++.h>",
19+
"using namespace std;",
20+
"",
21+
"int main() {",
22+
"",
23+
" return 0;",
24+
"}",
25+
]
26+
}
27+
}

.vscode/tasks.json

Lines changed: 37 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
{
2-
// See https://go.microsoft.com/fwlink/?LinkId=733558
3-
// for the documentation about the tasks.json format
42
"version": "2.0.0",
53
"tasks": [
64
{
@@ -13,34 +11,52 @@
1311
"panel": "shared"
1412
}
1513
},
16-
{
17-
"label": "competitiveCompile",
18-
"type": "shell",
19-
"command": "/bin/bash scripts/compile.sh ${fileDirname}",
20-
"presentation": {
21-
"reveal": "always",
22-
"focus": true,
23-
"panel": "shared"
24-
}
25-
},
26-
{
14+
// {
15+
// "label": "competitiveCompile",
16+
// "type": "shell",
17+
// "command": "/bin/bash scripts/compile.sh ${fileDirname}",
18+
// "presentation": {
19+
// "reveal": "always",
20+
// "focus": true,
21+
// "panel": "shared"
22+
// }
23+
// },
24+
{ // テスト実行(online-judge)
2725
"label": "competitiveTestSample",
2826
"type": "shell",
29-
"command": "/bin/bash scripts/test.sh ${fileDirname}",
27+
"command": "cd ${fileDirname} && oj t",
3028
"presentation": {
3129
"reveal": "always",
3230
"focus": true,
3331
"panel": "shared"
3432
}
3533
},
36-
{
37-
"label": "competitiveSubmit",
34+
// {
35+
// "label": "competitiveSubmit",
36+
// "type": "shell",
37+
// "command": "/bin/bash scripts/submit.sh ${fileDirname}",
38+
// "presentation": {
39+
// "reveal": "always",
40+
// "focus": true,
41+
// "panel": "shared"
42+
// }
43+
// },
44+
{ // コンパイル (C++17)
3845
"type": "shell",
39-
"command": "/bin/bash scripts/submit.sh ${fileDirname}",
40-
"presentation": {
41-
"reveal": "always",
42-
"focus": true,
43-
"panel": "shared"
46+
"label": "build kyopro C++17",
47+
"command": "/usr/bin/g++",
48+
"args": [
49+
"-ggdb",
50+
"-Wall",
51+
"-std=gnu++17",
52+
"-march=native",
53+
"-mtune=native",
54+
// "main.cpp",
55+
"${relativeFile}"
56+
],
57+
"group": {
58+
"kind": "build",
59+
"isDefault": true
4460
}
4561
}
4662
]

Dockerfile

Lines changed: 0 additions & 7 deletions
This file was deleted.

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,6 @@
2626
## Other
2727
- tasks.jsonをvscodeでキーバインドしておくと上記スクリプトがショートカットから実行出来て便利です。
2828

29-
## Thanks
29+
## Shortcuts(個別に設定が必要)
30+
- コンパイル:Ctrl + Shift + B
31+
- テスト:Ctrl + T

0 commit comments

Comments
 (0)