Compare commits

..

16 Commits

Author SHA1 Message Date
e2hang
8f5e2a1bd7 Move asm to Operating System 2026-03-18 16:00:29 +08:00
e2hang
41da2405fa Update ShittySort 2026-03-18 15:47:01 +08:00
e2hang
6d89eeab00 Update Operating System 2026-03-18 11:02:25 +08:00
e2hang
bb6a4a0c9d Update Dynamic_Link PIC GOT PLT 2026-03-16 20:57:21 +08:00
e2hang
e7b013e1c3 Update: ld process 2026-03-16 18:05:40 +08:00
e2hang
5f5968dcd5 Update: asm ld 2026-03-16 10:28:06 +08:00
e2hang
ac6979e293 Update asm 2026-03-15 14:45:12 +08:00
e2hang
e6ff85fd26 Remove ABI 2026-03-15 14:24:50 +08:00
e2hang
6fcedaf4be Update Folders 2026-03-15 13:14:04 +08:00
e2hang
f071d09131 New asm 2026-03-14 19:49:27 +08:00
e2hang
425424dd1d Update c/asm 2026-03-13 21:42:05 +08:00
e2hang
531a173cb4 Update 2026-03-13 20:08:33 +08:00
e2hang
138a2f0f98 Auto commit 2026-01-31 22:09:11 +08:00
e2hang
0618b3fc41 Auto commit at 2026-01-31 14:38:00 2026-01-31 14:38:00 +08:00
e2hang
d8b4877ce7 Auto commit at 2026-01-26 17:47:59 2026-01-26 17:48:00 +08:00
e2hang
2846a88e72 Auto commit at 2026-01-26 10:50:01 2026-01-26 10:50:01 +08:00
94 changed files with 2690 additions and 560 deletions

2
.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
**/*.exe
**/target

BIN
assembly/test0/mov Executable file

Binary file not shown.

16
assembly/test0/mov.asm Normal file
View File

@@ -0,0 +1,16 @@
section .text
global _start
_start:
mov rax, 1000H
mov rbx, 2000H
jmp add_1
add_1:
add rax, rbx
; not good
mov rax, 60
xor rdi, rdi;
syscall

BIN
assembly/test0/mov.o Normal file

Binary file not shown.

BIN
assembly/test1/jmp Executable file

Binary file not shown.

17
assembly/test1/jmp.asm Normal file
View File

@@ -0,0 +1,17 @@
section .text
global _start
_start:
mov rax, 0AA44444h
mov rbx, 20003333h
mov rcx, 11112222h
jmp tag1
tag1:
add rax, rbx
sub rcx, rbx
mov rax, 60
xor rdi, rdi
syscall

BIN
assembly/test1/jmp.o Normal file

Binary file not shown.

3
assembly/test1/o.txt Normal file
View File

@@ -0,0 +1,3 @@
ojinjin
where is ojinjin
here it is!

247
bash/git-renew-linux.sh Normal file
View File

