Skip to content
Back to skills

Vloj

ASecurity

LibreOJ题目抓取与解题工作流。用户输入形如loj1/loj001或https://loj.ac/p/1 等题号或URL时触发;创建以题号命名的空文件夹,使用Chrome DevTools MCP读取题面并保存为md文件,最后用C++生成解答文件。

  • 57 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added October 17, 2026
toolsc++

Works with

  • mcp

Security analysis

A100/100

Scanned October 17, 2026

npx -y skills add diegosouzapw/awesome-omni-skill --skill vloj --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Vloj?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Vloj
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/diegosouzapw-vloj/badge)](https://www.skillsdirectory.com/skills/diegosouzapw-vloj)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: vloj
description: LibreOJ题目抓取与解题工作流。用户输入形如loj1/loj001或https://loj.ac/p/1 等题号或URL时触发;创建以题号命名的空文件夹,使用Chrome DevTools MCP读取题面并保存为md文件,最后用C++生成解答文件。
---

# vloj

## 目标

- 解析题号,创建以题号命名的空文件夹。
- 访问对应题目页面,抓取题面并写入Markdown。
- 编写C++解答文件。

## 触发与解析

- 支持输入示例:`loj1`、`loj001`、`https://loj.ac/p/1`、`http://loj.ac/p/123`。
- 提取连续数字作为题号,去除前导零后作为规范题号。
- 题目URL格式固定为:`https://loj.ac/p/<id>`。

## 工作流

1. **创建空文件夹**
   - 在当前工作区根目录创建以题号命名的文件夹:`<id>/`。
   - 若文件夹不存在,直接创建。
   - 若文件夹已存在且非空,先请求用户确认是否清空;确认后删除内容并保持空文件夹。

2. **读取题面(Chrome DevTools MCP)**
   - 打开题目URL并等待页面加载完成。
   - 使用页面快照或脚本评估获取题面主体文本:
     - 优先抓取页面主内容区域(常见为 `main`、`article`、或含“题目描述/输入格式/输出格式/样例”文本的容器)。
     - 无法精准定位时,回退使用 `document.body.innerText`,再按标题/小节进行整理。
   - 需要确保包含题目标题、描述、输入输出、样例与提示(如存在)。

3. **写入Markdown**
   - 在题号文件夹中创建 `problem.md`。
   - 内容结构:
     - 标题:`# <题号> <题目标题>`
     - URL:`原始URL`
     - 题面正文分节整理(保留原有小节标题)。

4. **编写C++解答**
   - 在题号文件夹中创建 `solution.cpp`。
   - 使用 C++11 标准,包含必要头文件与 `main()`。
   - 依据题意实现可通过的解法,并在顶部用简短注释说明思路与复杂度。

## 输出约束

- 仅创建 `problem.md` 与 `solution.cpp`,不生成额外文件。
- 保持文件夹为空创建流程的前置步骤,先建目录再抓取题面。

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.