Skip to content
vloj logo

Vloj

vloj

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

SKILL.md

Full skill instructions

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,不生成额外文件。
  • 保持文件夹为空创建流程的前置步骤,先建目录再抓取题面。

More Other skills

Delegate independent tasks to specialized agents working concurrently with isolated context.

295.4K 206.3K
View

Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.

179.7K 100.1K
View

Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with colors/fonts that you can apply to any artifact that has been creating, or can generate a new theme on-the-fly.

179.7K 89.5K
View

A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill whenever asked to write some sort of internal communications (status reports, leadership updates, 3P updates, company newsletters, FAQs, incident reports, project updates, etc.).

179.7K 76.1K
View

Fundamental design principles for writing maintainable, testable Python code.

40.2K 21.9K
View

Modern responsive layouts using container queries, fluid typography, CSS Grid, and mobile-first strategies.

40.2K 20K
View

Generate Playwright tests from scenarios using interactive browser exploration and validation.

39.7K 18.2K
View

Modern React state management with Redux Toolkit, Zustand, Jotai, and React Query for every state category.

40.2K 14.7K
View

GDPR-compliant data handling with consent management, data subject rights, and privacy controls.

40.2K 14.3K
View

Python error handling patterns including input validation, exception hierarchies, and partial failure handling. Use when implementing validation logic, designing exception strategies, handling batch processing failures, or building robust APIs.

40.2K 13.5K
View

Detailed multi-file refactor planning with safety checks and rollback guidance.

39.7K 13K
View