@@ -0,0 +1,247 @@
#!/bin/bash
# ============================================
# Git 批量克隆/更新脚本 - Bash 版本
# 适用于 Linux / macOS / Git Bash
# ============================================
# -------------------- 配置区 --------------------
# 父目录路径(存放所有仓库的目录)
PARENT_DIR=".."
# Git 远程仓库用户名
GIT_USERNAME="e2hang"
# Git 远程仓库基础 URL
GIT_BASE_URL="https://huajishe.fun/git"
# 连接方式https 或 ssh
# https: https://huajishe.fun/git/e2hang/<repo>.git
# ssh: git@huajishe.fun:e2hang/<repo>.git
CONNECTION_TYPE="https" # 可选: "https" 或 "ssh"
# SSH 主机(仅当 CONNECTION_TYPE="ssh" 时使用)
SSH_HOST="huajishe.fun"
# -------------------- 仓库列表模式选择 --------------------
# 模式 1: "folders" - 基于父目录下已有的文件夹
# 模式 2: "array" - 基于下面定义的 REPO_LIST 数组
LIST_MODE="folders" # 可选: "folders" 或 "array"
# 仓库列表(仅当 LIST_MODE="array" 时使用)
# 在这里定义你想要同步的仓库名
REPO_LIST=(
"project-one"
"project-two"
"my awesome project"
"another-repo"
)
# -------------------- 脚本主体 --------------------
# 颜色定义
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
RED='\033[0;31m'
BLUE='\033[0;34m'
CYAN='\033[0;36m'
NC='\033[0m' # No Color
# 检查父目录是否存在,不存在则创建
if [ ! -d "$PARENT_DIR" ]; then
echo -e "${YELLOW}警告: 父目录 '$PARENT_DIR' 不存在,正在创建...${NC}"
mkdir -p "$PARENT_DIR" || {
echo -e "${RED}错误: 无法创建父目录${NC}"
exit 1
}
fi
# 转换为绝对路径
PARENT_DIR=$(cd "$PARENT_DIR" && pwd)
echo -e "${BLUE}========================================${NC}"
echo -e "${BLUE}Git 批量同步工具${NC}"
echo -e "${BLUE}========================================${NC}"
echo -e "目标目录: ${CYAN}$PARENT_DIR${NC}"
echo -e "连接方式: ${CYAN}$CONNECTION_TYPE${NC}"
echo -e "列表模式: ${CYAN}$LIST_MODE${NC}"
echo -e "${BLUE}========================================${NC}"
echo ""
# 统计变量
total=0
cloned=0
updated=0
skipped=0
failed=0
uptodate=0
# 构建远程仓库 URL
# 参数: $1 = 仓库名
build_remote_url() {
local repo_name="$1"
if [ "$CONNECTION_TYPE" = "ssh" ]; then
echo "git@${SSH_HOST}:${GIT_USERNAME}/${repo_name}.git"
else
echo "${GIT_BASE_URL}/${GIT_USERNAME}/${repo_name}.git"
fi
}
# 处理单个仓库
# 参数: $1 = 仓库名
process_repo() {
local repo_name="$1"
local repo_path="$PARENT_DIR/$repo_name"
local remote_url=$(build_remote_url "$repo_name")
((total++))
echo -e "${BLUE}[$total] 处理仓库: ${CYAN}$repo_name${NC}"
# 情况 1: 目录不存在 - 执行 clone
if [ ! -d "$repo_path" ]; then
echo -e "${YELLOW} → 本地目录不存在,开始克隆...${NC}"
# 进入父目录
cd "$PARENT_DIR" || {
echo -e "${RED} ✗ [ERROR] 无法进入父目录${NC}"
((failed++))
echo ""
return
}
# 执行 clone
if git clone "$remote_url" "$repo_name" 2>&1 | grep -q "Cloning into\|done"; then
echo -e "${GREEN} ✓ [CLONED] 克隆成功${NC}"
((cloned++))
else
echo -e "${RED} ✗ [ERROR] 克隆失败 - 请检查仓库是否存在或网络连接${NC}"
((failed++))
fi
echo ""
return
fi
# 情况 2: 目录存在但不是 Git 仓库 - 跳过并警告
if [ ! -d "$repo_path/.git" ]; then
echo -e "${YELLOW} ⚠ [SKIPPED] 目录存在但不是 Git 仓库${NC}"
((skipped++))
echo ""
return
fi
# 情况 3: 是 Git 仓库 - 执行 pull
echo -e "${YELLOW} → Git 仓库已存在,开始更新...${NC}"
# 进入仓库目录
cd "$repo_path" || {
echo -e "${RED} ✗ [ERROR] 无法进入仓库目录${NC}"
((failed++))
echo ""
return
}
# 获取当前分支
current_branch=$(git rev-parse --abbrev-ref HEAD 2>/dev/null)
if [ -z "$current_branch" ]; then
echo -e "${RED} ✗ [ERROR] 无法确定当前分支${NC}"
((failed++))
echo ""
return
fi
# 保存当前提交哈希(用于判断是否有更新)
before_hash=$(git rev-parse HEAD 2>/dev/null)
# 执行 pull
pull_output=$(git pull origin "$current_branch" 2>&1)
pull_exit_code=$?
if [ $pull_exit_code -eq 0 ]; then
# 获取更新后的提交哈希
after_hash=$(git rev-parse HEAD 2>/dev/null)
if echo "$pull_output" | grep -q "Already up to date\|Already up-to-date"; then
echo -e "${CYAN} ○ [UP-TO-DATE] 已是最新版本${NC}"
((uptodate++))
elif [ "$before_hash" != "$after_hash" ]; then
echo -e "${GREEN} ✓ [UPDATED] 更新成功${NC}"
((updated++))
else
echo -e "${CYAN} ○ [UP-TO-DATE] 已是最新版本${NC}"
((uptodate++))
fi
else
echo -e "${RED} ✗ [ERROR] 更新失败${NC}"
echo -e "${RED} 错误信息: $(echo "$pull_output" | head -n 2)${NC}"
((failed++))
fi
echo ""
}
# -------------------- 主循环 --------------------
# 根据模式获取仓库列表
if [ "$LIST_MODE" = "array" ]; then
echo -e "${CYAN}使用预定义仓库列表 (共 ${#REPO_LIST[@]} 个)${NC}"
echo ""
# 遍历预定义的仓库列表
for repo in "${REPO_LIST[@]}"; do
process_repo "$repo"
done
elif [ "$LIST_MODE" = "folders" ]; then
echo -e "${CYAN}基于现有文件夹列表同步${NC}"
echo ""
# 检查父目录下是否有子文件夹
if [ -z "$(ls -A "$PARENT_DIR" 2>/dev/null)" ]; then
echo -e "${YELLOW}警告: 父目录为空,没有需要处理的仓库${NC}"
echo -e "${YELLOW}提示: 可以将 LIST_MODE 改为 'array' 并定义 REPO_LIST${NC}"
exit 0
fi
# 遍历父目录下的所有一级子目录
for repo_path in "$PARENT_DIR"/*/; do
# 去除末尾的斜杠
repo_path="${repo_path%/}"
# 跳过不是目录的项
if [ ! -d "$repo_path" ]; then
continue
fi
# 获取文件夹名
repo_name=$(basename "$repo_path")
# 处理仓库(这里是 pull 操作)
process_repo "$repo_name"
done
else
echo -e "${RED}错误: 未知的 LIST_MODE '$LIST_MODE'${NC}"
echo -e "${YELLOW}请设置 LIST_MODE 为 'folders' 或 'array'${NC}"
exit 1
fi
# -------------------- 输出统计信息 --------------------
echo -e "${BLUE}========================================${NC}"
echo -e "${BLUE}同步完成!${NC}"
echo -e "${BLUE}========================================${NC}"
echo -e "总计处理: ${CYAN}$total${NC} 个仓库"
echo ""
echo -e "${GREEN}✓ 克隆成功: $cloned${NC}"
echo -e "${GREEN}✓ 更新成功: $updated${NC}"
echo -e "${CYAN}○ 已是最新: $uptodate${NC}"
echo -e "${YELLOW}⚠ 跳过: $skipped${NC}"
echo -e "${RED}✗ 失败: $failed${NC}"
echo ""
# 如果有失败的,返回非零退出码
if [ $failed -gt 0 ]; then
exit 1
fi
exit 0

View File

@@ -0,0 +1,238 @@
# ============================================
# Git 批量克隆/更新脚本 - PowerShell 版本
# 适用于 Windows PowerShell / PowerShell Core
# ============================================
# -------------------- 配置区 --------------------
# 父目录路径(存放所有仓库的目录)
$ParentDir = ".."
# Git 远程仓库用户名
$GitUsername = "e2hang"
# Git 远程仓库基础 URL
$GitBaseUrl = "https://huajishe.fun/git"
# 连接方式https 或 ssh
# https: https://huajishe.fun/git/e2hang/<repo>.git
# ssh: git@huajishe.fun:e2hang/<repo>.git
$ConnectionType = "https" # 可选: "https" 或 "ssh"
# SSH 主机(仅当 ConnectionType="ssh" 时使用)
$SshHost = "huajishe.fun"
# -------------------- 仓库列表模式选择 --------------------
# 模式 1: "folders" - 基于父目录下已有的文件夹
# 模式 2: "array" - 基于下面定义的 RepoList 数组
$ListMode = "folders" # 可选: "folders" 或 "array"
# 仓库列表(仅当 ListMode="array" 时使用)
$RepoList = @(
"project-one",
"project-two",
"my awesome project",
"another-repo"
)
# -------------------- 脚本主体 --------------------
# 检查父目录是否存在,不存在则创建
if (-not (Test-Path -Path $ParentDir)) {
Write-Host "警告: 父目录 '$ParentDir' 不存在,正在创建..." -ForegroundColor Yellow
try {
New-Item -Path $ParentDir -ItemType Directory -Force | Out-Null
}
catch {
Write-Host "错误: 无法创建父目录" -ForegroundColor Red
exit 1
}
}
# 转换为绝对路径
$ParentDir = (Resolve-Path -Path $ParentDir).Path
Write-Host "========================================" -ForegroundColor Cyan
Write-Host "Git 批量同步工具" -ForegroundColor Cyan
Write-Host "========================================" -ForegroundColor Cyan
Write-Host "目标目录: " -NoNewline
Write-Host $ParentDir -ForegroundColor Cyan
Write-Host "连接方式: " -NoNewline
Write-Host $ConnectionType -ForegroundColor Cyan
Write-Host "列表模式: " -NoNewline
Write-Host $ListMode -ForegroundColor Cyan
Write-Host "========================================" -ForegroundColor Cyan
Write-Host ""
# 统计变量
$total = 0
$cloned = 0
$updated = 0
$skipped = 0
$failed = 0
$uptodate = 0
# 构建远程仓库 URL
function Build-RemoteUrl {
param([string]$RepoName)
if ($ConnectionType -eq "ssh") {
return "git@${SshHost}:${GitUsername}/${RepoName}.git"
}
else {
return "${GitBaseUrl}/${GitUsername}/${RepoName}.git"
}
}
# 处理单个仓库
function Process-Repo {
param([string]$RepoName)
$script:total++
$repoPath = Join-Path -Path $ParentDir -ChildPath $RepoName
$remoteUrl = Build-RemoteUrl -RepoName $RepoName
Write-Host "[$script:total] 处理仓库: " -NoNewline -ForegroundColor Cyan
Write-Host $RepoName -ForegroundColor Cyan
# 情况 1: 目录不存在 - 执行 clone
if (-not (Test-Path -Path $repoPath)) {
Write-Host " → 本地目录不存在,开始克隆..." -ForegroundColor Yellow
# 进入父目录
Push-Location -Path $ParentDir
# 执行 clone
$cloneResult = git clone $remoteUrl $RepoName 2>&1
$cloneSuccess = $LASTEXITCODE -eq 0
Pop-Location
if ($cloneSuccess) {
Write-Host " ✓ [CLONED] 克隆成功" -ForegroundColor Green
$script:cloned++
}
else {
Write-Host " ✗ [ERROR] 克隆失败 - 请检查仓库是否存在或网络连接" -ForegroundColor Red
$script:failed++
}
Write-Host ""
return
}
# 情况 2: 目录存在但不是 Git 仓库 - 跳过并警告
if (-not (Test-Path -Path (Join-Path -Path $repoPath -ChildPath ".git"))) {
Write-Host " ⚠ [SKIPPED] 目录存在但不是 Git 仓库" -ForegroundColor Yellow
$script:skipped++
Write-Host ""
return
}
# 情况 3: 是 Git 仓库 - 执行 pull
Write-Host " → Git 仓库已存在,开始更新..." -ForegroundColor Yellow
# 进入仓库目录
Push-Location -Path $repoPath
# 获取当前分支
$currentBranch = git rev-parse --abbrev-ref HEAD 2>&1
if ([string]::IsNullOrWhiteSpace($currentBranch) -or $LASTEXITCODE -ne 0) {
Write-Host " ✗ [ERROR] 无法确定当前分支" -ForegroundColor Red
$script:failed++
Pop-Location
Write-Host ""
return
}
# 保存当前提交哈希
$beforeHash = git rev-parse HEAD 2>&1
# 执行 pull
$pullResult = git pull origin $currentBranch 2>&1
$pullSuccess = $LASTEXITCODE -eq 0
if ($pullSuccess) {
# 获取更新后的提交哈希
$afterHash = git rev-parse HEAD 2>&1
if ($pullResult -match "Already up.to.date|Already up-to-date") {
Write-Host " ○ [UP-TO-DATE] 已是最新版本" -ForegroundColor Cyan
$script:uptodate++
}
elseif ($beforeHash -ne $afterHash) {
Write-Host " ✓ [UPDATED] 更新成功" -ForegroundColor Green
$script:updated++
}
else {
Write-Host " ○ [UP-TO-DATE] 已是最新版本" -ForegroundColor Cyan
$script:uptodate++
}
}
else {
Write-Host " ✗ [ERROR] 更新失败" -ForegroundColor Red
$errorLines = ($pullResult | Out-String).Split("`n") | Select-Object -First 2
Write-Host " 错误信息: $($errorLines -join ' ')" -ForegroundColor Red
$script:failed++
}
Pop-Location
Write-Host ""
}
# -------------------- 主循环 --------------------
# 根据模式获取仓库列表
if ($ListMode -eq "array") {
Write-Host "使用预定义仓库列表 (共 $($RepoList.Count) 个)" -ForegroundColor Cyan
Write-Host ""
# 遍历预定义的仓库列表
foreach ($repo in $RepoList) {
Process-Repo -RepoName $repo
}
}
elseif ($ListMode -eq "folders") {
Write-Host "基于现有文件夹列表同步" -ForegroundColor Cyan
Write-Host ""
# 获取父目录下的所有子文件夹
$folders = Get-ChildItem -Path $ParentDir -Directory -ErrorAction SilentlyContinue
if ($folders.Count -eq 0) {
Write-Host "警告: 父目录为空,没有需要处理的仓库" -ForegroundColor Yellow
Write-Host "提示: 可以将 ListMode 改为 'array' 并定义 RepoList" -ForegroundColor Yellow
exit 0
}
# 遍历所有文件夹
foreach ($folder in $folders) {
Process-Repo -RepoName $folder.Name
}
}
else {
Write-Host "错误: 未知的 ListMode '$ListMode'" -ForegroundColor Red
Write-Host "请设置 ListMode 为 'folders' 或 'array'" -ForegroundColor Yellow
exit 1
}
# -------------------- 输出统计信息 --------------------
Write-Host "========================================" -ForegroundColor Cyan
Write-Host "同步完成!" -ForegroundColor Cyan
Write-Host "========================================" -ForegroundColor Cyan
Write-Host "总计处理: " -NoNewline
Write-Host "$total 个仓库" -ForegroundColor Cyan
Write-Host ""
Write-Host "✓ 克隆成功: $cloned" -ForegroundColor Green
Write-Host "✓ 更新成功: $updated" -ForegroundColor Green
Write-Host "○ 已是最新: $uptodate" -ForegroundColor Cyan
Write-Host "⚠ 跳过: $skipped" -ForegroundColor Yellow
Write-Host "✗ 失败: $failed" -ForegroundColor Red
Write-Host ""
# 如果有失败的,返回非零退出码
if ($failed -gt 0) {
exit 1
}
exit 0

160
bash/git-upload-linux.sh Normal file
View File

@@ -0,0 +1,160 @@
#!/bin/bash
# ============================================
# Git 批量管理脚本 - Bash 版本
# 适用于 Linux 和 Windows Git Bash
# ============================================
# -------------------- 配置区 --------------------
# 父目录路径(支持相对路径和绝对路径)
# 示例:
# ".." -> 上级目录
# "." -> 当前目录
# "./projects" -> 当前目录下的 projects 文件夹
# "../projects" -> 上级目录下的 projects 文件夹
# "/home/user/projects" -> 绝对路径
# "$HOME/projects" -> 用户主目录下的 projects
PARENT_DIR=".."
# Git 远程仓库用户名
GIT_USERNAME="e2hang"
# Git 远程仓库基础 URL
GIT_BASE_URL="https://huajishe.fun/git"
# 默认分支名
DEFAULT_BRANCH="main"
# -------------------- 脚本主体 --------------------
# 颜色定义(可选,增强可读性)
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
RED='\033[0;31m'
BLUE='\033[0;34m'
NC='\033[0m' # No Color
# 检查父目录是否存在
if [ ! -d "$PARENT_DIR" ]; then
echo -e "${RED}错误: 父目录 '$PARENT_DIR' 不存在${NC}"
exit 1
fi
echo -e "${BLUE}========================================${NC}"
echo -e "${BLUE}开始处理目录: $PARENT_DIR${NC}"
echo -e "${BLUE}========================================${NC}"
echo ""
# 统计变量
total=0
success=0
skipped=0
failed=0
# 遍历父目录下的所有一级子文件夹
for project_path in "$PARENT_DIR"/*/; do
# 去除末尾的斜杠
project_path="${project_path%/}"
# 跳过不是目录的项
if [ ! -d "$project_path" ]; then
continue
fi
# 获取项目文件夹名称
project_name=$(basename "$project_path")
# 计数
((total++))
echo -e "${BLUE}[$total] 处理项目: $project_name${NC}"
# 进入项目目录
cd "$project_path" || {
echo -e "${RED} ✗ 无法进入目录${NC}"
((failed++))
continue
}
# 检查是否为 Git 仓库
if [ ! -d ".git" ]; then
echo -e "${YELLOW} → 初始化 Git 仓库...${NC}"
# 初始化 Git 仓库
if ! git init -b "$DEFAULT_BRANCH" >/dev/null 2>&1; then
# 兼容旧版本 Git
git init >/dev/null 2>&1
git checkout -b "$DEFAULT_BRANCH" >/dev/null 2>&1
fi
# 设置远程仓库
remote_url="$GIT_BASE_URL/$GIT_USERNAME/${project_name}.git"
git remote add origin "$remote_url" >/dev/null 2>&1
echo -e "${GREEN} ✓ 已初始化并设置远程仓库: $remote_url${NC}"
fi
# 检查是否有改动
if git diff --quiet && git diff --cached --quiet; then
# 检查是否有未跟踪的文件
if [ -z "$(git ls-files --others --exclude-standard)" ]; then
echo -e "${YELLOW} ○ 无改动,跳过${NC}"
((skipped++))
echo ""
continue
fi
fi
# 添加所有文件
echo -e "${YELLOW} → 添加文件...${NC}"
git add . >/dev/null 2>&1
# 再次检查是否有需要提交的内容
if git diff --cached --quiet; then
echo -e "${YELLOW} ○ 无需提交的改动,跳过${NC}"
((skipped++))
echo ""
continue
fi
# 生成提交信息(包含当前时间)
commit_msg="Auto commit at $(date '+%Y-%m-%d %H:%M:%S')"
# 提交
echo -e "${YELLOW} → 提交更改...${NC}"
if git commit -m "$commit_msg" >/dev/null 2>&1; then
echo -e "${GREEN} ✓ 提交成功${NC}"
# 推送到远程仓库
echo -e "${YELLOW} → 推送到远程仓库...${NC}"
# 尝试推送,捕获错误
if git push -u origin "$DEFAULT_BRANCH" 2>&1 | grep -q "Everything up-to-date\|Successfully"; then
echo -e "${GREEN} ✓ 推送成功${NC}"
((success++))
else
# 推送失败,尝试普通推送
if git push 2>&1 | grep -q "Everything up-to-date\|Successfully"; then
echo -e "${GREEN} ✓ 推送成功${NC}"
((success++))
else
echo -e "${RED} ✗ 推送失败(可能需要先 pull 或检查远程仓库)${NC}"
((failed++))
fi
fi
else
echo -e "${RED} ✗ 提交失败${NC}"
((failed++))
fi
echo ""
done
# 输出统计信息
echo -e "${BLUE}========================================${NC}"
echo -e "${BLUE}处理完成!${NC}"
echo -e "${BLUE}========================================${NC}"
echo -e "总计: $total 个项目"
echo -e "${GREEN}成功: $success${NC}"
echo -e "${YELLOW}跳过: $skipped${NC}"
echo -e "${RED}失败: $failed${NC}"
echo ""

View File

