正文
增加 14 行删除 15 行
43 行未改动4445464748495051527 行未改动60616263646566676869707172737475763 行未改动8081828384858687886 行未改动959697989910010110210310410510610710810911011159 行未改动17117217317417517617717817918018118218318418518618739 行未改动43 行未改动if (-not (Test-Path $cppFile)) {Write-Error "Error: $cppFile not found"; return}Write-Host "Compiling $cppFile"$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"7 行未改动function run {param([string]$name)cpl $nameif ($LASTEXITCODE -eq 0 -and (Test-Path ".\$name.exe")) {Write-Host "Running .\$name.exe"Write-Host "---------------begin---------------"$swRun = [System.Diagnostics.Stopwatch]::StartNew()& ".\$name.exe"$swRun.Stop()Write-Host "`n----------------end----------------"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(); 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 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 行未改动43 行未改动44454647484950517 行未改动59606162636465666768697071727374753 行未改动7980818283848586876 行未改动94959697989910010110210310410510610710810911059 行未改动17017117217317417517617717817918018118218318418518639 行未改动43 行未改动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"7 行未改动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 行未改动