基本上記の通りにやったらいい感じになりました。一部自分なりの設定に変えたりした部分があったのでメモ。
{
"version": "2.0.0",
"tasks": [
{
"label": "c++ build for AtCoder",
"type": "shell",
"command": "g++",
"args": [
"-g",
"-O0",
"${file}",
"-o",
"${fileDirname}/${fileBasenameNoExtension}.out"
],
"options": {
"cwd": "${fileDirname}"
},
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
{
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) Launch",
"type": "cppdbg",
"preLaunchTask": "c++ build for AtCoder",
"request": "launch",
"program": "${fileDirname}/${fileBasenameNoExtension}.out",
"args": [],
"stopAtEntry": false,
"cwd": "${fileDirname}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
},
{
"description": "Set Disassembly Flavor to Intel",
"text": "-gdb-set disassembly-flavor intel",
"ignoreFailures": true
}
]
}
]
}
"command-runner.commands": {
"oj test": "cd ${fileDirname} && g++ main.cpp -o main.out && oj test -c ${fileDirname}/main.out -d ${fileDirname}/tests",
"acc submit": "cd ${fileDirname} && acc submit ${file}"
}
acc はこれ のことです。
acc new abc123
acc add
> acc config-dir
/home/dev/.config/atcoder-cli-nodejs
> tree $(acc config-dir)
/home/dev/.config/atcoder-cli-nodejs
├── config.json
├── session.json
└── template1
├── main.cpp
└── template.json