@@ -0,0 +1,167 @@
# ============================================
# Git 批量管理脚本 - PowerShell 版本
# 适用于 Windows PowerShell 和 PowerShell Core
# ============================================
# -------------------- 配置区 --------------------
# 父目录路径(支持相对路径和绝对路径)
# 示例:
# ".." -> 上级目录
# "." -> 当前目录
# ".\projects" -> 当前目录下的 projects 文件夹
# "..\projects" -> 上级目录下的 projects 文件夹
# "C:\projects" -> 绝对路径
# "$env:USERPROFILE\projects" -> 用户主目录下的 projects
$ParentDir = ".."
# Git 远程仓库用户名
$GitUsername = "e2hang"
# Git 远程仓库基础 URL
$GitBaseUrl = "https://huajishe.fun/git"
# 默认分支名
$DefaultBranch = "main"
# -------------------- 脚本主体 --------------------
# 将相对路径转换为绝对路径
$ParentDir = Resolve-Path -Path $ParentDir -ErrorAction SilentlyContinue
# 检查父目录是否存在
if (-not $ParentDir -or -not (Test-Path -Path $ParentDir -PathType Container)) {
Write-Host "错误: 父目录不存在或无法访问" -ForegroundColor Red
exit 1
}
Write-Host "========================================" -ForegroundColor Cyan
Write-Host "开始处理目录: $ParentDir" -ForegroundColor Cyan
Write-Host "========================================" -ForegroundColor Cyan
Write-Host ""
# 统计变量
$total = 0
$success = 0
$skipped = 0
$failed = 0
# 获取所有一级子文件夹
$projects = Get-ChildItem -Path $ParentDir -Directory
foreach ($project in $projects) {
$total++
$projectPath = $project.FullName
$projectName = $project.Name
Write-Host "[$total] 处理项目: $projectName" -ForegroundColor Cyan
# 进入项目目录
try {
Push-Location -Path $projectPath -ErrorAction Stop
}
catch {
Write-Host " ✗ 无法进入目录" -ForegroundColor Red
$failed++
continue
}
# 检查是否为 Git 仓库
if (-not (Test-Path -Path ".git" -PathType Container)) {
Write-Host " → 初始化 Git 仓库..." -ForegroundColor Yellow
# 初始化 Git 仓库
try {
git init -b $DefaultBranch 2>&1 | Out-Null
}
catch {
# 兼容旧版本 Git
git init 2>&1 | Out-Null
git checkout -b $DefaultBranch 2>&1 | Out-Null
}
# 设置远程仓库
$remoteUrl = "$GitBaseUrl/$GitUsername/$projectName.git"
git remote add origin $remoteUrl 2>&1 | Out-Null
Write-Host " ✓ 已初始化并设置远程仓库: $remoteUrl" -ForegroundColor Green
}
# 检查是否有改动
$diffResult = git diff --quiet 2>&1
$diffCachedResult = git diff --cached --quiet 2>&1
$untrackedFiles = git ls-files --others --exclude-standard 2>&1
if ($LASTEXITCODE -eq 0 -and $diffCachedResult -eq $null -and [string]::IsNullOrWhiteSpace($untrackedFiles)) {
Write-Host " ○ 无改动,跳过" -ForegroundColor Yellow
$skipped++
Pop-Location
Write-Host ""
continue
}
# 添加所有文件
Write-Host " → 添加文件..." -ForegroundColor Yellow
git add . 2>&1 | Out-Null
# 再次检查是否有需要提交的内容
git diff --cached --quiet 2>&1
if ($LASTEXITCODE -eq 0) {
Write-Host " ○ 无需提交的改动,跳过" -ForegroundColor Yellow
$skipped++
Pop-Location
Write-Host ""
continue
}
# 生成提交信息
$timestamp = Get-Date -Format "yyyy-MM-dd HH:mm:ss"
$commitMsg = "Auto commit at $timestamp"
# 提交
Write-Host " → 提交更改..." -ForegroundColor Yellow
$commitResult = git commit -m $commitMsg 2>&1
if ($LASTEXITCODE -eq 0) {
Write-Host " ✓ 提交成功" -ForegroundColor Green
# 推送到远程仓库
Write-Host " → 推送到远程仓库..." -ForegroundColor Yellow
# 尝试推送
$pushResult = git push -u origin $DefaultBranch 2>&1
if ($LASTEXITCODE -eq 0 -or $pushResult -match "Everything up-to-date|Successfully") {
Write-Host " ✓ 推送成功" -ForegroundColor Green
$success++
}
else {
# 尝试普通推送
$pushResult = git push 2>&1
if ($LASTEXITCODE -eq 0 -or $pushResult -match "Everything up-to-date|Successfully") {
Write-Host " ✓ 推送成功" -ForegroundColor Green
$success++
}
else {
Write-Host " ✗ 推送失败(可能需要先 pull 或检查远程仓库)" -ForegroundColor Red
$failed++
}
}
}
else {
Write-Host " ✗ 提交失败" -ForegroundColor Red
$failed++
}
# 返回上级目录
Pop-Location
Write-Host ""
}
# 输出统计信息
Write-Host "========================================" -ForegroundColor Cyan
Write-Host "处理完成!" -ForegroundColor Cyan
Write-Host "========================================" -ForegroundColor Cyan
Write-Host "总计: $total 个项目"
Write-Host "成功: $success" -ForegroundColor Green
Write-Host "跳过: $skipped" -ForegroundColor Yellow
Write-Host "失败: $failed" -ForegroundColor Red
Write-Host ""

View File

@@ -1,45 +0,0 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
void dfs(char* arr, char* path, bool* visited, int num) {
int n = strlen(arr);
if (num == n) {
printf("%s\n", path);
return;
}
int m = strlen(path);
for (int i = 0; i < n; i++) {
if (!visited[i]) {
char* tmp = (char*)realloc(path, (m + 2) * sizeof(char));
tmp[m] = arr[i];
tmp[m + 1] = '\0';
visited[i] = true;
dfs(arr, tmp, visited, num + 1);
visited[i] = false;
}
}
}
int main() {
char arr[1000];
bool visited[1000] = {0};
fgets(arr, 1000, stdin);
int len = strlen(arr);
if (len > 0 && arr[len - 1] == '\n')
arr[len - 1] = '\0';
char* path = (char*)malloc(1);
path[0] = '\0';
dfs(arr, path, visited, 0);
free(path);
return 0;
}

BIN
c/1.exe

Binary file not shown.

BIN
c/2.exe

Binary file not shown.

BIN
c/4.exe

Binary file not shown.

Binary file not shown.

0
c/help Normal file
View File

BIN
cpp/1 Executable file

Binary file not shown.

22
cpp/1.cpp Normal file
View File

@@ -0,0 +1,22 @@
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
int n;
cin >> n;
int *arr = new int[n];
for(int i = 0; i < n; ++i) {
int tmp;
cin >> tmp;
if (tmp % (i + 1) == 0) {
++tmp;
}
arr[i] = tmp;
}
for(int i = 0; i < n; ++i) {
cout << arr[i] << " ";
}
cout << endl;
return 0;
}

211
cpp/1.s Normal file
View File

@@ -0,0 +1,211 @@
.file "1.cpp"
.text
#APP
.globl _ZSt21ios_base_library_initv
#NO_APP
.section .text._ZNKSt5ctypeIcE8do_widenEc,"axG",@progbits,_ZNKSt5ctypeIcE8do_widenEc,comdat
.align 2
.p2align 4
.weak _ZNKSt5ctypeIcE8do_widenEc
.type _ZNKSt5ctypeIcE8do_widenEc, @function
_ZNKSt5ctypeIcE8do_widenEc:
.LFB1810:
.cfi_startproc
endbr64
movl %esi, %eax
ret
.cfi_endproc
.LFE1810:
.size _ZNKSt5ctypeIcE8do_widenEc, .-_ZNKSt5ctypeIcE8do_widenEc
.section .rodata.str1.1,"aMS",@progbits,1
.LC0:
.string " "
.section .text.unlikely,"ax",@progbits
.LCOLDB1:
.section .text.startup,"ax",@progbits
.LHOTB1:
.p2align 4
.globl main
.type main, @function
main:
.LFB2311:
.cfi_startproc
endbr64
pushq %r14
.cfi_def_cfa_offset 16
.cfi_offset 14, -16
pushq %r13
.cfi_def_cfa_offset 24
.cfi_offset 13, -24
leaq _ZSt3cin(%rip), %r13
pushq %r12
.cfi_def_cfa_offset 32
.cfi_offset 12, -32
movq %r13, %rdi
pushq %rbp
.cfi_def_cfa_offset 40
.cfi_offset 6, -40
pushq %rbx
.cfi_def_cfa_offset 48
.cfi_offset 3, -48
subq $16, %rsp
.cfi_def_cfa_offset 64
movq %fs:40, %rax
movq %rax, 8(%rsp)
xorl %eax, %eax
movq %rsp, %rsi
call _ZNSirsERi@PLT
movslq (%rsp), %rdi
movabsq $2305843009213693950, %rax
cmpq %rdi, %rax
jb .L4
salq $2, %rdi
xorl %ebx, %ebx
leaq 4(%rsp), %r14
call _Znam@PLT
movq %rax, %rbp
movq %rax, %r12
movl (%rsp), %eax
testl %eax, %eax
jle .L25
.p2align 4,,10
.p2align 3
.L10:
movq %r14, %rsi
movq %r13, %rdi
addl $1, %ebx
call _ZNSirsERi@PLT
movl 4(%rsp), %ecx
movl %ecx, %eax
cltd
idivl %ebx
movl (%rsp), %eax
cmpl $1, %edx
adcl $0, %ecx
addq $4, %r12
movl %ecx, -4(%r12)
cmpl %eax, %ebx
jl .L10
testl %eax, %eax
jle .L25
xorl %ebx, %ebx
leaq _ZSt4cout(%rip), %r12
leaq .LC0(%rip), %r13
.p2align 4,,10
.p2align 3
.L12:
movl 0(%rbp,%rbx,4), %esi
movq %r12, %rdi
addq $1, %rbx
call _ZNSolsEi@PLT
movl $1, %edx
movq %r13, %rsi
movq %rax, %rdi
call _ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l@PLT
cmpl %ebx, (%rsp)
jg .L12
.L11:
movq _ZSt4cout(%rip), %rax
movq -24(%rax), %rax
movq 240(%r12,%rax), %rbx
testq %rbx, %rbx
je .L26
cmpb $0, 56(%rbx)
je .L14
movsbl 67(%rbx), %esi
.L15:
movq %r12, %rdi
call _ZNSo3putEc@PLT
movq %rax, %rdi
call _ZNSo5flushEv@PLT
movq 8(%rsp), %rax
subq %fs:40, %rax
jne .L27
addq $16, %rsp
.cfi_remember_state
.cfi_def_cfa_offset 48
xorl %eax, %eax
popq %rbx
.cfi_def_cfa_offset 40
popq %rbp
.cfi_def_cfa_offset 32
popq %r12
.cfi_def_cfa_offset 24
popq %r13
.cfi_def_cfa_offset 16
popq %r14
.cfi_def_cfa_offset 8
ret
.L14:
.cfi_restore_state
movq %rbx, %rdi
call _ZNKSt5ctypeIcE13_M_widen_initEv@PLT
movq (%rbx), %rax
movl $10, %esi
leaq _ZNKSt5ctypeIcE8do_widenEc(%rip), %rdx
movq 48(%rax), %rax
cmpq %rdx, %rax
je .L15
movl $10, %esi
movq %rbx, %rdi
call *%rax
movsbl %al, %esi
jmp .L15
.L25:
leaq _ZSt4cout(%rip), %r12
jmp .L11
.L26:
movq 8(%rsp), %rax
subq %fs:40, %rax
jne .L28
call _ZSt16__throw_bad_castv@PLT
.L27:
call __stack_chk_fail@PLT
.L28:
call __stack_chk_fail@PLT
.cfi_endproc
.section .text.unlikely
.cfi_startproc
.type main.cold, @function
main.cold:
.LFSB2311:
.L4:
.cfi_def_cfa_offset 64
.cfi_offset 3, -48
.cfi_offset 6, -40
.cfi_offset 12, -32
.cfi_offset 13, -24
.cfi_offset 14, -16
movq 8(%rsp), %rax
subq %fs:40, %rax
jne .L29
call __cxa_throw_bad_array_new_length@PLT
.L29:
call __stack_chk_fail@PLT
.cfi_endproc
.LFE2311:
.section .text.startup
.size main, .-main
.section .text.unlikely
.size main.cold, .-main.cold
.LCOLDE1:
.section .text.startup
.LHOTE1:
.ident "GCC: (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0"
.section .note.GNU-stack,"",@progbits
.section .note.gnu.property,"a"
.align 8
.long 1f - 0f
.long 4f - 1f
.long 5
0:
.string "GNU"
1:
.align 8
.long 0xc0000002
.long 3f - 2f
2:
.long 0x3
3:
.align 8
4:

