正文
增加 18 行删除 19 行
5 行未改动6789101112131415161726 行未改动4445464748495051525354555657585960616263646566676869707172737475763 行未改动8081828384858687886 行未改动959697989910010110210310410510610710810911011159 行未改动17117217317417517617717817918018118218318418518618739 行未改动5 行未改动```bash line-numberscpl() {g++ "./$1.cpp" -o "./$1" -O2 -std=gnu++14 -static -Wall -Wextra -Wshadow -Wno-unused-result -Wno-sign-compare -Wl,-z,stack-size=1000000000 -fsanitize=undefined,bounds -DLOCAL && echo -e "\e[32mCompiled ./$1.cpp\e[0m"}run() {cpl "$1" && echo -e "\e[36mRunning ./$1\n---------------begin---------------\e[0m" && local TIMEFORMAT=$'\e[33m\n----------------end----------------\nTime: %3Rs\e[0m' && time "./$1"}```2. 可在控制台内运行如下命令以重新加载 `~/.bashrc` 中的命令:26 行未改动if (-not (Test-Path $cppFile)) {Write-Error "Error: $cppFile not found"; return}Write-Host "Compiling $cppFile" -ForegroundColor Green$swCompile = [System.Diagnostics.Stopwatch]::StartNew()g++ "$cppFile" -o "$exeFile" -O2 -std=gnu++14 -static -Wall -Wextra -Wshadow -Wno-unused-result -Wno-sign-compare "-Wl,--stack=1000000000" -DLOCAL # 神秘 Windows 没法加 "-fsanitize=undefined,bounds"$swCompile.Stop()if ($LASTEXITCODE -eq 0) {Write-Host "Compile Time: $($swCompile.Elapsed.TotalSeconds.ToString('0.000')) s" -ForegroundColor Yellow}}function run {param([string]$name)cpl $nameif ($LASTEXITCODE -eq 0 -and (Test-Path ".\$name.exe")) {Write-Host "Running .\$name.exe" -ForegroundColor GreenWrite-Host "---------------begin---------------" -ForegroundColor Cyan$swRun = [System.Diagnostics.Stopwatch]::StartNew()& ".\$name.exe"$swRun.Stop()Write-Host "`n----------------end----------------" -ForegroundColor YellowWrite-Host "Run Time: $($swRun.Elapsed.TotalSeconds.ToString('0.000')) s" -ForegroundColor Yellow}}```3. 可在(VSCode 中的)Powershell 内运行如下命令以重新加载 PowerShell 配置文件:3 行未改动4. 在部分特殊情况下,可以使用丐版命令来编译运行(将 `$name` 的值替换为程序实际路径并去掉 `.cpp` 即可):```bash line-numbers$name = ".\"; Write-Host "Compiling $name.cpp" -ForegroundColor Green; $swCompile = [System.Diagnostics.Stopwatch]::StartNew(); g++ "$name.cpp" -o "$name.exe" -O2 -std=gnu++14 -static -Wall -Wextra -Wshadow -Wno-unused-result "-Wl,--stack=1000000000" -DLOCAL; $swCompile.Stop(); Write-Host "Compile Time: $($swCompile.Elapsed.TotalSeconds.ToString('0.000')) s" -ForegroundColor Yellow; Write-Host "Running $name.exe" -ForegroundColor Green; Write-Host "---------------begin---------------" -ForegroundColor Cyan; $swRun = [System.Diagnostics.Stopwatch]::StartNew(); & "$name.exe"; $swRun.Stop(); Write-Host "`n----------------end----------------" -ForegroundColor Yellow; Write-Host "Run Time: $($swRun.Elapsed.TotalSeconds.ToString('0.000')) s" -ForegroundColor Yellow```## 配置文件6 行未改动"body": ["#include <bits/stdc++.h>","using namespace std;","#define int long long","#define eb emplace_back","#define fi first","#define se second","#define all(a) (a).begin(), (a).end()","using ull = unsigned long long;","using i128 = __int128;","using ld = long double;","using pii = pair<int, int>;","using p3i = pair<int, pii>;","const int inf = 0x3f3f3f3f, Inf = 0x3f3f3f3f3f3f3f3f;","template<typename T, typename U> void chkmin(T &x, U y) { x > y && (x = y); }","template<typename T, typename U> void chkmax(T &x, U y) { x < y && (x = y); }","",59 行未改动```cpp line-numbers#include <bits/stdc++.h>using namespace std;#define int long long#define eb emplace_back#define fi first#define se second#define all(a) (a).begin(), (a).end()using ull = unsigned long long;using i128 = __int128;using ld = long double;using pii = pair<int, int>;using p3i = pair<int, pii>;const int inf = 0x3f3f3f3f, Inf = 0x3f3f3f3f3f3f3f3f;template<typename T, typename U> void chkmin(T &x, U y) { x > y && (x = y); }template<typename T, typename U> void chkmax(T &x, U y) { x < y && (x = y); }39 行未改动5 行未改动6789101112131415161726 行未改动44454647484950515253545556575859606162636465666768697071727374753 行未改动7980818283848586876 行未改动94959697989910010110210310410510610710810911059 行未改动17017117217317417517617717817918018118218318418518639 行未改动5 行未改动```bash line-numberscpl() {g++ "./$1.cpp" -o "./$1" -O2 -std=gnu++14 -static -Wall -Wextra -Wshadow -Wno-unused-result -Wno-sign-compare -Wl,-z,stack-size=1000000000 -fsanitize=undefined,bounds -DLOCAL && echo "Compiled ./$1.cpp"}run() {cpl "$1" && echo -e "Running ./$1\n--------------------------------" && time "./$1"}```2. 可在控制台内运行如下命令以重新加载 `~/.bashrc` 中的命令:26 行未改动if (-not (Test-Path $cppFile)) {Write-Error "Error: $cppFile not found"; return}$swCompile = [System.Diagnostics.Stopwatch]::StartNew()g++ "$cppFile" -o "$exeFile" -O2 -std=gnu++14 -static -Wall -Wextra -Wshadow -Wno-unused-result -Wno-sign-compare "-Wl,--stack=1000000000" -DLOCAL # 神秘 Windows 没法加 "-fsanitize=undefined,bounds"$swCompile.Stop()if ($LASTEXITCODE -eq 0) {Write-Host "Compile Time: $($swCompile.Elapsed.TotalSeconds.ToString('0.000')) s"}}function run {param([string]$name)cpl $nameif ($LASTEXITCODE -eq 0 -and (Test-Path ".\$name.exe")) {Write-Host "--------------------------------"$swRun = [System.Diagnostics.Stopwatch]::StartNew()& ".\$name.exe"$swRun.Stop()Write-Host "`n--------------------------------"Write-Host "Run Time: $($swRun.Elapsed.TotalSeconds.ToString('0.000')) s"}}```3. 可在(VSCode 中的)Powershell 内运行如下命令以重新加载 PowerShell 配置文件:3 行未改动4. 在部分特殊情况下,可以使用丐版命令来编译运行(将 `$name` 的值替换为程序实际路径并去掉 `.cpp` 即可):```bash line-numbers$name = ".\"; $swCompile = [System.Diagnostics.Stopwatch]::StartNew(); g++ "$name.cpp" -o "$name.exe" -O2 -std=gnu++14 -static -Wall -Wextra -Wshadow -Wno-unused-result -Wno-sign-compare "-Wl,--stack=1000000000" -DLOCAL; $swCompile.Stop(); if ($LASTEXITCODE -eq 0) { echo "Compile Time: $($swCompile.Elapsed.TotalSeconds.ToString('0.000')) s" ; echo --------------------------------; $swRun = [System.Diagnostics.Stopwatch]::StartNew(); & "$name.exe"; $swRun.Stop(); echo `n--------------------------------; echo "Run Time: $($swRun.Elapsed.TotalSeconds.ToString('0.000')) s" }```## 配置文件6 行未改动"body": ["#include <bits/stdc++.h>","using namespace std;","#define int long long","#define i128 __int128","using ull = unsigned long long;","using ld = long double;","using pii = pair<int, int>;","using p3i = pair<int, pii>;","#define eb emplace_back","#define fi first","#define se second","#define all(a) (a).begin(), (a).end()","const int inf = 0x3f3f3f3f, Inf = 0x3f3f3f3f3f3f3f3f;","template<typename T, typename U> void chkmin(T &x, U y) { x > y && (x = y); }","template<typename T, typename U> void chkmax(T &x, U y) { x < y && (x = y); }","",59 行未改动```cpp line-numbers#include <bits/stdc++.h>using namespace std;#define int long long#define i128 __int128using ull = unsigned long long;using ld = long double;using pii = pair<int, int>;using p3i = pair<int, pii>;#define eb emplace_back#define fi first#define se second#define all(a) (a).begin(), (a).end()const int inf = 0x3f3f3f3f, Inf = 0x3f3f3f3f3f3f3f3f;template<typename T, typename U> void chkmin(T &x, U y) { x > y && (x = y); }template<typename T, typename U> void chkmax(T &x, U y) { x < y && (x = y); }39 行未改动