版本比较
vscode 配置
正文
增加 391 行删除 210 行
21 行未改动2223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211229 行未改动13213313413513613713813914020 行未改动1611621631641651661671681699 行未改动1791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283294 行未改动33433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737819 行未改动39839940040140240340440540640740840941041141241341441541621 行未改动如需在 VS Code 内按快捷键编译,可创建 `.vscode/tasks.json` 文件。```json{"version": "2.0.0","tasks": [{"label": "编译 C++(评测版)","type": "shell","command": "g++","args": ["-std=c++14","-O2","-Wall","-Wextra","-g","-Wl,--stack=1024000000","${file}","-o","${fileDirname}/${fileBasenameNoExtension}.exe"],"options": {"cwd": "${fileDirname}","shell": {"executable": "C:\\Windows\\System32\\cmd.exe","args": ["/d", "/c"]}},"problemMatcher": ["$gcc"],"group": {"kind": "build","isDefault": true},"presentation": {"reveal": "silent","panel": "shared","clear": true}},{"label": "编译 C++(调试版)","type": "shell","command": "g++","args": ["-std=c++14","-O0","-g","-Wall","-Wextra","-Wl,--stack=1024000000","${file}","-o","${fileDirname}/${fileBasenameNoExtension}.exe"],"options": {"cwd": "${fileDirname}","shell": {"executable": "C:\\Windows\\System32\\cmd.exe","args": ["/d", "/c"]}},"problemMatcher": ["$gcc"],"group": "build","presentation": {"reveal": "silent","panel": "shared","clear": true}},{"label": "运行 C++","type": "shell","command": "${fileDirname}/${fileBasenameNoExtension}.exe","options": {"cwd": "${fileDirname}"},"dependsOn": ["编译 C++(评测版)"],"dependsOrder": "sequence","group": {"kind": "test","isDefault": true},"presentation": {"reveal": "always","panel": "shared","clear": true},"problemMatcher": []}]}```配置后,按 `Ctrl+Shift+B` 即可编译当前文件。# 颜色配置```txt{"vs64.showWelcome": false,"code-runner.runInTerminal": true,"editor.fontSize": 20,9 行未改动"terminal.integrated.enableMultiLinePasteWarning": "never"}``````txt{"workbench.colorCustomizations": {"editorCursor.foreground": "#ffffff","editorCursor.background": "#ffffff",20 行未改动}}``````txt{"vs64.showWelcome": false,"code-runner.runInTerminal": true,"editor.fontSize": 20,9 行未改动"editor.insertSpaces": false,"terminal.integrated.enableMultiLinePasteWarning": "never","workbench.colorCustomizations": {"activityBar.background": "#040A12","activityBar.foreground": "#26C6DA","activityBar.inactiveForeground": "#2A4A5A","activityBarBadge.background": "#0288D1","activityBarBadge.foreground": "#040A12","sideBar.background": "#040A12","sideBar.foreground": "#A9C2D9","sideBarTitle.foreground": "#26C6DA","sideBarSectionHeader.background": "#07101E","sideBarSectionHeader.foreground": "#4DB6AC","editor.background": "#040A12","editor.foreground": "#A9C2D9","editorLineNumber.foreground": "#1E3A4A","editorLineNumber.activeForeground": "#26C6DA","editorCursor.foreground": "#4DB6AC","editor.selectionBackground": "#0288D144","editor.inactiveSelectionBackground": "#0288D122","editor.lineHighlightBackground": "#07101E","editor.findMatchBackground": "#26C6DA66","editor.findMatchHighlightBackground": "#0288D144","editorWhitespace.foreground": "#0F2233","editorIndentGuide.background1": "#0F2233","editorIndentGuide.activeBackground1": "#26C6DA","editorBracketMatch.background": "#0288D133","editorBracketMatch.border": "#0288D1","editorGutter.background": "#040A12","editorGroupHeader.tabsBackground": "#040A12","editorGroup.border": "#0F2233","editorOverviewRuler.border": "#0F2233","editorError.foreground": "#E57399","editorWarning.foreground": "#D4B85C","editorInfo.foreground": "#26C6DA","editorHint.foreground": "#4DB6AC","statusBar.background": "#05293F","statusBar.foreground": "#A9C2D9","statusBar.noFolderBackground": "#040A12","statusBar.debuggingBackground": "#0288D1","titleBar.activeBackground": "#040A12","titleBar.activeForeground": "#26C6DA","titleBar.inactiveBackground": "#040A12","titleBar.inactiveForeground": "#2A4A5A","tab.activeBackground": "#040A12","tab.activeForeground": "#4DB6AC","tab.inactiveBackground": "#040A12","tab.inactiveForeground": "#456A7A","tab.border": "#07101E","tab.activeBorderTop": "#26C6DA","panel.background": "#040A12","panel.border": "#0F2233","panelTitle.activeForeground": "#26C6DA","panelTitle.inactiveForeground": "#456A7A","terminal.background": "#040A12","terminal.foreground": "#A9C2D9","terminal.ansiBlack": "#040A12","terminal.ansiRed": "#E57399","terminal.ansiGreen": "#26A69A","terminal.ansiYellow": "#4DB6AC","terminal.ansiBlue": "#0288D1","terminal.ansiMagenta": "#29B6F6","terminal.ansiCyan": "#26C6DA","terminal.ansiWhite": "#A9C2D9","terminal.ansiBrightBlack": "#1E3A4A","terminal.ansiBrightRed": "#F48FB1","terminal.ansiBrightGreen": "#4DB6AC","terminal.ansiBrightYellow": "#80CBC4","terminal.ansiBrightBlue": "#42A5F5","terminal.ansiBrightMagenta": "#81D4FA","terminal.ansiBrightCyan": "#80DEEA","terminal.ansiBrightWhite": "#E0F7FA","button.background": "#0288D1","button.foreground": "#040A12","button.hoverBackground": "#26C6DA","input.background": "#07101E","input.foreground": "#A9C2D9","input.border": "#0288D1","inputOption.activeBorder": "#26C6DA","dropdown.background": "#07101E","dropdown.foreground": "#A9C2D9","dropdown.border": "#0288D1","list.activeSelectionBackground": "#0288D133","list.activeSelectionForeground": "#A9C2D9","list.hoverBackground": "#07101E","list.highlightForeground": "#26C6DA","scrollbarSlider.background": "#26C6DA33","scrollbarSlider.hoverBackground": "#26C6DA55","scrollbarSlider.activeBackground": "#26C6DA88","badge.background": "#0288D1","badge.foreground": "#040A12","progressBar.background": "#26C6DA","editorWidget.background": "#07101E","editorWidget.border": "#0288D1","editorSuggestWidget.background": "#07101E","editorSuggestWidget.border": "#0288D1","editorSuggestWidget.selectedBackground": "#0288D133","editorHoverWidget.background": "#07101E","editorHoverWidget.border": "#0288D1","peekView.border": "#26C6DA","peekViewEditor.background": "#040A12","peekViewResult.background": "#040A12","gitDecoration.addedResourceForeground": "#26A69A","gitDecoration.modifiedResourceForeground": "#29B6F6","gitDecoration.deletedResourceForeground": "#E57399","gitDecoration.untrackedResourceForeground": "#26C6DA","gitDecoration.ignoredResourceForeground": "#2A4A5A"},"editor.tokenColorCustomizations": {"comments": "#3B5A6B","strings": "#4DB6AC","keywords": "#26C6DA","numbers": "#80CBC4","types": "#42A5F5","functions": "#26A69A","variables": "#A9C2D9","textMateRules": [{"scope": ["comment", "punctuation.definition.comment"],"settings": {"foreground": "#3B5A6B","fontStyle": "italic"}},{"scope": ["string", "punctuation.definition.string"],"settings": {"foreground": "#4DB6AC"}},{"scope": ["keyword", "storage.type", "storage.modifier"],4 行未改动},{"scope": ["entity.name.function", "support.function"],"settings": {"foreground": "#26A69A"}},{"scope": ["variable", "variable.parameter"],"settings": {"foreground": "#A9C2D9"}},{"scope": ["constant.numeric", "constant.language"],"settings": {"foreground": "#80CBC4"}},{"scope": ["entity.name.type", "support.type", "support.class", "storage.type"],"settings": {"foreground": "#42A5F5"}},{"scope": ["constant.other", "variable.language"],"settings": {"foreground": "#0288D1"}},{"scope": ["keyword.operator"],"settings": {"foreground": "#456A7A"}},{"scope": ["punctuation", "meta.brace"],"settings": {"foreground": "#456A7A"}},{"scope": ["markup.heading"],19 行未改动"background.enabled": true,"background.editor": {"images": ["file:///home/你的用户名/Pictures/bg.jpg"],"useFront": false,"style": {"background-position": "center center","background-size": "cover","opacity": 0.08,"background-repeat": "no-repeat","filter": "brightness(0.6) contrast(0.8)"},"interval": 0,"random": false}}```21 行未改动2223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103119 行未改动32132232332432532632732832920 行未改动3503513523533543553563573589 行未改动3683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125134 行未改动51851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156219 行未改动58258358458558658758858959059159259359459559659721 行未改动如需在 VS Code 内按快捷键编译,可创建 `.vscode/tasks.json` 文件。```json{"version": "2.0.0","tasks": [{"label": "编译 C++(评测版)","type": "shell","command": "/usr/bin/g++","args": ["-std=c++14","-O2","-Wall","-Wextra","-g","${file}","-o","${fileDirname}/${fileBasenameNoExtension}"],"options": {"cwd": "${fileDirname}"},"problemMatcher": ["$gcc"],"group": {"kind": "build","isDefault": true},"presentation": {"reveal": "silent","panel": "shared","clear": true}},{"label": "编译 C++(调试版)","type": "shell","command": "/usr/bin/g++","args": ["-std=c++14","-O0","-g","-Wall","-Wextra","-fsanitize=address,undefined","${file}","-o","${fileDirname}/${fileBasenameNoExtension}"],"options": {"cwd": "${fileDirname}"},"problemMatcher": ["$gcc"],"group": {"kind": "build","isDefault": false},"presentation": {"reveal": "silent","panel": "shared","clear": true}},{"label": "运行 C++","type": "shell","command": "${fileDirname}/${fileBasenameNoExtension}","options": {"cwd": "${fileDirname}"},"dependsOn": ["编译 C++(评测版)"],"dependsOrder": "sequence","presentation": {"reveal": "always","panel": "shared","clear": true,"focus": true},"problemMatcher": []},{"label": "仅运行 C++","type": "shell","command": "${fileDirname}/${fileBasenameNoExtension}","options": {"cwd": "${fileDirname}"},"presentation": {"reveal": "always","panel": "shared","clear": true,"focus": true},"problemMatcher": []},{"label": "运行 Python","type": "shell","command": "python3","args": ["${file}"],"options": {"cwd": "${fileDirname}"},"presentation": {"reveal": "always","panel": "shared","clear": true,"focus": true},"problemMatcher": []}]}```windows 中:```json{"version": "2.0.0","tasks": [{"label": "编译 C++(评测版)","type": "shell","command": "g++","args": ["-std=c++14","-O2","-Wall","-Wextra","-g","${file}","-o","${fileDirname}\\${fileBasenameNoExtension}.exe","-static-libgcc","-static-libstdc++"],"options": {"cwd": "${fileDirname}"},"problemMatcher": ["$gcc"],"group": {"kind": "build","isDefault": true},"presentation": {"reveal": "silent","panel": "shared","clear": true}},{"label": "运行 C++","type": "shell","command": "${fileDirname}\\${fileBasenameNoExtension}.exe","options": {"cwd": "${fileDirname}"},"dependsOn": ["编译 C++(评测版)"],"dependsOrder": "sequence","presentation": {"reveal": "always","panel": "shared","clear": true,"focus": true},"problemMatcher": []},{"label": "运行 Python","type": "shell","command": "python","args": ["${file}"],"options": {"cwd": "${fileDirname}"},"presentation": {"reveal": "always","panel": "shared","clear": true,"focus": true},"problemMatcher": []}]}```## 一键编译运行`Preferences: Open Keyboard Shortcuts (JSON)````json[{"key": "ctrl+shift+b","command": "workbench.action.tasks.build","when": "resourceLangId == cpp"},{"key": "ctrl+f5","command": "workbench.action.tasks.runTask","args": "运行 C++","when": "resourceLangId == cpp"},{"key": "ctrl+alt+r","command": "workbench.action.tasks.runTask","args": "仅运行 C++","when": "resourceLangId == cpp"},{"key": "ctrl+alt+p","command": "workbench.action.tasks.runTask","args": "运行 Python","when": "resourceLangId == python"},{"key": "ctrl+alt+z","command": "glassit.increase"},{"key": "ctrl+alt+c","command": "glassit.decrease"}]```# launch.json```json{"version": "0.2.0","configurations": [{"name": "调试 C++(开栈 512MB)","type": "cppdbg","request": "launch","program": "${fileDirname}/${fileBasenameNoExtension}","args": [],"stopAtEntry": false,"cwd": "${fileDirname}","environment": [],"externalConsole": false,"MIMode": "gdb","preLaunchTask": "编译 C++(调试版)","setupCommands": [{"description": "启用 shell 启动,使 ulimit 生效","text": "-gdb-set startup-with-shell on","ignoreFailures": true},{"description": "设置栈大小为 512MB(524288 KB)","text": "-gdb-set exec-wrapper sh -c 'ulimit -s 524288 && exec \"$@\"' --","ignoreFailures": true},{"description": "为 gdb 启用整齐打印","text": "-enable-pretty-printing","ignoreFailures": true}]}]}```# 颜色配置`Preferences: Open User Settings (JSON)````json{"vs64.showWelcome": false,"code-runner.runInTerminal": true,"editor.fontSize": 20,9 行未改动"terminal.integrated.enableMultiLinePasteWarning": "never"}``````json{"workbench.colorCustomizations": {"editorCursor.foreground": "#ffffff","editorCursor.background": "#ffffff",20 行未改动}}``````json{"vs64.showWelcome": false,"code-runner.runInTerminal": true,"editor.fontSize": 20,9 行未改动"editor.insertSpaces": false,"terminal.integrated.enableMultiLinePasteWarning": "never","workbench.colorCustomizations": {"activityBar.background": "#0D1117","activityBar.foreground": "#39C5BB","activityBar.inactiveForeground": "#484F58","activityBarBadge.background": "#39C5BB","activityBarBadge.foreground": "#0D1117","sideBar.background": "#0D1117","sideBar.foreground": "#C9D1D9","sideBarTitle.foreground": "#39C5BB","sideBarSectionHeader.background": "#161B22","sideBarSectionHeader.foreground": "#58A6FF","editor.background": "#0D1117","editor.foreground": "#FFFFFF","editorLineNumber.foreground": "#484F58","editorLineNumber.activeForeground": "#39C5BB","editorCursor.foreground": "#39C5BB","editor.selectionBackground": "#39C5BB44","editor.inactiveSelectionBackground": "#39C5BB22","editor.lineHighlightBackground": "#161B22","editor.findMatchBackground": "#39C5BB66","editor.findMatchHighlightBackground": "#39C5BB44","editorWhitespace.foreground": "#21262D","editorIndentGuide.background1": "#21262D","editorIndentGuide.activeBackground1": "#39C5BB","editorBracketMatch.background": "#39C5BB33","editorBracketMatch.border": "#39C5BB","editorGutter.background": "#0D1117","editorGroup.border": "#21262D","editorOverviewRuler.border": "#21262D","editorError.foreground": "#F85149","editorWarning.foreground": "#D29922","editorInfo.foreground": "#39C5BB","editorHint.foreground": "#39C5BB","statusBar.background": "#0A192F","statusBar.foreground": "#FFFFFF","statusBar.noFolderBackground": "#0D1117","statusBar.debuggingBackground": "#39C5BB","statusBar.debuggingForeground": "#0A192F","tab.activeBackground": "#0D1117","tab.activeForeground": "#FFFFFF","tab.inactiveBackground": "#0D1117","tab.inactiveForeground": "#5A8A9A","tab.border": "#161B22","tab.activeBorderTop": "#39C5BB","panel.background": "#0D1117","panel.border": "#21262D","panelTitle.activeForeground": "#39C5BB","panelTitle.inactiveForeground": "#484F58","terminal.background": "#0D1117","terminal.foreground": "#FFFFFF","terminal.ansiBlack": "#0D1117","terminal.ansiRed": "#F85149","terminal.ansiGreen": "#39C5BB","terminal.ansiYellow": "#D29922","terminal.ansiBlue": "#58A6FF","terminal.ansiMagenta": "#BC8CFF","terminal.ansiCyan": "#39C5BB","terminal.ansiWhite": "#FFFFFF","terminal.ansiBrightBlack": "#484F58","terminal.ansiBrightRed": "#FF7B72","terminal.ansiBrightGreen": "#39C5BB","terminal.ansiBrightYellow": "#E3B341","terminal.ansiBrightBlue": "#79C0FF","terminal.ansiBrightMagenta": "#D2A8FF","terminal.ansiBrightCyan": "#39C5BB","terminal.ansiBrightWhite": "#FFFFFF","button.background": "#39C5BB","button.foreground": "#0A192F","button.hoverBackground": "#4DB6AC","input.background": "#161B22","input.foreground": "#FFFFFF","input.border": "#21262D","inputOption.activeBorder": "#39C5BB","dropdown.background": "#161B22","dropdown.foreground": "#FFFFFF","dropdown.border": "#21262D","list.activeSelectionBackground": "#39C5BB33","list.activeSelectionForeground": "#FFFFFF","list.hoverBackground": "#161B22","list.highlightForeground": "#39C5BB","scrollbarSlider.background": "#39C5BB33","scrollbarSlider.hoverBackground": "#39C5BB55","scrollbarSlider.activeBackground": "#39C5BB88","badge.background": "#39C5BB","badge.foreground": "#0A192F","progressBar.background": "#39C5BB","editorWidget.background": "#161B22","editorWidget.border": "#21262D","editorSuggestWidget.background": "#161B22","editorSuggestWidget.border": "#21262D","editorSuggestWidget.selectedBackground": "#39C5BB33","editorHoverWidget.background": "#161B22","editorHoverWidget.border": "#21262D","peekView.border": "#39C5BB","peekViewEditor.background": "#0D1117","peekViewResult.background": "#0D1117","gitDecoration.addedResourceForeground": "#39C5BB","gitDecoration.modifiedResourceForeground": "#58A6FF","gitDecoration.deletedResourceForeground": "#F85149","gitDecoration.untrackedResourceForeground": "#39C5BB","gitDecoration.ignoredResourceForeground": "#484F58"},"editor.tokenColorCustomizations": {"comments": "#5A7A8A","strings": "#80CBC4","keywords": "#26C6DA","numbers": "#4DD0E1","types": "#80DEEA","functions": "#00BFA5","variables": "#FFFFFF","textMateRules": [{"scope": ["comment", "punctuation.definition.comment"],"settings": {"foreground": "#5A7A8A","fontStyle": "italic"}},{"scope": ["string", "punctuation.definition.string"],"settings": {"foreground": "#80CBC4"}},{"scope": ["keyword", "storage.type", "storage.modifier"],4 行未改动},{"scope": ["entity.name.function", "support.function"],"settings": {"foreground": "#00BFA5"}},{"scope": ["variable", "variable.parameter"],"settings": {"foreground": "#FFFFFF"}},{"scope": ["constant.numeric", "constant.language"],"settings": {"foreground": "#4DD0E1"}},{"scope": ["entity.name.type", "support.type", "support.class", "storage.type"],"settings": {"foreground": "#80DEEA"}},{"scope": ["constant.other", "variable.language"],"settings": {"foreground": "#00BCD4"}},{"scope": ["keyword.operator"],"settings": {"foreground": "#6A8A9A"}},{"scope": ["punctuation", "meta.brace"],"settings": {"foreground": "#6A8A9A"}},{"scope": ["markup.heading"],19 行未改动"background.enabled": true,"background.editor": {"images": ["/usr/share/backgrounds/vscode-bg.jpg"],"useFront": false,"style": {"background-position": "center center","background-size": "cover","opacity": 0.08,"background-repeat": "no-repeat"}}}```