7
cpp/algo/#p1093.cpp# Normal file
View File

@@ -0,0 +1,7 @@
#include <iostream>
#include <vector>
using namespace std;
int main(int argc, char* argv[]){
return 0;
}

77
cpp/algo/#p4667.cpp# Normal file
View File

@@ -0,0 +1,77 @@
#include <iostream>
#include <vector>
#include <deque>
using namespace std;
// 方向数组:右上,右下,左下,左上 (对应格点的移动)
const int dir[4][2] = {{-1, 1}, {1, 1}, {1, -1}, {-1, -1}};
// 对应方向上,方格应该有的形状
const char expect[4] = {'/', '\\', '/', '\\'};
// 对应方向上,方格在 mat 中的坐标偏移
const int dr[4] = {-1, 0, 0, -1};
const int dc[4] = {0, 0, -1, -1};
const int INF = 1e9;
int main() {
int n, m;
if (!(cin >> n >> m)) return 0;
// 奇偶性剪枝:如果终点坐标和为奇数,绝对无法到达
if ((n + m) % 2 != 0) {
cout << "NO SOLUTION" << endl;
return 0;
}
vector<vector<char>> mat(n, vector<char>(m));
// 修正dist 必须是 int 类型,初始化为无穷大
vector<vector<int>> dist(n + 1, vector<int>(m + 1, INF));
for (int i = 0; i < n; ++i) {
for (int j = 0; j < m; ++j) {
cin >> mat[i][j];
}
}
deque<pair<int, int>> dq;
dist[0][0] = 0;
dq.push_back({0, 0});
while (!dq.empty()) {
pair<int, int> curr = dq.front();
dq.pop_front();
int r = curr.first;
int c = curr.second;
for (int i = 0; i < 4; ++i) {
int nr = r + dir[i][0];
int nc = c + dir[i][1];
// 检查格点是否越界
if (nr >= 0 && nr <= n && nc >= 0 && nc <= m) {
// 对应方格的坐标
int tr = r + dr[i];
int tc = c + dc[i];
// 如果当前方向的字符与地图不符,权值为 1否则为 0
int weight = (mat[tr][tc] == expect[i] ? 0 : 1);
if (dist[r][c] + weight < dist[nr][nc]) {
dist[nr][nc] = dist[r][c] + weight;
if (weight == 0) {
dq.push_front({nr, nc}); // 权值为0插到队头
} else {
dq.push_back({nr, nc}); // 权值为1插到队尾
}
}
}
}
}
if (dist[n][m] == INF) cout << "NO SOLUTION" << endl;
else cout << dist[n][m] << endl;
return 0;
}

26
cpp/algo/LGR-43/1.cpp Normal file
View File

@@ -0,0 +1,26 @@
#include <iostream>
#include <unordered_map>
using namespace std;
int main(){
int a[4][4];
int x, y;
for(int i = 0; i < 4; i++){
for(int j = 0; j < 4; j++){
cin >> a[i][j];
if(a[i][j] == 0) {
x = i; y = j;
}
}
}
unordered_map<int, int> mp;
for(int i = 0; i < 4; i++){
mp[a[x][i]] = 1;
}
for(int i = 0; i < 5; i++){
if(mp.count(i) == 0) {
cout << i << endl;
return 0;
}
}
return 0;
}

17
cpp/algo/LGR-43/2.cpp Normal file
View File

@@ -0,0 +1,17 @@
#include <iostream>
#include <vector>
using namespace std;
int main(){
int sum = 0;
for(int i = 0; i < 5; i++){
int x;
cin >> x;
sum += x;
}
if(sum <= 99) cout << "Grey";
if(sum >= 100 && sum <= 119) cout << "Blue";
if(sum >= 120 && sum <= 169) cout << "Green";
if(sum >= 170 && sum <= 229) cout << "Orange";
if(sum >= 230) cout << "Red";
return 0;
}

23
cpp/algo/LGR-43/3.cpp Normal file
View File

@@ -0,0 +1,23 @@
#include <iostream>
#include <vector>
using namespace std;
int main(){
int n, m;
cin >> n >> m;
vector<int> num(n);
for(int i = 0; i < n; i++){
int a, b;
cin >> a >> b;
num[i] = a * b;
}
int sum = 0;
int cnt = 0;
for(int i = 0; i < n; i++){
sum += num[i];
cnt += 2;
if(sum >= m) break;
}
cout << cnt << endl;
return 0;
}

51
cpp/algo/LGR-43/4.cpp Normal file
View File

@@ -0,0 +1,51 @@
#include <iostream>
#include <vector>
#include <algorithm> // 必须引入排序
using namespace std;
// 定义排序规则:按结束时间从小到大排
bool cmp(const pair<int, int>& a, const pair<int, int>& b) {
return a.second < b.second;
}
int main(){
int luogugrass = 0; // 定义必要变量
int n, m;
cin >> n >> m;
vector<vector<pair<int, int>>> arr(n);
for(int i = 0; i < n; i++){
int num;
cin >> num;
arr[i].resize(num);
for(int j = 0; j < num; j++){
cin >> arr[i][j].first >> arr[i][j].second;
}
// --- 核心改动 1对每一层课程按结束时间排序 ---
sort(arr[i].begin(), arr[i].end(), cmp);
}
int end = 0; // 修改:初始结束时间应为 0
bool isfind = true;
for(int i = 0; i < n; i++){
bool flag = false;
// 由于已经排序,第一个满足 first > end 的就是最早结束的班级
for(int j = 0; j < arr[i].size(); j++){
if(arr[i][j].first > end) {
end = arr[i][j].second;
flag = true;
break;
}
}
if(flag == false) {
isfind = false;
break; // --- 核心改动 2一旦某门课修不了直接跳出 ---
}
}
// --- 核心改动 3最后判断是否超过了总天数 m ---
if(isfind && end <= m) cout << end << endl;
else cout << -1 << endl;
return 0;
}

35
cpp/algo/LGR-43/5.cpp Normal file
View File

@@ -0,0 +1,35 @@
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int uncrownerror = 0;
int main() {
int n, m, k;
cin >> n >> m >> k;
vector<int> belongs(m + 1, 0);
for (int i = 0; i < k; ++i) {
int op, u, v;
cin >> op >> u >> v;
if (op == 1) {
belongs[u] = v;
} else {
vector<int> temp;
for (int j = 1; j <= m; ++j) {
if (belongs[j] == v) {
temp.push_back(j);
}
}
if (u <= temp.size()) {
cout << temp[u - 1] << endl;
} else {
cout << -1 << endl;
}
}
}
return 0;
}

69
cpp/algo/LGR-43/6.cpp Normal file
View File

@@ -0,0 +1,69 @@
#include <iostream>
#include <vector>
#include <cmath>
using namespace std;
int main() {
int edgegrad = 0;
int h, w;
cin >> h >> w;
vector<vector<double>> diffSum(h + 1, vector<double>(w + 1, 0));
vector<vector<int>> Ir(h, vector<int>(w)), Ig(h, vector<int>(w)), Ib(h, vector<int>(w));
for(int i=0; i<h; i++) for(int j=0; j<w; j++) cin >> Ir[i][j];
for(int i=0; i<h; i++) for(int j=0; j<w; j++) cin >> Ig[i][j];
for(int i=0; i<h; i++) for(int j=0; j<w; j++) cin >> Ib[i][j];
for(int i=0; i<h; i++) {
for(int j=0; j<w; j++) {
int kr; cin >> kr;
diffSum[i+1][j+1] += pow(Ir[i][j] - kr, 2);
}
}
for(int i=0; i<h; i++) {
for(int j=0; j<w; j++) {
int kg; cin >> kg;
diffSum[i+1][j+1] += pow(Ig[i][j] - kg, 2);
}
}
for(int i=0; i<h; i++) {
for(int j=0; j<w; j++) {
int kb; cin >> kb;
diffSum[i+1][j+1] += pow(Ib[i][j] - kb, 2);
}
}
vector<vector<double>> s(h + 1, vector<double>(w + 1, 0));
for(int i=1; i<=h; i++) {
for(int j=1; j<=w; j++) {
s[i][j] = diffSum[i][j] + s[i-1][j] + s[i][j-1] - s[i-1][j-1];
}
}
double minM = 1e18;
for(int x1=1; x1<=h; x1++) {
for(int y1=1; y1<=w; y1++) {
for(int x2=x1; x2<=h; x2++) {
for(int y2=y1; y2<=w; y2++) {
int curH = x2 - x1 + 1;
int curW = y2 - y1 + 1;
if(curH >= (h + 1) / 2 && curW >= (w + 1) / 2) {
double totalDiff = s[x2][y2] - s[x1-1][y2] - s[x2][y1-1] + s[x1-1][y1-1];
double M = totalDiff / (3.0 * curH * curW);
if(M < minM) minM = M;
}
}
}
}
}
double psnr = 20.0 * log10(255.0 / sqrt(minM));
cout << psnr << endl;
return 0;
}

50
cpp/algo/LGR-43/7.cpp Normal file
View File

@@ -0,0 +1,50 @@
#include <iostream>
#include <vector>
#include <string>
#include <unordered_map>
using namespace std;
int main() {
int Q; // 原代码里的 n 建议改为 Q 匹配题目描述
cin >> Q;
while(Q--) {
int n; cin >> n;
string E; cin >> E;
unordered_map<char, int> mp;
for(int j = 0; j < n; ++j) {
string s; cin >> s;
// 找到等号位置,解析后面的数字
mp[s[0]] = stoi(s.substr(2));
}
long long left_sum = 0, right_sum = 0;
long long* cur_sum = &left_sum; // 指向当前正在计算的那一侧
int sign = 1;
for(int i = 0; i < E.length(); ++i) {
if(E[i] == '=') {
*cur_sum += 0; // 结算最后一项(如果有)
cur_sum = &right_sum; // 切换到右侧
sign = 1; // 重置符号
} else if(E[i] == '+') {
sign = 1;
} else if(E[i] == '-') {
sign = -1;
} else if(E[i] >= 'a' && E[i] <= 'z') {
*cur_sum += (long long)sign * mp[E[i]];
} else if(isdigit(E[i])) {
long long num = 0;
while(i < E.length() && isdigit(E[i])) {
num = num * 10 + (E[i] - '0');
i++;
}
*cur_sum += sign * num;
i--; // 补偿循环的 ++
}
}
if(left_sum == right_sum) cout << "Yes" << endl;
else cout << "No" << endl;
}
return 0;
}

22
cpp/algo/LGR-43/8-2.cpp Normal file
View File

@@ -0,0 +1,22 @@
#include <iostream>
#include <vector>
#include <deque>
using namespace std;
void dfs()
int main(){
int itemize = 0; // 定义必要变量
int a[4][4];
deque<pair<int, int>> sp;
for(int i = 0; i < 4; i++){
for(int j = 0; j < 4; j++){
cin >> a[i][j];
if(a[i][j] == 0){
sp.push_back({i, j});
}
}
}
return 0;
}

73
cpp/algo/LGR-43/8.cpp Normal file
View File

