<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>KittenGen | 帮助</title>
    <link href="/static/css/bootstrap.min.css" rel="stylesheet">
    <script src="/static/js/jquery.min.js"></script>
    <script src="/static/js/bootstrap.min.js"></script>
</head>
<body class="bg-light">
<div class="container py-5">
    <div class="card shadow">
        <div class="card-body">
            <h2 class="mb-4">数据生成器使用说明</h2>

            <h4 class="mb-3 text-primary">基本规范</h4>
            <ul class="list-group mb-4">
                <li class="list-group-item">
                    <strong>代码中可以使用全局变量 <code>num: int</code></strong> -
                    表示当前测试点编号（从1开始）
                </li>
                <li class="list-group-item">
                    <strong>random 库已自动预导入</strong> -
                    可直接使用 randint/choice 等函数
                </li>
                <li class="list-group-item">
                    <strong>使用 print 函数直接输出</strong> -
                    内容会自动写入输入文件，无需文件操作
                </li>
            </ul>

            <h4 class="mb-3 text-primary">示例代码</h4>
            <strong>一个单点修改，区间查询的数据结构题</strong>
            <pre class="bg-dark text-light p-4 rounded mb-4">
                <code class="language-python">
N = [0, 100, 2000, 100000, 100000, 200000, 200000, 300000, 400000, 500000, 500000]
Q = [0, 100, 2000, 100000, 100000, 200000, 200000, 300000, 400000, 500000, 500000]
E9 = 10 ** 9

n, q = N[num], Q[num]
print(n, q)
for i in range(n):
    print(randint(-E9, E9), end=' ')
print()
for i in range(q):
    opt = choice([1, 2])
    l = randint(1, n)
    if opt == 1:
        print(opt, l, randint(-E9, E9))
    else:
        r = randint(1, n)
        if l > r:
            l, r = r, l
        print(opt, l, r)
                </code>
            </pre>

            <div class="text-center">
                <a href="/" class="btn btn-primary btn-lg px-5">返回</a>
            </div>
        </div>
    </div>
</div>
</body>
</html>