{"id":3710,"date":"2022-11-25T09:16:38","date_gmt":"2022-11-25T00:16:38","guid":{"rendered":"https:\/\/p-corporate-blog-cms.mmmcorp.co.jp\/?p=3710"},"modified":"2022-12-17T09:05:28","modified_gmt":"2022-12-17T00:05:28","slug":"vscode-for-atcoder","status":"publish","type":"post","link":"https:\/\/p-corporate-blog-cms.mmmcorp.co.jp\/blog\/2022\/11\/25\/vscode-for-atcoder\/","title":{"rendered":"VSCode\u3067AtCoder\u7528\u74b0\u5883\u3092\u69cb\u7bc9\u3059\u308b"},"content":{"rendered":"
\u30a8\u30f3\u30b8\u30cb\u30a2\u306e\u5185\u5c71\u3067\u3059\u3002
\n\u5148\u65e5\u3001AWS\u8a8d\u5b9a\u8cc7\u683c\u306e\u5168\u51a0\u3092\u9054\u6210\u3057\u3066\u4e00\u6bb5\u843d\u3057\u305f\u306e\u3067\u3001\u7af6\u6280\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u306e\u6d3b\u52d5\u3092\u518d\u958b\u3057\u307e\u3057\u305f\u3002<\/p>\n
DWS\u3067\u306f\u7af6\u6280\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u90e8\u304c\u3042\u308a\u3001\u4e3b\u306bAtCoder\u3068\u3044\u3046\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u30b3\u30f3\u30c6\u30b9\u30c8\u30b5\u30a4\u30c8\u3092\u5229\u7528\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n
\u53c2\u8003<\/p>\n
\u7af6\u6280\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u90e8\u6d3b\u52d5\u3092\u306f\u3058\u3081\u307e\u3057\u305f<\/a><\/p>\n \u7af6\u30d7\u30ed\u3001\u304a\u3059\u3059\u3081\u3067\u3059<\/a><\/p>\n \u4eca\u56de\u306f\u3001VSCode\u3067AtCoder\u7528\u74b0\u5883\u3092\u69cb\u7bc9\u3059\u308b\u65b9\u6cd5\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n \u4eca\u56de\u306e\u8a18\u4e8b\u3067\u306f\u3001\u300cAtCoder Tools\u300d\u3068\u300cAtCoder Library\u300d\u3068\u3044\u3046\u30c4\u30fc\u30eb\u3092\u5c0e\u5165\u3059\u308b\u624b\u9806\u3068\u306a\u3063\u3066\u3044\u307e\u3059\u3002\u3053\u308c\u3089\u306e\u30c4\u30fc\u30eb\u3092\u5c0e\u5165\u3059\u308b\u3053\u3068\u306b\u3088\u308a\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u74b0\u5883\u304c\u3067\u304d\u3042\u304c\u308a\u307e\u3059\u3002<\/p>\n \u4ee5\u4e0b\u3001\u5404\u30c4\u30fc\u30eb\u306e\u7d39\u4ecb\u3068\u8a2d\u5b9a\u624b\u9806\u3092\u8a18\u8f09\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n A\uff54Coder Tools AtCoder Tools\u306f\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u6a5f\u80fd\u3092\u5099\u3048\u3066\u3044\u307e\u3059\u3002<\/p>\n \u672c\u8a18\u4e8b\u3067\u306f\u3001AtCoder Tools\u306e\u30b3\u30de\u30f3\u30c9\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3001VSCode\u304b\u3089\u30b7\u30e7\u30fc\u30c8\u30ab\u30c3\u30c8\u30ad\u30fc\u3067\u5b9f\u884c\u3067\u304d\u308b\u3088\u3046\u306b\u8a2d\u5b9a\u3057\u307e\u3059\u3002<\/p>\n AtCoder Library\u306f\u3001AtCoder\u793e\u304c\u7121\u6599\u3067\u914d\u5e03\u3057\u3066\u3044\u308b\u30e9\u30a4\u30d6\u30e9\u30ea\u3067\u3059\u3002 https:\/\/atcoder.github.io\/ac-library\/document_ja\/<\/a><\/p>\n \u672c\u8a18\u4e8b\u3067\u306f\u3001\u3053\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u4f7f\u3048\u308b\u3088\u3046\u306b\u3001\u30d1\u30b9\u306e\u8a2d\u5b9a\u3084\u30b3\u30f3\u30d1\u30a4\u30e9\u306b\u6e21\u3059\u5f15\u6570\u306e\u8a2d\u5b9a\u3092\u884c\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n Python3.8\u4ee5\u964d\u3067\u52d5\u4f5c\u3059\u308b\u30c4\u30fc\u30eb\u306e\u305f\u3081\u3001pip3\u30b3\u30de\u30f3\u30c9\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n \u3053\u306e\u30b3\u30de\u30f3\u30c9\u3067\u3001\u4f9d\u5b58\u30d1\u30c3\u30b1\u30fc\u30b8 \u53c2\u8003 \u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u5b8c\u4e86\u3059\u308b\u3068 \u4ee5\u4e0b\u306e\u30ea\u30f3\u30af\u304b\u3089zip\u30d5\u30a1\u30a4\u30eb\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u307e\u3059\u3002<\/p>\n https:\/\/atcoder.jp\/posts\/517<\/a><\/p>\n \u89e3\u51cd\u3057\u305f\u3089 \u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3092\u8a2d\u5b9a\u3057\u307e\u3059\u3002 \u4ee5\u4e0b\u306e\u5185\u5bb9\u3067\u3001 \u3053\u306e\u30d5\u30a1\u30a4\u30eb\u306e\u5185\u5bb9\u306f\u4e00\u4f8b\u306a\u306e\u3067\u3001\u5fc5\u8981\u306b\u5fdc\u3058\u3066\u7de8\u96c6\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n VSCode\u3092\u7acb\u3061\u4e0a\u3052\u307e\u3059\u3002<\/p>\n \u30b3\u30de\u30f3\u30c9\u30d1\u30ec\u30c3\u30c8( \u4ee5\u4e0b\u306e\u3088\u3046\u306a\u5185\u5bb9\u3067\u3001\u30bf\u30b9\u30af\u3092\u5b9a\u7fa9\u3057\u307e\u3059\u3002<\/p>\n \u30b3\u30de\u30f3\u30c9\u30d1\u30ec\u30c3\u30c8\u3067 \u3053\u306e\u8a2d\u5b9a\u306b\u3088\u308a\u3001\u4ee5\u4e0b\u306e\u30b7\u30e7\u30fc\u30c8\u30ab\u30c3\u30c8\u30ad\u30fc\u304c\u8ffd\u52a0\u3055\u308c\u307e\u3059\u3002<\/p>\n VSCode\u4e0a\u3067\u3001AtCoder Library\u95a2\u9023\u306e\u81ea\u52d5\u88dc\u5b8c\u304c\u52b9\u304f\u3088\u3046\u306b\u8a2d\u5b9a\u3057\u307e\u3059\u3002<\/p>\n \u30b3\u30de\u30f3\u30c9\u30d1\u30ec\u30c3\u30c8 \u4ee5\u4e0b\u306e\u753b\u50cf\u306e\u3088\u3046\u306b\u3001\u30a4\u30f3\u30af\u30eb\u30fc\u30c9\u30d1\u30b9\u3092\u8a2d\u5b9a\u3059\u308b\u9805\u76ee\u3092\u691c\u7d22\u3057\u3001\u4ee5\u4e0b\u306e\uff12\u3064\u306e\u8a2d\u5b9a\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n <\/p>\n \u4ee5\u4e0a\u3067\u3001\u4e00\u901a\u308a\u306e\u8a2d\u5b9a\u306f\u5b8c\u4e86\u3067\u3059\u3002<\/p>\n \u554f\u984c\u3092\u8aad\u307f\u8fbc\u3080\u306b\u306f\u3001\u30b3\u30f3\u30bd\u30fc\u30eb\u4e0a\u3067\u3001\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n <\/p>\n \u3042\u3068\u306f\u3001VSCode\u3067\u958b\u3044\u3066\u3001\u30b3\u30fc\u30c9\u3092\u66f8\u3044\u3066\u3044\u3063\u3066\u304f\u3060\u3055\u3044\u3002 VSCode + online-judge-tools + AtCoder Library\u306e\u74b0\u5883\u69cb\u7bc9\u6982\u8981<\/h2>\n
\n
AtCoder Tools\u3068\u306f<\/h2>\n
\nhttps:\/\/github.com\/kyuridenamida\/atcoder-tools<\/a><\/p>\n\n
AtCoder Library\u3068\u306f<\/h2>\n
\n\u7af6\u6280\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u3067\u3088\u304f\u4f7f\u308f\u308c\u308b\u30c7\u30fc\u30bf\u69cb\u9020\u3084\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u304c\u5b9f\u88c5\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\nAtCoder Tools\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h2>\n
$ pip3 install atcoder-tools<\/code><\/pre>\n
markupsafe<\/code>\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u304c
2.1.1<\/code>\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u307e\u3059\u3002
\n\u3053\u306e\u72b6\u614b\u3067atcoder-tools\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3068ImportError\u304c\u767a\u751f\u3059\u308b\u5834\u5408\u304c\u3042\u308a\u307e\u3059\u3002\u305d\u306e\u5834\u5408\u306f\u3001\u30d0\u30fc\u30b8\u30e7\u30f3\u30922.0.1<\/code>\u306b\u3057\u3066\u5165\u308c\u76f4\u3059\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n
$ pip3 uninstall markupsafe\n$ pip3 install markupsafe==2.0.1<\/code><\/pre>\n
\n\u89e3\u6c7a\u7b56\u3002ImportError: cannot import name 'soft_unicode' from 'markupsafe'<\/a><\/p>\natcoder-tools<\/code> \u30b3\u30de\u30f3\u30c9\u304c\u4f7f\u7528\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n
AtCoder Library\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h2>\n
~\/ac-library<\/code> \u306b\u7f6e\u304d\u307e\u3059\u3002
\n\u203b\u5834\u6240\u306f\u4efb\u610f\u3067\u3059\u304c\u3001\u3053\u308c\u4ee5\u964d\u306e\u89e3\u8aac\u306f\u4e0a\u8a18\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u524d\u63d0\u3068\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\nAtCoder Library\u306e\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3092\u8a2d\u5b9a<\/h2>\n
\n\u4ee5\u4e0b\u306e\u5185\u5bb9\u3067 ~\/.atcodertools.toml<\/code> \u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u30fb\u7de8\u96c6\u3057\u307e\u3059\u3002<\/p>\n
exec_on_contest_dir='ln -s ..\/.vscode .\/.vscode && code .'\n[codestyle]\ntemplate_file='~\/atcoder-workspace\/template.cpp'<\/code><\/pre>\n
~\/atcoder-workspace\/template.cpp<\/code> \u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u30fb\u7de8\u96c6\u3057\u307e\u3059\u3002<\/p>\n
#include <iostream>\n#include <sstream>\n#include <fstream>\n#include <string>\n#include <vector>\n#include <deque>\n#include <queue>\n#include <stack>\n#include <set>\n#include <map>\n#include <algorithm>\n#include <functional>\n#include <utility>\n#include <bitset>\n#include <cmath>\n#include <cstdlib>\n#include <ctime>\n#include <cstdio>\n#include <cassert>\n#include <iomanip>\nusing namespace std;\n\n#define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)\n#define FOR(i, a, b) for (int i = (a), i##_len = (b); i <= i##_len; ++i)\n#define REV(i, a, b) for (int i = (a); i >= (b); --i)\n#define CLR(a, b) memset((a), (b), sizeof(a))\n#define DUMP(x) cout << #x << " = " << (x) << endl;\n#define INF 1001001001001001001ll\n#define fcout cout << fixed << setprecision(12)\n\nusing ll = long long;\nusing vi = vector<int>;\nusing vl = vector<long long>;\nusing vs = vector<string>;\nusing vc = vector<char>;\nusing vb = vector<bool>;\nusing vpii = vector<pair<int, int>>;\nusing vpll = vector<pair<long long, long long>>;\nusing vvi = vector<vector<int>>;\nusing vvl = vector<vector<long long>>;\nusing vvc = vector<vector<char>>;\nusing vvb = vector<vector<bool>>;\nusing vvvi = vector<vector<vector<int>>>;\nusing pii = pair<int, int>;\n\ntemplate <typename T>\ninline bool chmax(T &a, T b) {\n return ((a < b) ? (a = b, true) : (false));\n}\ntemplate <typename T>\ninline bool chmin(T &a, T b) {\n return ((a > b) ? (a = b, true) : (false));\n}\n\n{% if mod %}\nconst long long MOD = {{ mod }};\n{% endif %}\n{% if yes_str %}\nconst string YES = "{{ yes_str }}";\n{% endif %}\n{% if no_str %}\nconst string NO = "{{ no_str }}";\n{% endif %}\n\n{% if prediction_success %}\nvoid solve({{ formal_arguments }}){\n\n}\n{% endif %}\n\n\/\/ Generated by {{ atcodertools.version }} {{ atcodertools.url }} (tips: You use the default template now. You can remove this line by using your custom template)\nint main(){\n {% if prediction_success %}\n {{input_part}}\n solve({{ actual_arguments }});\n {% else %}\n \/\/ Failed to predict input format\n {% endif %}\n return 0;\n}<\/code><\/pre>\n
VSCode\u4e0a\u3067\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3067\u304d\u308b\u3088\u3046\u306b\u8a2d\u5b9a<\/h2>\n
Shift + Command + P<\/code>\u3067\u8d77\u52d5)\u3067\u3001
tasks.json<\/code> \u3068\u30bf\u30a4\u30d7\u3057\u3066\u3001\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304d\u307e\u3059\u3002<\/p>\n
{\n \/\/ See https:\/\/go.microsoft.com\/fwlink\/?LinkId=733558\n \/\/ for the documentation about the tasks.json format\n "version": "2.0.0",\n "tasks": [\n {\n "label": "competitiveTestSample",\n "type": "shell",\n "command": "cd ${fileDirname} && g++ -O0 -std=c++14 -D_GLIBCXX_DEBUG -I ~\/ac-library ${fileBasename} && atcoder-tools test",\n "presentation": {\n "reveal": "always",\n "focus": true,\n "panel": "shared",\n }\n },\n {\n "label": "competitiveSubmit",\n "type": "shell",\n "command": "cd ${fileDirname} && g++ -O0 -std=c++14 -D_GLIBCXX_DEBUG -I ~\/ac-library ${fileBasename} && atcoder-tools submit -u",\n "presentation": {\n "reveal": "always",\n "focus": true,\n "panel": "shared",\n }\n }\n ]\n}<\/code><\/pre>\n
keybindings.json<\/code> \u3068\u30bf\u30a4\u30d7\u3057\u3066\u3001\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304d\u307e\u3059\u3002<\/p>\n
[\n {\n "key": "ctrl+t",\n "command": "workbench.action.tasks.runTask",\n "when": "editorTextFocus",\n "args": "competitiveTestSample"\n },\n {\n "key": "ctrl+s",\n "command": "workbench.action.tasks.runTask",\n "when": "editorTextFocus",\n "args": "competitiveSubmit"\n },\n ...(\u7701\u7565)<\/code><\/pre>\n
\n
ctrl+t<\/code> \u30ed\u30fc\u30ab\u30eb\u3067\u30c6\u30b9\u30c8\u5b9f\u884c<\/li>\n
ctrl+s<\/code> \u30b3\u30fc\u30c9\u3092\u63d0\u51fa<\/li>\n<\/ul>\n
VSCode\u4e0a\u3067AtCoder Library\u306e\u30a4\u30f3\u30af\u30eb\u30fc\u30c9\u30d1\u30b9\u3092\u8a2d\u5b9a\u3059\u308b<\/h2>\n
Shift + Command + P<\/code>\u3067
user settings<\/code> \u3068\u30bf\u30a4\u30d7\u3057\u3066\u3001\u300c\u30e6\u30fc\u30b6\u30fc\u8a2d\u5b9a\u3092\u958b\u304f\u300d\u3092\u9078\u629e\u3057\u3066\u3001\u8a2d\u5b9a\u753b\u9762\u3092\u958b\u304d\u307e\u3059\u3002<\/p>\n
\n
AtCoder\u306e\u554f\u984c\u3092\u8aad\u307f\u8fbc\u3080<\/h2>\n
$ atcoder-tools gen {\u30b3\u30f3\u30c6\u30b9\u30c8ID}<\/code><\/pre>\n
\u30b3\u30f3\u30c6\u30b9\u30c8ID<\/code> \u306f\u3001AtCoder\u30da\u30fc\u30b8\u306eURL\u306b\u542b\u307e\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n
~\/atcoder-workspace<\/code> \u306b\u30b3\u30f3\u30c6\u30b9\u30c8\u306e\u30c7\u30fc\u30bf\u304c\u8aad\u307f\u8fbc\u307e\u308c\u307e\u3059\u3002<\/p>\n
\nctrl+t<\/code> \u3067\u30c6\u30b9\u30c8\u3057\u3001
ctrl+s<\/code> \u3067\u63d0\u51fa\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n
\u53c2\u8003<\/h2>\n
\nhttps:\/\/blog.knshnb.com\/posts\/vscode-oj-acl\/<\/a><\/p>\n