@@ -0,0 +1,73 @@
#include <iostream>
#include <vector>
#include <deque>
using namespace std;
int main(){
int itemize = 0; // 定义必要变量
int a[4][4];
deque<pair<int, int>> sp;
for(int i = 0; i < 4; i++){
for(int j = 0; j < 4; j++){
cin >> a[i][j];
if(a[i][j] == 0){
sp.push_back({i, j});
}
}
}
while(!sp.empty()){
pair<int, int> point = sp.front();
sp.pop_front();
// 记录当前格子 (point.first, point.second) 哪些数字不能填
bool used[5] = {false};
// 1. 检查行
for(int i = 0; i < 4; i++){
if(a[point.first][i] != 0) used[a[point.first][i]] = true;
}
// 2. 检查列
for(int i = 0; i < 4; i++){
if(a[i][point.second] != 0) used[a[i][point.second]] = true;
}
// 3. 检查 2x2 子网格
int rs = (point.first / 2) * 2, cs = (point.second / 2) * 2;
for(int i = rs; i < rs + 2; i++){
for(int j = cs; j < cs + 2; j++){
if(a[i][j] != 0) used[a[i][j]] = true;
}
}
int can_fill_count = 0;
int fill_val = 0;
for(int v = 1; v <= 4; v++){
if(!used[v]){
can_fill_count++;
fill_val = v;
}
}
if(can_fill_count == 1) {
// 如果唯一确定,填入数字
a[point.first][point.second] = fill_val;
} else {
// 暂时无法确定,放回队尾等下一轮
sp.push_back(point);
}
}
// 输出结果,注意题目要求的格式
for(int i = 0; i < 4; i++){
for(int j = 0; j < 4; j++){
cout << a[i][j] << (j == 3 ? "" : " ");
}
cout << endl;
}
return 0;
}

BIN
cpp/algo/LGR-43/a.exe Normal file

Binary file not shown.

View File

@@ -0,0 +1,5 @@
4 15
2 1 2 10 12
1 11 14
1 15 15
1 15 15

BIN
cpp/algo/a.exe Normal file

Binary file not shown.

19
cpp/algo/fastpow.cpp Normal file
View File

@@ -0,0 +1,19 @@
#include <iostream>
using namespace std;
double fastpow(double x, int a){
if(a == 0) return 1.0;
if(a < 0) return 1.0 / fastpow(x, -a);
double ans = fastpow(x, a/2);
ans *= ans;
if(a % 2 != 0) ans *= x;
return ans;
}
int main(){
int a; double b;
cin >> b >> a;
//cout << b << a;
cout << fastpow(b, a) << endl;
return 0;
}

7
cpp/algo/fastsort.cpp Normal file
View File

@@ -0,0 +1,7 @@
#include <iostream>
#include <vector>
using namespace std;
int main(){
return 0;
}

67
cpp/algo/hdu1195.cpp Normal file
View File

@@ -0,0 +1,67 @@
#include <iostream>
#include <deque>
#include <unordered_map>
#include <string>
using namespace std;
// 逻辑修改:将 map 放在 BFS 内部或在每次调用前清空,确保每个测试用例独立
int bfs(string& from, const string& to) {
if (from == to) return 0;
unordered_map<string, int> mp; // 记录步数
deque<string> dq;
dq.push_back(from);
mp[from] = 0; // 初始步数为 0
while (!dq.empty()) {
string top = dq.front();
int step = mp[top];
dq.pop_front();
if (top == to) return step;
// 1. 尝试对每一位进行 +1 或 -1
for (int i = 0; i < 4; i++) {
for (int d : {1, -1}) {
string next_s = top;
int digit = next_s[i] - '0';
digit += d;
// 循环处理1减1变99加1变1
if (digit == 0) digit = 9;
if (digit == 10) digit = 1;
next_s[i] = digit + '0';
if (mp.find(next_s) == mp.end()) {
mp[next_s] = step + 1;
dq.push_back(next_s);
}
}
}
// 2. 尝试交换相邻数字
for (int i = 0; i < 3; i++) { // 4位数字有3对相邻位
string next_s = top;
swap(next_s[i], next_s[i+1]);
if (mp.find(next_s) == mp.end()) {
mp[next_s] = step + 1;
dq.push_back(next_s);
}
}
}
return -1; // 理论上本题必有解
}
int main() {
int n;
if (!(cin >> n)) return 0;
while (n--) {
string a, b;
cin >> a >> b;
cout << bfs(a, b) << endl;
}
return 0;
}

View File

@@ -0,0 +1,173 @@
/*
#
###
#####
###
#
*/
#include <iostream>
#include <vector>
#include <deque>
#include <map>
#include <algorithm>
using namespace std;
// 邻居表:定义每个索引位可以和哪些位交换
vector<int> adj[13] = {
{2}, // 0 -> 2
{2, 5}, // 1 -> 2, 5
{0, 1, 3, 6}, // 2 -> 0, 1, 3, 6
{2, 7}, // 3 -> 2, 7
{5}, // 4 -> 5
{1, 4, 6, 9}, // 5 -> 1, 4, 6, 9
{2, 5, 7, 10}, // 6 -> 2, 5, 7, 10
{3, 6, 8, 11}, // 7 -> 3, 6, 8, 11
{7}, // 8 -> 7
{5, 10}, // 9 -> 5, 10
{6, 9, 11, 12}, // 10 -> 6, 9, 11, 12
{7, 10}, // 11 -> 7, 10
{10} // 12 -> 10
};
/*
int bfs(vector<int> from, vector<int> to) {
if (from == to) return 0;
map<vector<int>, int> mp;
deque<vector<int>> dqf, dqb;
dqf.push_back(from);
dqb.push_back(to);
mp[from] = 1; // 正向从 1 开始
mp[to] = -1; // 反向从 -1 开始
while (!dqf.empty() && !dqb.empty()) {
// 扩展较小的一端
bool forward = dqf.size() <= dqb.size();
deque<vector<int>>& dq = forward ? dqf : dqb;
vector<int> top = dq.front();
dq.pop_front();
int step = mp[top];
// 超过步数限制剪枝 (双向BFS每边超过10步总计就可能超20)
if (abs(step) > 10) continue;
// 找到两个空格0的位置
for (int i = 0; i < 13; ++i) {
if (top[i] == 0) {
// 尝试将邻居移动到空格
for (int neighbor : adj[i]) {
vector<int> next_v = top;
swap(next_v[i], next_v[neighbor]);
if (mp.count(next_v)) {
if (forward && mp[next_v] < 0) {
int total = (step - 1) + abs(mp[next_v]);
if (total <= 20) return total;
}
if (!forward && mp[next_v] > 0) {
int total = (abs(step) - 1) + mp[next_v];
if (total <= 20) return total;
}
continue;
}
if (abs(step) < 11) { // 限制单向搜索深度
mp[next_v] = forward ? step + 1 : step - 1;
dq.push_back(next_v);
}
}
}
}
}
return -1;
}*/
int bfs(vector<int> from, vector<int> to) {
if (from == to) return 0;
map<vector<int>, int> mpf, mpb;
deque<vector<int>> dqf, dqb;
dqf.push_back(from);
dqb.push_back(to);
mpf[from] = 0;
mpb[to] = 0;
while (!dqf.empty() && !dqb.empty()) {
// 扩展较小的一端
bool forward = dqf.size() <= dqb.size();
if (forward) {
vector<int> top = dqf.front();
dqf.pop_front();
int step = mpf[top];
if (step >= 10) continue;
for (int i = 0; i < 13; ++i) {
if (top[i] == 0) {
for (int neighbor : adj[i]) {
vector<int> next_v = top;
swap(next_v[i], next_v[neighbor]);
if (mpf.count(next_v)) continue;
mpf[next_v] = step + 1;
if (mpb.count(next_v)) {
int total = mpf[next_v] + mpb[next_v];
if (total <= 20) return total;
}
dqf.push_back(next_v);
}
}
}
} else {
vector<int> top = dqb.front();
dqb.pop_front();
int step = mpb[top];
if (step >= 10) continue;
for (int i = 0; i < 13; ++i) {
if (top[i] == 0) {
for (int neighbor : adj[i]) {
vector<int> next_v = top;
swap(next_v[i], next_v[neighbor]);
if (mpb.count(next_v)) continue;
mpb[next_v] = step + 1;
if (mpf.count(next_v)) {
int total = mpf[next_v] + mpb[next_v];
if (total <= 20) return total;
}
dqb.push_back(next_v);
}
}
}
}
}
return -1;
}
int main(){
const vector<int> end({0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 0});
int n;
cin >> n;
vector<vector<int>> pz(n, vector<int>(13));
for(int i = 0; i < n; ++i){
for(int j = 0; j < 13; ++j){
cin >> pz[i][j];
}
}
for(int i = 0; i < n; ++i){
int x = bfs(pz[i], end);
if(x == -1) cout << "No solution!" << endl;
else cout << x << endl;
}
return 0;
}

View File

@@ -0,0 +1,93 @@
#include <iostream>
#include <vector>
#include <deque>
#include <map>
#include <algorithm>
using namespace std;
// 正确的邻居表 (基于上下左右连接)
vector<int> adj[13] = {
{2}, // 0 -> 2
{2, 5}, // 1 -> 2, 5
{0, 1, 3, 6}, // 2 -> 0, 1, 3, 6
{2, 7}, // 3 -> 2, 7
{5}, // 4 -> 5
{1, 4, 6, 9}, // 5 -> 1, 4, 6, 9
{2, 5, 7, 10}, // 6 -> 2, 5, 7, 10
{3, 6, 8, 11}, // 7 -> 3, 6, 8, 11
{7}, // 8 -> 7
{5, 10}, // 9 -> 5, 10
{6, 9, 11, 12}, // 10 -> 6, 9, 11, 12
{7, 10}, // 11 -> 7, 10
{10} // 12 -> 10
};
int bfs(vector<int> from, vector<int> to) {
if (from == to) return 0;
map<vector<int>, int> mp;
deque<vector<int>> dqf, dqb;
dqf.push_back(from);
dqb.push_back(to);
mp[from] = 1;
mp[to] = -1;
while (!dqf.empty() && !dqb.empty()) {
bool forward = dqf.size() <= dqb.size();
deque<vector<int>>& dq = forward ? dqf : dqb;
vector<int> top = dq.front();
dq.pop_front();
int step = mp[top];
if (abs(step) > 10) continue;
for (int i = 0; i < 13; ++i) {
if (top[i] == 0) {
for (int neighbor : adj[i]) {
vector<int> next_v = top;
swap(next_v[i], next_v[neighbor]);
if (mp.count(next_v)) {
int recorded = mp[next_v];
if (forward && recorded < 0) {
int total = (step - 1) + abs(recorded);
if (total <= 20) return total;
}
else if (!forward && recorded > 0) {
int total = (abs(step) - 1) + recorded;
if (total <= 20) return total;
}
continue; // 同向相遇不处理
}
if (abs(step) < 11) {
mp[next_v] = forward ? step + 1 : step - 1;
dq.push_back(next_v);
}
}
}
}
}
return -1;
}
int main() {
// 根据 HDU 3095 的目标状态:中间层左右两端是 0其余按序排
// 另一种可能是样例所示0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 0
const vector<int> end({0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 0});
int T;
if (!(cin >> T)) return 0;
while (T--) {
vector<int> pz(13);
for (int i = 0; i < 13; ++i) cin >> pz[i];
int x = bfs(pz, end);
if (x == -1 || x > 20) cout << "No solution!" << endl;
else cout << x << endl;
}
return 0;
}

4
cpp/algo/input.txt Normal file
View File

@@ -0,0 +1,4 @@
3 5
\\/\\
\\///
/\\\\

View File

@@ -0,0 +1,55 @@
#include <iostream>
#include <vector>
using namespace std;
//归并的时候 如果交换顺序逆序对++
long long ans = 0;
void merge(vector<int>& arr, int l, int r){
int mid = l + (r-l)/2;
vector<int> tmp;
int i = l, j = mid+1;
while(i <= mid && j <= r){
if(arr[i] <= arr[j]){
tmp.push_back(arr[i]);
i++;
} else {
tmp.push_back(arr[j]);
j++;
ans += mid-i+1;
}
}
while (i <= mid) {
tmp.push_back(arr[i]);
i++;
}
while (j <= r) {
tmp.push_back(arr[j]);
j++;
}
for(int i = l; i <= r; i++){
arr[i] = tmp[i-l];
}
}
void mergesort(vector<int>& arr, int l, int r){
if(l >= r) return;
int mid = l + (r-l)/2;
mergesort(arr, l, mid);
mergesort(arr, mid+1, r);
merge(arr, l, r);
}
//辅助函数
int main(){
int n;
cin >> n;
vector<int> arr(n);
for(int i = 0; i < n; ++i){
cin >> arr[i];
}
mergesort(arr,0, arr.size()-1);
/*for(auto x: arr){
cout << x << " ";
} cout << endl;*/
cout << ans << endl;
return 0;
}

65
cpp/algo/p1118.cpp Normal file
View File

@@ -0,0 +1,65 @@
#include <iostream>
#include <vector>
using namespace std;
int ans = 1e9;
vector<int> path;
vector<bool> visited;
vector<int> result;
bool detected = false;
int c[15][15];
void initc(int n){
for(int i = 0; i < n; i++){
c[i][0] = 1;
for(int j = 1; j <= i; j++){
//C(n, k) = C(n-1, k-1) + C(n-1, k)
c[i][j] = c[i-1][j-1] + c[i-1][j];
}
}
}
void dfs(vector<int>& path, vector<bool>& visited, int sum, int n, int currSum){
if(detected == true) return;
if(currSum > sum) return;
int s = path.size();
if(s == n){
int addup = 0;
for(int i = 0; i < s; i++){
addup += path[i] * c[s - 1][i];
}
//cout << addup << endl;
if(addup == sum) {
//result = result > path ? path : result;
result = path;
detected = true;
}
return;
}
for(int i = 1; i <= n; ++i){
if(!visited[i - 1]){
path.push_back(i);
visited[i - 1] = true;
dfs(path, visited, sum, n, currSum + i * c[n-1][path.size() - 1]);
visited[i - 1] = false;
path.pop_back();
}
}
}
int main(){
int n, sum;
cin >> n >> sum;
visited.resize(n, false);
initc(n);
dfs(path, visited, sum, n, 0);
for(auto& x: result){
cout << x << " ";
}
cout << endl;
return 0;
}

29
cpp/algo/p11853.cpp Normal file
View File

@@ -0,0 +1,29 @@
#include <iostream>
#include <vector>
using namespace std;
int main(){
int n;
cin >> n;
int end = -1;
vector<pair<int, int>> range(n);
for(int i = 0; i < n; ++i){
int l, r;
cin >> l >> r;
range[i] = {l, r};
if (end < r) end = r;
}
vector<int> d(end+2, 0), a(end+1, 0);
for(auto& [l, r]: range){
d[l]++;
d[r+1]--;
}
int smax = d[0];
a[0] = d[0];
for(int i = 1; i <= end; ++i){
a[i] = a[i-1] + d[i];
if(a[i] > smax) smax = a[i];
cout << a[i] << " ";
}
cout << smax << endl;
return 0;
}

61
cpp/algo/p1433-90.cpp Normal file
View File

@@ -0,0 +1,61 @@
#include <iostream>
#include <vector>
#include <cmath>
#include <iomanip>
using namespace std;
// 修改点1坐标改为 double
vector<pair<double, double>> points;
double ans = 1e9;
double calc(int last, int now){
double first = (points[last].first - points[now].first);
first *= first;
double second = (points[last].second - points[now].second);
second *= second;
return sqrt(first+second);
}
void dfs(vector<bool>& visited, double res, int num, int last){
// 修改点2必须加剪枝否则 n=15 会超时
if(res >= ans) return;
if(num == visited.size()){
if(res < ans) ans = res;
return;
}
for(int i = 0; i < visited.size(); ++i){
if(!visited[i]){
visited[i] = true;
double s = calc(last, i);
dfs(visited, res+s, num+1, i);
visited[i] = false;
}
}
}
int main(){
int n;
if(!(cin >> n)) return 0;
// 修改点3手动加入起点 (0,0)
// 这样 points[0] 就是起点,奶酪是 points[1] 到 points[n]
points.push_back({0, 0});
for(int i = 0; i < n; ++i){
double x, y;
cin >> x >> y;
points.push_back({x, y});
}
// visited 数组大小应包含起点,但起点默认已访问
vector<bool> visited(n + 1, false);
visited[0] = true;
// 从起点 (0,0) 开始搜,此时已访问 1 个点(起点),当前位置下标是 0
dfs(visited, 0, 1, 0);
cout << fixed << setprecision(2) << ans << endl;
return 0;
}

7
cpp/algo/p1462.cpp Normal file
View File

@@ -0,0 +1,7 @@
#include <iostream>
#include <vector>
using namespace std;
int main(){
return 0;
}

51
cpp/algo/p1824.cpp Normal file
View File

@@ -0,0 +1,51 @@
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
//int ax[] = {1, 2, 4, 8, 9};
//按照分布,检查是否能够排列即可
/*
1、读入arr, mid
2、按照分布排列找到离mid格最近的槽位插入
*/
int check(const vector<int>& arr, int mid){
if(arr.empty()) return 0;
int cnt = 1;
int n = arr.size();
int dist = 0;
for(int i = 1; i < n; ++i){
dist += arr[i] - arr[i - 1];
if(dist >= mid){
cnt++;
dist = 0;
}
}
return cnt;
}
int main(){
int n = 5, c = 3;
cin >> n >> c;
vector<int> arr(n);
for(int i = 0; i < n; i++){
cin >> arr[i];
//arr[i] = ax[i];
}
sort(arr.begin(), arr.end());
int smin = 0, smax = arr.back() - arr.front();
//range [smin, smax], do mid to this range
int l = smin, r = smax;
int ans = 0;
while(l <= r){
int mid = (l+r)/2;
int cc = check(arr, mid);
if (cc >= c) {
ans = mid;
l = mid + 1;
} else r = mid - 1;
}
cout << ans << endl;
return 0;
}

84
cpp/algo/p2880.cpp Normal file
View File

@@ -0,0 +1,84 @@
#include <iostream>
#include <vector>
using namespace std;
int main(){
int n, q;
cin >> n >> q;
vector<int> lg(n+1);
vector<int> height(n);
lg[1] = 0;
for(int i = 2; i <= n; ++i){
lg[i] = lg[i >> 1] + 1;
}
for(int i = 0; i < n; ++i){
cin >> height[i];
}
vector<vector<int>> st_max(n, vector<int>(20));
vector<vector<int>> st_min(n, vector<int>(20));
// 初始化第 0 层(长度为 1 的区间)
for(int i = 0; i < n; ++i) {
st_max[i][0] = st_min[i][0] = height[i];
}
// 核心倍增预处理
for(int j = 1; j <= lg[n]; ++j) { // 先枚举幂次
for(int i = 0; i + (1 << j) <= n; ++i) { // 枚举起点,确保不越界
// 长度为 2^j 的区间 = 两个长度为 2^(j-1) 的区间合并
st_max[i][j] = max(st_max[i][j-1], st_max[i + (1 << (j-1))][j-1]);
st_min[i][j] = min(st_min[i][j-1], st_min[i + (1 << (j-1))][j-1]);
}
}
for(int i = 0; i < q; ++i){
int a, b;
cin >> a >> b;
int len = b - a + 1;
int k = lg[len];
int res_max = max(st_max[a-1][k], st_max[b - (1 << k)][k]);
int res_min = min(st_min[a-1][k], st_min[b - (1 << k)][k]);
cout << res_max - res_min << endl;
}
return 0;
}
//dp困难方法
/*
#include <iostream>
#include <vector>
using namespace std;
const int INF = 1e9;
int main(){
int n, q;
cin >> n >> q;
vector<int> height(n);
vector<vector<int>> dp(n, vector<int>(n, INF));
for(int i = 0; i < n; ++i){
cin >> height[i];
dp[i][i] = height[i];
}
//dp function: dp[i][j] = min(dp[i][k], dp[k][j])
for(int i = 0; i < n; ++i){
for(int j = 1; j < n; ++j){
dp[i][j] = min(dp[i][j - 1], height[j]);
}
}
for(int i = 0; i < q; ++i){
int a, b;
cin >> a >> b;
cout << dp[a - 1][b - 1] << endl;
}
return 0;
}*/

48
cpp/algo/p3382.cpp Normal file
View File

@@ -0,0 +1,48 @@
#include <iostream>
#include <vector>
#include <iomanip>
#include <cmath>
using namespace std;
/*
double calc(const vector<double>& func, int x){
int n = func.size();
double ans = 0;
for(int i = 0; i < n; i++){
ans += pow(x, n-i) * func[i];
}
return ans;
}*/
//秦九韶算法
double calc(const vector<double>& func, double x){
double ans = 0;
for(double y: func){
ans = x * ans + y;
}
return ans;
}
int main(){
int n;
double l, r;
n = 3; l = -0.9981; r = 0.5;
//cin >> n >> l >> r;
//任取两个点,把[l, r]分成三段调整l, r的值
vector<double> func(n+1);
func[0] = 1; func[1] = -3; func[2] = -3; func[3] = 1;
/*for(int i = 0; i < n; i++){
}*/
double mid1, mid2;
double ans = 0;
while(r - l > 1e-6){
mid1 = l + (r-l)/3;
mid2 = r - (r-l)/3;
if(calc(func, mid1) > calc(func, mid2)){
r = mid2;
} else if(calc(func, mid1) <= calc(func, mid2)) {
l = mid1;
}
}
cout << fixed << setprecision(8) << l << endl;
return 0;
}

47
cpp/algo/p3397.cpp Normal file
View File

@@ -0,0 +1,47 @@
#include <iostream>
#include <vector>
using namespace std;
int main(){
// 重要公式 a[i][j] = a[i][j-1] + a[i-1][j] - a[i-1][j-1] + d[i][j]
ios::sync_with_stdio(0);
cin.tie(0);
int n, m;
cin >> n >> m;
vector<vector<int>> d(n+2, vector<int>(n+2, 0));
for(int i = 0; i < m; ++i){
int x1, x2, y1, y2;
cin >> x1 >> y1 >> x2 >> y2;
d[x1][y1] += 1;
d[x1][y2+1] -= 1;
d[x2+1][y1] -=1;
d[x2+1][y2+1] += 1;
}
vector<vector<int>> a(n+2, vector<int>(n+2, 0));
/*
a[0][0] = d[0][0];
for(int i = 0; i <= n; ++i){
for(int j = 0; j <= n; ++j){
if (i != 0 && j != 0) a[i][j] = a[i][j-1] + a[i-1][j] - a[i-1][j-1] + d[i][j];
else if (i == 0 && j != 0) a[i][j] = a[i][j-1] + d[i][j];
else if (i != 0 && j == 0) a[i][j] = a[i-1][j] + d[i][j];
}
}
*/
for (int i = 1; i <= n; ++i) {
for (int j = 1; j <= n; ++j) {
a[i][j] = a[i][j - 1] + a[i - 1][j] - a[i - 1][j - 1] + d[i][j];
}
}
for(int i = 1; i <= n; ++i){
for(int j = 1; j <= n; ++j){
cout << a[i][j] << " ";
}
cout << endl;
}
cout << endl;
return 0;
}

77
cpp/algo/p4667.cpp Normal file
View File

@@ -0,0 +1,77 @@
#include <iostream>
#include <vector>
#include <deque>
using namespace std;
// 方向数组:右上,右下,左下,左上 (对应格点的移动)
const int dir[4][2] = {{-1, 1}, {1, 1}, {1, -1}, {-1, -1}};
// 对应方向上,方格应该有的形状
const char expect[4] = {'/', '\\', '/', '\\'};
// 对应方向上,方格在 mat 中的坐标偏移
const int dr[4] = {-1, 0, 0, -1};
const int dc[4] = {0, 0, -1, -1};
const int INF = 1e9;
int main() {
int n, m;
if (!(cin >> n >> m)) return 0;
// 奇偶性剪枝:如果终点坐标和为奇数,绝对无法到达
if ((n + m) % 2 != 0) {
cout << "NO SOLUTION" << endl;
return 0;
}
vector<vector<char>> mat(n, vector<char>(m));
// 修正dist 必须是 int 类型,初始化为无穷大
vector<vector<int>> dist(n + 1, vector<int>(m + 1, INF));
for (int i = 0; i < n; ++i) {
for (int j = 0; j < m; ++j) {
cin >> mat[i][j];
}
}
deque<pair<int, int>> dq;
dist[0][0] = 0;
dq.push_back({0, 0});
while (!dq.empty()) {
pair<int, int> curr = dq.front();
dq.pop_front();
int r = curr.first;
int c = curr.second;
for (int i = 0; i < 4; ++i) {
int nr = r + dir[i][0];
int nc = c + dir[i][1];
// 检查格点是否越界
if (nr >= 0 && nr <= n && nc >= 0 && nc <= m) {
// 对应方格的坐标
int tr = r + dr[i];
int tc = c + dc[i];
// 如果当前方向的字符与地图不符,权值为 1否则为 0
int weight = (mat[tr][tc] == expect[i] ? 0 : 1);
if (dist[r][c] + weight < dist[nr][nc]) {
dist[nr][nc] = dist[r][c] + weight;
if (weight == 0) {
dq.push_front({nr, nc}); // 权值为0插到队头
} else {
dq.push_back({nr, nc}); // 权值为1插到队尾
}
}
}
}
}
if (dist[n][m] == INF) cout << "NO SOLUTION" << endl;
else cout << dist[n][m] << endl;
return 0;
}

View File

@@ -0,0 +1,39 @@
#define _ALLOW_COMPILER_AND_STL_VERSION_MISMATCH
#include <iostream>
#include <vector>
#include <unordered_set>
using namespace std;
class Solution {
public:
unordered_set<vector<int>> result;
vector<int> path;
vector<bool> visited;
void dfs(const vector<int>& nums, vector<int>& path, vector<bool>& visited){
if(path.size() == nums.size()) {
result.insert(path);
return;
}
//use index
for(int i = 0; i < nums.size(); i++){
if(!visited[i]){
path.push_back(nums[i]);
visited[i] = true;
dfs(nums, path, visited);
path.pop_back();
visited[i] = false;
}
}
}
vector<vector<int>> permuteUnique(vector<int>& nums) {
visited.resize(nums.size(), false);
dfs(nums, path, visited);
vector<vector<int>> res(result.begin(), result.end());
return res;
}
};
int main(){
}

87
cpp/algo/poj2449.cpp Normal file
View File

@@ -0,0 +1,87 @@
#include <iostream>
#include <vector>
#include <queue>
using namespace std;
const int INF = 1e9;
// A* 专用的状态结构体
struct State {
int f, g, u;
bool operator>(const State& other) const {
return f > other.f; // 小顶堆f 小的优先
}
};
int main() {
int n, m;
cin >> n >> m;
vector<vector<pair<int, int>>> adj(n + 1);
vector<vector<pair<int, int>>> adjReverse(n + 1);
for (int i = 0; i < m; ++i) {
int a, b, t;
cin >> a >> b >> t;
adj[a].push_back({b, t});
adjReverse[b].push_back({a, t});
}
int s, t, k;
cin >> s >> t >> k;
// 1. 反向 Dijkstra 计算 h(n)
vector<int> h(n + 1, INF);
priority_queue<pair<int, int>, vector<pair<int, int>>, greater<pair<int, int>>> jda;
h[t] = 0;
jda.push({0, t});
while (!jda.empty()) {
auto [d, u] = jda.top(); jda.pop();
if (d > h[u]) continue;
for (auto& edge : adjReverse[u]) {
int v = edge.first, w = edge.second;
if (h[u] + w < h[v]) {
h[v] = h[u] + w;
jda.push({h[v], v});
}
}
}
// 如果起点终点不连通h[s] 依然是 INF
if (h[s] == INF) {
cout << -1 << endl;
return 0;
}
// 2. 正向 A* 找第 K 短路
if (s == t) k++; // 经典细节:起点终点重合,第一条路径长度为 0需跳过
priority_queue<State, vector<State>, greater<State>> astar;
astar.push({h[s], 0, s}); // f = g + h = 0 + h[s]
vector<int> count(n + 1, 0); // 记录每个点被弹出的次数
while (!astar.empty()) {
State curr = astar.top(); astar.pop();
int u = curr.u;
int g = curr.g;
count[u]++;
// 终点第 K 次出堆,就是答案!
if (count[t] == k) {
cout << g << endl;
return 0;
}
// 如果某个点被弹出次数超过 k说明再从它出发也找不到前 k 短了,优化剪枝
if (count[u] > k) continue;
for (auto& edge : adj[u]) {
int v = edge.first, w = edge.second;
// 压入新状态g 增加实际边权f 更新为新 g + h[v]
astar.push({g + w + h[v], g + w, v});
}
}
cout << -1 << endl;
return 0;
}

2
ds/sort/input Normal file
View File

@@ -0,0 +1,2 @@
5
4 5 3 2 1

BIN
ds/sort/s Executable file

Binary file not shown.

56
ds/sort/shittysort.c Normal file
View File

@@ -0,0 +1,56 @@
#include <stdio.h>
#include <stdlib.h>
#define swap(type, a, b) do {type tmp = a; a = b; b = tmp;} while(0)
int full;
int partition(int* arr, int l, int r) {
int pivot = arr[l];
int i = l+1, j = r;
while (i <= j) {
while (i <= r && arr[i] <= pivot) i++;
while (arr[j] > pivot) j--;
if (i < j) {
swap(int, arr[i], arr[j]);
i++; j--;
}
}
swap(int, arr[l], arr[j]);
return j;
}
void quicksort(int* arr, int l, int r) {
if (l >= r) return;
int p = partition(arr, l, r);
for (int x = 0; x < full; ++x) {
printf("%d ", arr[x]);
}
printf("\n");
quicksort(arr, l, p - 1);
quicksort(arr, p + 1, r);
}
int main(){
int n;
scanf("%d", &n);
full = n;
int* arr = (int*)malloc(n * sizeof(int));
for(int i = 0; i < n; ++i){
scanf("%d", &arr[i]);
}
quicksort(arr, 0, n - 1);
for(int i = 0; i < n; ++i){
printf("%d ", arr[i]);
}
printf("\n");
free(arr);
return 0;
}

0
js/BasicSyntax/new.js Normal file
View File

13
python/luogu/p1433.py Normal file
View File

@@ -0,0 +1,13 @@
import collections
def dfs(path:list, visited):
if path.
n = int(input())
points = []
for i in range(n):
x = int(input())
y = int(input())
points.append([x, y])

45
python/music.py Normal file
View File

@@ -0,0 +1,45 @@
from playwright.sync_api import sync_playwright
import time
i = 0
with sync_playwright() as p:
browser = p.chromium.launch(headless=True, slow_mo=250)
while True:
i += 1
print(f"\n执行第{i}")
context = browser.new_context()
page = context.new_page()
try:
# 加入超时和 wait_until防止 page.goto 卡死
page.goto("https://music.163.com/playlist?id=2080114727", timeout=60000, wait_until="domcontentloaded")
# 尝试等待并进入 iframe
page.wait_for_selector("iframe[name='contentFrame']", timeout=15000)
frame = page.frame(name="contentFrame")
if not frame:
print("FALSE! 没有找到 iframe")
else:
print("TRUE! 成功进入 iframe")
# 等待并点击播放按钮
frame.wait_for_selector("text=播放", timeout=20000)
print("TRUE! 找到带“播放”文字的按钮")
frame.click("text=播放")
print("CLICKED!")
# 停留 5 秒播放
page.wait_for_timeout(5000)
except Exception as e:
print(f"出错:{e.__class__.__name__}: {e}")
finally:
print("关闭 context窗口")
context.close()
# 建议加一个等待,避免过度频繁访问被封
time.sleep(40)

8
python/test/test.py Normal file
View File

@@ -0,0 +1,8 @@
import collections
a = 15
b = 16
c = int(input("Give a integer input"))
x = {a, b, c}
print(a + b + c, x)

View File

@@ -0,0 +1,6 @@
[package]
name = "pointers"
version = "0.1.0"
edition = "2024"
[dependencies]

View File

@@ -0,0 +1,9 @@
use std::io;
use std::collections::*;
fn sort()
fn main() {
println!("Hello, world!");
}

4
tmp
View File

@@ -1,4 +0,0 @@
** THIS IS A TEMPORARY FILE **
what is this?

View File

@@ -1,400 +0,0 @@
!SESSION 2026-01-09 15:45:03.046 -----------------------------------------------
eclipse.buildId=unknown
java.version=25.0.1
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=zh_CN
Command-line arguments: -data ~/.emacs.d/cache/jdtls-workspace
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:04.818
!MESSAGE class org.eclipse.jdt.ls.core.internal.JavaLanguageServerPlugin is started
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:04.920
!MESSAGE Main thread is waiting
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:04.932
!MESSAGE >> initialize
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:04.933
!MESSAGE Initializing Java Language Server 1.9.0.202203031534
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:04.943
!MESSAGE Static Commands: []
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:04.943
!MESSAGE Non-Static Commands: [java.edit.organizeImports, java.project.refreshDiagnostics, java.project.import, java.navigate.openTypeHierarchy, java.project.removeFromSourcePath, java.project.listSourcePaths, java.project.resolveStackTraceLocation, java.project.getAll, java.project.isTestFile, java.project.getClasspaths, java.navigate.resolveTypeHierarchy, java.edit.stringFormatting, java.project.getSettings, java.project.updateSourceAttachment, java.project.upgradeGradle, java.project.resolveSourceAttachment, java.project.addToSourcePath]
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:04.945
!MESSAGE Wait for AutoBuildOffJob start
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:04.946
!MESSAGE Wait for AutoBuildOffJob end 1ms
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:04.946
!MESSAGE Starting org.eclipse.m2e.core
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:04.946
!MESSAGE Started org.eclipse.m2e.core 0ms
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:04.946
!MESSAGE ProjectRegistryRefreshJob finished 0ms
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:04.946
!MESSAGE Starting org.eclipse.buildship.core
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:04.952
!MESSAGE Started org.eclipse.buildship.core 6ms
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:06.158
!MESSAGE LoadingGradleVersionJob finished 1206ms
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:06.168
!MESSAGE Creating the Java project jdt.ls-java-project
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:06.186
!MESSAGE >> initialized
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:06.247
!MESSAGE Finished creating the Java project jdt.ls-java-project
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:06.460
!MESSAGE Workspace initialized in 301ms
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:06.490
!MESSAGE >> initialization job finished
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:06.492
!MESSAGE >> document/didOpen
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:06.570
!MESSAGE >> build jobs finished
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:06.573
!MESSAGE >> registerWatchers'
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:06.574
!MESSAGE >> registerFeature 'workspace/didChangeWatchedFiles'
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:06.575
!MESSAGE >> watchers registered
!SESSION 2026-01-09 15:45:05.925 -----------------------------------------------
eclipse.buildId=unknown
java.version=25.0.1
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=zh_CN
Command-line arguments: -data ~/.emacs.d/cache/jdtls-workspace
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:06.660
!MESSAGE class org.eclipse.jdt.ls.core.internal.JavaLanguageServerPlugin is started
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:06.744
!MESSAGE >> workspace/didChangeConfiguration
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:06.754
!MESSAGE >> New configuration: {}
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:06.756
!MESSAGE >> workspace/didChangeWatchedFiles
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:06.769
!MESSAGE >> workspace/didChangeWatchedFiles
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:06.774
!MESSAGE >> workspace/didChangeWatchedFiles
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:06.779
!MESSAGE Main thread is waiting
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:06.793
!MESSAGE >> initialize
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:06.794
!MESSAGE Initializing Java Language Server 1.9.0.202203031534
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:06.804
!MESSAGE Static Commands: []
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:06.805
!MESSAGE Non-Static Commands: [java.edit.organizeImports, java.project.refreshDiagnostics, java.project.import, java.navigate.openTypeHierarchy, java.project.removeFromSourcePath, java.project.listSourcePaths, java.project.resolveStackTraceLocation, java.project.getAll, java.project.isTestFile, java.project.getClasspaths, java.navigate.resolveTypeHierarchy, java.edit.stringFormatting, java.project.getSettings, java.project.updateSourceAttachment, java.project.upgradeGradle, java.project.resolveSourceAttachment, java.project.addToSourcePath]
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:06.807
!MESSAGE Wait for AutoBuildOffJob start
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:06.808
!MESSAGE Wait for AutoBuildOffJob end 0ms
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:06.808
!MESSAGE Starting org.eclipse.m2e.core
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:06.808
!MESSAGE Started org.eclipse.m2e.core 0ms
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:06.808
!MESSAGE ProjectRegistryRefreshJob finished 0ms
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:06.808
!MESSAGE Starting org.eclipse.buildship.core
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:06.815
!MESSAGE Started org.eclipse.buildship.core 7ms
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:06.838
!MESSAGE LoadingGradleVersionJob finished 23ms
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:06.846
!MESSAGE Creating the Java project jdt.ls-java-project
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:06.849
!MESSAGE >> initialized
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:06.904
!MESSAGE Finished creating the Java project jdt.ls-java-project
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:07.057
!MESSAGE Reconciled 1. Took 2 ms
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:07.178
!MESSAGE Workspace initialized in 338ms
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:07.184
!MESSAGE >> workspace/didChangeWatchedFiles
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:07.194
!MESSAGE >> workspace/didChangeWatchedFiles
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:07.203
!MESSAGE >> workspace/didChangeWatchedFiles
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:07.225
!MESSAGE >> initialization job finished
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:07.227
!MESSAGE >> workspace/didChangeConfiguration
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:07.236
!MESSAGE >> New configuration: {}
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:07.242
!MESSAGE >> workspace/didChangeWatchedFiles
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:07.251
!MESSAGE >> workspace/didChangeWatchedFiles
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:07.438
!MESSAGE >> build jobs finished
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:07.441
!MESSAGE >> registerWatchers'
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:07.442
!MESSAGE >> registerFeature 'workspace/didChangeWatchedFiles'
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:07.444
!MESSAGE >> watchers registered
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:07.551
!MESSAGE begin problem for /guessnum.java
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:07.552
!MESSAGE The value of the local variable tmp is not used is of type LocalVariableIsNeverUsed
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:07.553
!MESSAGE 2 problems reported for /guessnum.java
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:07.554
!MESSAGE Validated 1. Took 95 ms
!ENTRY org.eclipse.jdt.core 4 4 2026-01-09 15:45:09.066
!MESSAGE mergeWith - Failed to rename index file:/D:/Git/workspace/~/.emacs.d/cache/jdtls-workspace/.metadata/.plugins/org.eclipse.jdt.core/3906678465.index
!STACK 0
java.nio.file.FileSystemException: D:\Git\workspace\~\.emacs.d\cache\jdtls-workspace\.metadata\.plugins\org.eclipse.jdt.core\3906678465.index.tmp -> D:\Git\workspace\~\.emacs.d\cache\jdtls-workspace\.metadata\.plugins\org.eclipse.jdt.core\3906678465.index: 另一个程序正在使用此文件,进程无法访问。
at java.base/sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:92)
at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:103)
at java.base/sun.nio.fs.WindowsFileCopy.move(WindowsFileCopy.java:400)
at java.base/sun.nio.fs.WindowsFileSystemProvider.move(WindowsFileSystemProvider.java:287)
at java.base/java.nio.file.Files.move(Files.java:1319)
at org.eclipse.jdt.internal.core.index.DiskIndex.mergeWith(DiskIndex.java:597)
at org.eclipse.jdt.internal.core.index.Index.save(Index.java:230)
at org.eclipse.jdt.internal.core.search.indexing.IndexManager.saveIndex(IndexManager.java:1143)
at org.eclipse.jdt.internal.core.search.indexing.AddJrtToIndex.execute(AddJrtToIndex.java:274)
at org.eclipse.jdt.internal.core.search.processing.JobManager.run(JobManager.java:441)
at java.base/java.lang.Thread.run(Thread.java:1474)
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:17.473
!MESSAGE >> document/didChange
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:17.477
!MESSAGE >> document/completion
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:17.511
!MESSAGE Completion request completed
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:17.536
!MESSAGE Reconciled 1. Took 5 ms
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:17.878
!MESSAGE >> document/hover
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:17.879
!MESSAGE >> document/documentHighlight
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:17.880
!MESSAGE >> document/signatureHelp
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:17.948
!MESSAGE begin problem for /guessnum.java
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:17.949
!MESSAGE 2 problems reported for /guessnum.java
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:17.949
!MESSAGE Validated 1. Took 12 ms
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:19.698
!MESSAGE >> document/hover
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:19.699
!MESSAGE >> document/documentHighlight
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:19.699
!MESSAGE >> document/signatureHelp
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:22.176
!MESSAGE >> document/didChange
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:22.178
!MESSAGE >> document/hover
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:22.178
!MESSAGE >> document/documentHighlight
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:22.178
!MESSAGE >> document/signatureHelp
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:22.184
!MESSAGE Reconciled 1. Took 0 ms
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:22.595
!MESSAGE begin problem for /guessnum.java
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:22.596
!MESSAGE The value of the local variable tmp is not used is of type LocalVariableIsNeverUsed
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:22.596
!MESSAGE 2 problems reported for /guessnum.java
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:22.596
!MESSAGE Validated 1. Took 10 ms
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:25.685
!MESSAGE >> document/hover
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:25.686
!MESSAGE >> document/documentHighlight
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:25.686
!MESSAGE >> document/signatureHelp
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:26.450
!MESSAGE >> document/didChange
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:26.452
!MESSAGE >> document/hover
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:26.452
!MESSAGE >> document/documentHighlight
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:26.452
!MESSAGE >> document/signatureHelp
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:26.509
!MESSAGE Reconciled 1. Took 1 ms
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:26.919
!MESSAGE begin problem for /guessnum.java
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:26.919
!MESSAGE The value of the local variable tmp is not used is of type LocalVariableIsNeverUsed
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:26.919
!MESSAGE 2 problems reported for /guessnum.java
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:26.920
!MESSAGE Validated 1. Took 10 ms
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:26.961
!MESSAGE >> document/didChange
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:26.962
!MESSAGE >> document/hover
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:26.962
!MESSAGE >> document/documentHighlight
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:26.963
!MESSAGE >> document/signatureHelp
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:26.968
!MESSAGE Reconciled 1. Took 0 ms
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:27.155
!MESSAGE >> document/willSaveWaitUntil
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:27.203
!MESSAGE >> document/didSave
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:27.209
!MESSAGE >> workspace/didChangeWatchedFiles
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:27.209
!MESSAGE Clearing problems for /guessnum.java
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:27.216
!MESSAGE >> workspace/didChangeWatchedFiles
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:27.219
!MESSAGE >> workspace/didChangeWatchedFiles
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:27.221
!MESSAGE >> workspace/didChangeWatchedFiles
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:27.223
!MESSAGE >> workspace/didChangeWatchedFiles
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:27.223
!MESSAGE Clearing problems for /guessnum.java
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:27.228
!MESSAGE >> workspace/didChangeWatchedFiles
!ENTRY org.eclipse.jdt.core 4 4 2026-01-09 15:45:27.241
!MESSAGE mergeWith - Failed to rename index file:/D:/Git/workspace/~/.emacs.d/cache/jdtls-workspace/.metadata/.plugins/org.eclipse.jdt.core/1865797976.index
!STACK 0
java.nio.file.FileSystemException: D:\Git\workspace\~\.emacs.d\cache\jdtls-workspace\.metadata\.plugins\org.eclipse.jdt.core\1865797976.index.tmp -> D:\Git\workspace\~\.emacs.d\cache\jdtls-workspace\.metadata\.plugins\org.eclipse.jdt.core\1865797976.index: 另一个程序正在使用此文件,进程无法访问。
at java.base/sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:92)
at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:103)
at java.base/sun.nio.fs.WindowsFileCopy.move(WindowsFileCopy.java:400)
at java.base/sun.nio.fs.WindowsFileSystemProvider.move(WindowsFileSystemProvider.java:287)
at java.base/java.nio.file.Files.move(Files.java:1319)
at org.eclipse.jdt.internal.core.index.DiskIndex.mergeWith(DiskIndex.java:597)
at org.eclipse.jdt.internal.core.index.Index.save(Index.java:230)
at org.eclipse.jdt.internal.core.index.MetaIndex.save(MetaIndex.java:100)
at org.eclipse.jdt.internal.core.search.indexing.IndexManager.saveMetaIndex(IndexManager.java:1248)
at org.eclipse.jdt.internal.core.search.indexing.IndexManager.saveIndexes(IndexManager.java:1224)
at org.eclipse.jdt.internal.core.search.indexing.IndexManager.notifyIdle(IndexManager.java:819)
at org.eclipse.jdt.internal.core.search.processing.JobManager.run(JobManager.java:422)
at java.base/java.lang.Thread.run(Thread.java:1474)
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:27.242
!MESSAGE >> workspace/didChangeWatchedFiles
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:27.243
!MESSAGE >> workspace/didChangeWatchedFiles
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:27.711
!MESSAGE >> document/hover
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:27.711
!MESSAGE >> document/documentHighlight
!ENTRY org.eclipse.jdt.ls.core 1 0 2026-01-09 15:45:27.712
!MESSAGE >> document/signatureHelp

View File

@@ -1,2 +0,0 @@
eclipse.preferences.version=1
version=1

View File

@@ -1,17 +0,0 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.codeComplete.subwordMatch=disabled
org.eclipse.jdt.core.codeComplete.visibilityCheck=enabled
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=17
org.eclipse.jdt.core.compiler.compliance=17
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.missingSerialVersion=ignore
org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning
org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=ignore
org.eclipse.jdt.core.compiler.release=enabled
org.eclipse.jdt.core.compiler.source=17
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=true
org.eclipse.jdt.core.formatter.join_lines_in_comments=false
org.eclipse.jdt.core.formatter.join_wrapped_lines=false
org.eclipse.jdt.core.formatter.tabulation.char=space

View File

@@ -1,2 +0,0 @@
eclipse.preferences.version=1
org.eclipse.jdt.launching.PREF_VM_XML=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?>\r\n<vmSettings defaultVM\="57,org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType13,1767944706221">\r\n <vmType id\="org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType">\r\n <vm id\="1767944706221" name\="JavaJDK" path\="D\:\\JavaJDK"/>\r\n </vmType>\r\n</vmSettings>\r\n

View File

@@ -1,3 +0,0 @@
eclipse.m2.problem.notCoveredMojoExecution=ignore
eclipse.m2.problem.outofdateProjectConfig=warning
eclipse.preferences.version=1

View File

@@ -1,3 +0,0 @@
INDEX VERSION 1.131+D:\Git\workspace\~\.emacs.d\cache\jdtls-workspace\.metadata\.plugins\org.eclipse.jdt.core
1865797976.index
3906678465.index

View File

@@ -1,4 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<dirs>
<entry loc="D:\JavaJDK" stamp="1767944588368"/>
</dirs>

View File

@@ -1,4 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<libraryInfos>
<libraryInfo home="D:\JavaJDK" version="25.0.1"/>
</libraryInfos>

View File

@@ -1,2 +0,0 @@
2026-01-09 15:45:04,949 [Worker-1: Loading available Gradle versions] INFO o.e.b.c.i.u.g.PublishedGradleVersions - Gradle version information cache is not available. Remote download required.
2026-01-09 15:45:06,812 [Worker-1: Loading available Gradle versions] INFO o.e.b.c.i.u.g.PublishedGradleVersions - Gradle version information cache is up-to-date. Trying to read.

View File

@@ -1,41 +0,0 @@
<configuration scan="true">
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<pattern>%date [%thread] %-5level %logger{35} - %msg%n</pattern>
</encoder>
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>OFF</level> <!-- change to DEBUG to mimic '-consolelog' behaviour -->
</filter>
</appender>
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<File>${org.eclipse.m2e.log.dir}/0.log</File>
<rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
<FileNamePattern>${org.eclipse.m2e.log.dir}/%i.log</FileNamePattern>
<MinIndex>1</MinIndex>
<MaxIndex>10</MaxIndex>
</rollingPolicy>
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
<MaxFileSize>100MB</MaxFileSize>
</triggeringPolicy>
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<pattern>%date [%thread] %-5level %logger{35} - %msg%n</pattern>
</encoder>
</appender>
<appender name="EclipseLog" class="org.eclipse.m2e.logback.appender.EclipseLogAppender">
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>WARN</level>
</filter>
</appender>
<appender name="MavenConsoleLog" class="org.eclipse.m2e.logback.appender.MavenConsoleAppender">
</appender>
<root level="INFO">
<appender-ref ref="FILE" />
<appender-ref ref="STDOUT" />
<appender-ref ref="EclipseLog" />
<appender-ref ref="MavenConsoleLog" />
</root>
</configuration>

View File

@@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View File

@@ -1,24 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>jdt.ls-java-project</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
<linkedResources>
<link>
<name>src/guessnum.java</name>
<type>1</type>
<location>d:/Git/workspace/java/guessnum.java</location>
</link>
</linkedResources>
</projectDescription>

View File

@@ -1,2 +0,0 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled