<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/" version="2.0"><channel><title>PYM博客</title><link>https://pym.plus</link><atom:link href="https://pym.plus/rss.xml" rel="self" type="application/rss+xml"/><description>欢迎！Welcome!</description><generator>Halo v2.24.2</generator><language>zh-cn</language><image><url>https://pan.pym.plus/f/kOtY/PYMbk.png</url><title>PYM博客</title><link>https://pym.plus</link></image><lastBuildDate>Sat, 9 May 2026 16:00:55 GMT</lastBuildDate><item><title><![CDATA[用工具轻松的给Frpc配置SSL证书，穿透Http与Https流量，开启强制Https跳转]]></title><link>https://pym.plus/archives/1778245501495</link><description><![CDATA[<img src="https://pym.plus/plugins/feed/assets/telemetry.gif?title=%E7%94%A8%E5%B7%A5%E5%85%B7%E8%BD%BB%E6%9D%BE%E7%9A%84%E7%BB%99Frpc%E9%85%8D%E7%BD%AESSL%E8%AF%81%E4%B9%A6%EF%BC%8C%E7%A9%BF%E9%80%8FHttp%E4%B8%8EHttps%E6%B5%81%E9%87%8F%EF%BC%8C%E5%BC%80%E5%90%AF%E5%BC%BA%E5%88%B6Https%E8%B7%B3%E8%BD%AC&amp;url=/archives/1778245501495" width="1" height="1" alt="" style="opacity:0;">
<h1 style="" id="%E4%B8%80%E3%80%81%E5%B7%A5%E5%85%B7%E4%BB%8B%E7%BB%8D">一、工具介绍</h1>
<p style="">博主这里已经把这个做成了一个在线工具，进入输入你的配置就可以直接简单界面化的配置给Frpc配置SSL证书（Chmlfrp基于标准的Frp客户端，理论上可以通用），其中证书的文件路径为你的证书文件在本地存放的路径。</p>
<hyperlink-card target="_blank" href="https://pym.plus/upload/chmlfrp_ssl.html" theme="small" style="margin-top: 0.75em; margin-bottom: 0;" custom-title="Frp SSL配置生成器" custom-description="Frp客户端通用，界面化简单配置"><a href="https://pym.plus/upload/chmlfrp_ssl.html" target="_blank">https://pym.plus/upload/chmlfrp_ssl.html</a></hyperlink-card>
<h1 style="" id="%E4%BA%8C%E3%80%81%E4%BD%BF%E7%94%A8%E6%96%B9%E6%B3%95">二、使用方法</h1>
<h2 style="" id="1.%E8%BE%93%E5%85%A5%E9%85%8D%E7%BD%AE">1.输入配置</h2>
<p style="">这里的配置以示例配置来演示，输入配置，点击解析配置按钮。</p>
<p style="">可以把每条隧道单独拆开放入列表中，单价可以查看详细信息，你可以选择勾选哪些来进行配置。
 <br></p>
<figure style="align-items: start; display: flex; flex-direction: column" data-content-type="image">
 <img src="https://pym.plus/apis/api.storage.halo.run/v1alpha1/thumbnails/-/via-uri?uri=%2Fupload%2Fimage-cOOS.png&amp;size=m" width="791px">
</figure>
<h2 style="" id="2.-%E9%85%8D%E7%BD%AE%E8%AF%81%E4%B9%A6">2. 配置证书</h2>
<p style="">你可以选择通配符证书或者单独的证书</p>
<p style="">这里的证书位置输入你本地的证书存放的绝对路径（完整路径），如果是windows就要带上哪个盘，linux就不用。</p>
<p style="">然后在列表里面看看你需要给哪些网站开启强制Https跳转</p>
<div data-type="gallery" data-group-size="2" data-layout="auto" data-gap="8">
 <div style="display: grid; gap: 8px;">
  <div data-type="gallery-group" style="display: flex; flex-direction: row; justify-content: center; gap: 8px;">
   <div style="flex: 0.9912060301507538 1 0%;" data-aspect-ratio="0.9912060301507538">
    <img src="https://pym.plus/apis/api.storage.halo.run/v1alpha1/thumbnails/-/via-uri?uri=https%3A%2F%2Fpym.plus%2Fupload%2Fimage-bsKJ.png&amp;size=m" data-type="gallery-image" style="width: 100%; height: 100%; margin: 0; object-fit: cover;">
   </div>
   <div style="flex: 1.0049627791563276 1 0%;" data-aspect-ratio="1.0049627791563276">
    <img src="https://pym.plus/apis/api.storage.halo.run/v1alpha1/thumbnails/-/via-uri?uri=https%3A%2F%2Fpym.plus%2Fupload%2Fimage-SOug.png&amp;size=m" data-type="gallery-image" style="width: 100%; height: 100%; margin: 0; object-fit: cover;">
   </div>
  </div>
 </div>
</div>
<h2 style="" id="3.-%E7%94%9F%E6%88%90%E9%85%8D%E7%BD%AE">3. 生成配置</h2>
<p style="">所有完成后点一下步就自动生成出来了，复制粘贴到 <code>frpc.ini</code> 就可以直接使用，快去试试吧！</p>
<figure style="align-items: start; display: flex; flex-direction: column" data-content-type="image">
 <img src="https://pym.plus/apis/api.storage.halo.run/v1alpha1/thumbnails/-/via-uri?uri=%2Fupload%2Fimage-onRN.png&amp;size=m">
</figure>
<p style=""></p>]]></description><guid isPermaLink="false">/archives/1778245501495</guid><dc:creator>PYM</dc:creator><enclosure url="https://pym.plus/apis/api.storage.halo.run/v1alpha1/thumbnails/-/via-uri?uri=%2Fupload%2F%25E6%2589%25B9%25E6%25B3%25A8%25202026-05-08%2520211144.png&amp;size=m" type="image/jpeg" length="36864"/><category>内网穿透</category><category>服务器</category><pubDate>Fri, 8 May 2026 13:20:38 GMT</pubDate></item><item><title><![CDATA[「POJ1740」A New Stone Game SG函数与博弈论题解]]></title><link>https://pym.plus/archives/1777859225483</link><description><![CDATA[<img src="https://pym.plus/plugins/feed/assets/telemetry.gif?title=%E3%80%8CPOJ1740%E3%80%8DA%20New%20Stone%20Game%20SG%E5%87%BD%E6%95%B0%E4%B8%8E%E5%8D%9A%E5%BC%88%E8%AE%BA%E9%A2%98%E8%A7%A3&amp;url=/archives/1777859225483" width="1" height="1" alt="" style="opacity:0;">
<h1 style="" id="%E9%A2%98%E7%9B%AE%E5%A4%A7%E6%84%8F">题目大意</h1>
<p style="">有若干堆石子，每一次需要从一堆石子中拿走一些，然后如果愿意的话，再从这堆石子中拿一些分给其它任意堆。不能操作的人就输了。</p>
<p style="">同时，石子只能移到非空堆，一旦某堆变为 0，它就无法继续操作了。</p>
<h1 style="" id="%E9%A2%98%E7%9B%AE%E5%88%86%E6%9E%90">题目分析</h1>
<h2 style="" id="%E4%B8%80%E3%80%81%E6%B8%B8%E6%88%8F%E8%A7%84%E5%88%99">一、游戏规则</h2>
<p style="">每次操作分两步：</p>
<ol>
 <li>
  <p style="line-height: 1.7"><strong>移除</strong>：从某堆中拿走至少 1 个石子</p>
 </li>
 <li>
  <p style="line-height: 1.7"><strong>分配</strong>（可选）：将该堆<strong>剩余的</strong>石子任意分配到其他<strong>仍有石子</strong>的堆中</p>
 </li>
</ol>
<p style="line-height: 1.7">关键约束：石子<strong>只能移到非空堆</strong>，一旦某堆变为 0，它就没法操作了</p>
<h2 style="" id="%E4%BA%8C%E3%80%81%E4%BB%8E%E5%B0%8F%E8%A7%84%E6%A8%A1%E5%BC%80%E5%A7%8B%E5%88%86%E6%9E%90">二、<strong>从小规模开始分析</strong></h2>
<h4 style="" id="n-%3D-1%EF%BC%88%E5%8D%95%E5%A0%86%EF%BC%89"><strong>n = 1（单堆）</strong></h4>
<p style="line-height: 1.7">无法分配（没有别的非空堆），退化为了普通取石子游戏。操作者可取走 1~全部。</p>
<p style="line-height: 1.7">SG 值就是石子数：<strong>SG(x) = x</strong>。当 x &gt; 0 时 SG ≠ 0，先手必胜。</p>
<h4 style="" id="n-%3D-2%EF%BC%88%E4%B8%A4%E5%A0%86%EF%BC%89"><strong>n = 2（两堆）</strong></h4>
<p style="line-height: 1.7">从这个分析里面我们可以推导出解题的关键：</p>
<p style="line-height: 1.7">如果<strong>两堆相等 (a, a)</strong>：后手采用<strong>对称策略</strong>——无论先手对哪堆做什么（移除 r 个、移 m 个到另一堆），后手在另一堆执行完全相同操作。只要两堆相等，后手总能维持相等，直到把先手逼入 (1,1)，最终先手必败。因此 <strong>SG(a, a) = 0，是</strong>必败态。</p>
<p style="line-height: 1.7">如果<strong>两堆不等 (a, b)，a &lt; b</strong>：先手只需从较大堆移除 (b−a) 个，不分配，状态变为 (a, a)——把 必败态 丢给后手。因此 <strong>SG(a, b) ≠ 0，是 必胜态。</strong></p>
<h2 style="" id="%E4%B8%89%E3%80%81sg-%E5%87%BD%E6%95%B0%E8%A1%A8%E6%A0%BC%EF%BC%88n-%3D-2%EF%BC%89">三、SG 函数表格（n = 2）</h2>
<p style="line-height: 1.7">我们来手动推导小值的 SG 值，设 a ≤ b（?是懒得算了）：</p>
<div style="overflow-x: auto; overflow-y: hidden;">
 <table style="width: 700px">
  <colgroup>
   <col style="width: 100px">
   <col style="width: 100px">
   <col style="width: 100px">
   <col style="width: 100px">
   <col style="width: 100px">
   <col style="width: 100px">
   <col style="width: 100px">
  </colgroup>
  <tbody>
   <tr style="background-repeat: no-repeat; box-sizing: inherit; padding: 0px; margin: 0px; scrollbar-width: thin; scrollbar-color: rgba(60, 150, 202, 0.72) rgba(60, 150, 202, 0.08); border-block-end: thin solid rgba(30, 136, 229, 0.12) !important; border-bottom-width: 1px;">
    <th colspan="1" rowspan="1" colwidth="100" style="background-repeat: no-repeat; box-sizing: inherit; padding: calc(0.571429em); margin: 0px; scrollbar-width: thin; scrollbar-color: rgba(60, 150, 202, 0.72) rgba(60, 150, 202, 0.08); text-align: left; font-weight: 600; white-space: normal; overflow-wrap: break-word; word-break: normal;">
     <p style=""><strong>a \ b</strong></p>
    </th>
    <th colspan="1" rowspan="1" colwidth="100" style="background-repeat: no-repeat; box-sizing: inherit; padding: calc(0.571429em); margin: 0px; scrollbar-width: thin; scrollbar-color: rgba(60, 150, 202, 0.72) rgba(60, 150, 202, 0.08); text-align: left; font-weight: 600; white-space: normal; overflow-wrap: break-word; word-break: normal;">
     <p style=""><strong>0</strong></p>
    </th>
    <th colspan="1" rowspan="1" colwidth="100" style="background-repeat: no-repeat; box-sizing: inherit; padding: calc(0.571429em); margin: 0px; scrollbar-width: thin; scrollbar-color: rgba(60, 150, 202, 0.72) rgba(60, 150, 202, 0.08); text-align: left; font-weight: 600; white-space: normal; overflow-wrap: break-word; word-break: normal;">
     <p style=""><strong>1</strong></p>
    </th>
    <th colspan="1" rowspan="1" colwidth="100" style="background-repeat: no-repeat; box-sizing: inherit; padding: calc(0.571429em); margin: 0px; scrollbar-width: thin; scrollbar-color: rgba(60, 150, 202, 0.72) rgba(60, 150, 202, 0.08); text-align: left; font-weight: 600; white-space: normal; overflow-wrap: break-word; word-break: normal;">
     <p style=""><strong>2</strong></p>
    </th>
    <th colspan="1" rowspan="1" colwidth="100" style="background-repeat: no-repeat; box-sizing: inherit; padding: calc(0.571429em); margin: 0px; scrollbar-width: thin; scrollbar-color: rgba(60, 150, 202, 0.72) rgba(60, 150, 202, 0.08); text-align: left; font-weight: 600; white-space: normal; overflow-wrap: break-word; word-break: normal;">
     <p style=""><strong>3</strong></p>
    </th>
    <th colspan="1" rowspan="1" colwidth="100" style="background-repeat: no-repeat; box-sizing: inherit; padding: calc(0.571429em); margin: 0px; scrollbar-width: thin; scrollbar-color: rgba(60, 150, 202, 0.72) rgba(60, 150, 202, 0.08); text-align: left; font-weight: 600; white-space: normal; overflow-wrap: break-word; word-break: normal;">
     <p style=""><strong>4</strong></p>
    </th>
    <th colspan="1" rowspan="1" colwidth="100" style="background-repeat: no-repeat; box-sizing: inherit; padding: calc(0.571429em); margin: 0px; scrollbar-width: thin; scrollbar-color: rgba(60, 150, 202, 0.72) rgba(60, 150, 202, 0.08); text-align: left; font-weight: 600; white-space: normal; overflow-wrap: break-word; word-break: normal;">
     <p style=""><strong>5</strong></p>
    </th>
   </tr>
   <tr style="background-repeat: no-repeat; box-sizing: inherit; padding: 0px; margin: 0px; scrollbar-width: thin; scrollbar-color: rgba(60, 150, 202, 0.72) rgba(60, 150, 202, 0.08); border-block-end: thin solid rgba(30, 136, 229, 0.12) !important; border-bottom-width: 1px; border-color: rgb(203, 213, 225);">
    <td colspan="1" rowspan="1" colwidth="100" style="background-repeat: no-repeat; box-sizing: inherit; padding: calc(0.571429em); margin: 0px; scrollbar-width: thin; scrollbar-color: rgba(60, 150, 202, 0.72) rgba(60, 150, 202, 0.08); text-align: left; white-space: normal; overflow-wrap: break-word; word-break: normal;">
     <p style=""><strong>0</strong></p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="background-repeat: no-repeat; box-sizing: inherit; padding: calc(0.571429em); margin: 0px; scrollbar-width: thin; scrollbar-color: rgba(60, 150, 202, 0.72) rgba(60, 150, 202, 0.08); text-align: left; white-space: normal; overflow-wrap: break-word; word-break: normal;">
     <p style="">0</p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="background-repeat: no-repeat; box-sizing: inherit; padding: calc(0.571429em); margin: 0px; scrollbar-width: thin; scrollbar-color: rgba(60, 150, 202, 0.72) rgba(60, 150, 202, 0.08); text-align: left; white-space: normal; overflow-wrap: break-word; word-break: normal;">
     <p style="">1</p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="background-repeat: no-repeat; box-sizing: inherit; padding: calc(0.571429em); margin: 0px; scrollbar-width: thin; scrollbar-color: rgba(60, 150, 202, 0.72) rgba(60, 150, 202, 0.08); text-align: left; white-space: normal; overflow-wrap: break-word; word-break: normal;">
     <p style="">2</p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="background-repeat: no-repeat; box-sizing: inherit; padding: calc(0.571429em); margin: 0px; scrollbar-width: thin; scrollbar-color: rgba(60, 150, 202, 0.72) rgba(60, 150, 202, 0.08); text-align: left; white-space: normal; overflow-wrap: break-word; word-break: normal;">
     <p style="">3</p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="background-repeat: no-repeat; box-sizing: inherit; padding: calc(0.571429em); margin: 0px; scrollbar-width: thin; scrollbar-color: rgba(60, 150, 202, 0.72) rgba(60, 150, 202, 0.08); text-align: left; white-space: normal; overflow-wrap: break-word; word-break: normal;">
     <p style="">4</p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="background-repeat: no-repeat; box-sizing: inherit; padding: calc(0.571429em); margin: 0px; scrollbar-width: thin; scrollbar-color: rgba(60, 150, 202, 0.72) rgba(60, 150, 202, 0.08); text-align: left; white-space: normal; overflow-wrap: break-word; word-break: normal;">
     <p style="">5</p>
    </td>
   </tr>
   <tr style="background-repeat: no-repeat; box-sizing: inherit; padding: 0px; margin: 0px; scrollbar-width: thin; scrollbar-color: rgba(60, 150, 202, 0.72) rgba(60, 150, 202, 0.08); border-block-end: thin solid rgba(30, 136, 229, 0.12) !important; border-bottom-width: 1px; border-color: rgb(203, 213, 225);">
    <td colspan="1" rowspan="1" colwidth="100" style="background-repeat: no-repeat; box-sizing: inherit; padding: calc(0.571429em); margin: 0px; scrollbar-width: thin; scrollbar-color: rgba(60, 150, 202, 0.72) rgba(60, 150, 202, 0.08); text-align: left; white-space: normal; overflow-wrap: break-word; word-break: normal;">
     <p style=""><strong>1</strong></p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="background-repeat: no-repeat; box-sizing: inherit; padding: calc(0.571429em); margin: 0px; scrollbar-width: thin; scrollbar-color: rgba(60, 150, 202, 0.72) rgba(60, 150, 202, 0.08); text-align: left; white-space: normal; overflow-wrap: break-word; word-break: normal;">
     <p style="">–</p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="background-repeat: no-repeat; box-sizing: inherit; padding: calc(0.571429em); margin: 0px; scrollbar-width: thin; scrollbar-color: rgba(60, 150, 202, 0.72) rgba(60, 150, 202, 0.08); text-align: left; white-space: normal; overflow-wrap: break-word; word-break: normal;">
     <p style=""><strong>0</strong></p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="background-repeat: no-repeat; box-sizing: inherit; padding: calc(0.571429em); margin: 0px; scrollbar-width: thin; scrollbar-color: rgba(60, 150, 202, 0.72) rgba(60, 150, 202, 0.08); text-align: left; white-space: normal; overflow-wrap: break-word; word-break: normal;">
     <p style="">3</p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="background-repeat: no-repeat; box-sizing: inherit; padding: calc(0.571429em); margin: 0px; scrollbar-width: thin; scrollbar-color: rgba(60, 150, 202, 0.72) rgba(60, 150, 202, 0.08); text-align: left; white-space: normal; overflow-wrap: break-word; word-break: normal;">
     <p style="">4</p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="background-repeat: no-repeat; box-sizing: inherit; padding: calc(0.571429em); margin: 0px; scrollbar-width: thin; scrollbar-color: rgba(60, 150, 202, 0.72) rgba(60, 150, 202, 0.08); text-align: left; white-space: normal; overflow-wrap: break-word; word-break: normal;">
     <p style="">5</p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="background-repeat: no-repeat; box-sizing: inherit; padding: calc(0.571429em); margin: 0px; scrollbar-width: thin; scrollbar-color: rgba(60, 150, 202, 0.72) rgba(60, 150, 202, 0.08); text-align: left; white-space: normal; overflow-wrap: break-word; word-break: normal;">
     <p style="">6</p>
    </td>
   </tr>
   <tr style="background-repeat: no-repeat; box-sizing: inherit; padding: 0px; margin: 0px; scrollbar-width: thin; scrollbar-color: rgba(60, 150, 202, 0.72) rgba(60, 150, 202, 0.08); border-block-end: thin solid rgba(30, 136, 229, 0.12) !important; border-bottom-width: 1px; border-color: rgb(203, 213, 225);">
    <td colspan="1" rowspan="1" colwidth="100" style="background-repeat: no-repeat; box-sizing: inherit; padding: calc(0.571429em); margin: 0px; scrollbar-width: thin; scrollbar-color: rgba(60, 150, 202, 0.72) rgba(60, 150, 202, 0.08); text-align: left; white-space: normal; overflow-wrap: break-word; word-break: normal;">
     <p style=""><strong>2</strong></p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="background-repeat: no-repeat; box-sizing: inherit; padding: calc(0.571429em); margin: 0px; scrollbar-width: thin; scrollbar-color: rgba(60, 150, 202, 0.72) rgba(60, 150, 202, 0.08); text-align: left; white-space: normal; overflow-wrap: break-word; word-break: normal;">
     <p style="">–</p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="background-repeat: no-repeat; box-sizing: inherit; padding: calc(0.571429em); margin: 0px; scrollbar-width: thin; scrollbar-color: rgba(60, 150, 202, 0.72) rgba(60, 150, 202, 0.08); text-align: left; white-space: normal; overflow-wrap: break-word; word-break: normal;">
     <p style="">–</p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="background-repeat: no-repeat; box-sizing: inherit; padding: calc(0.571429em); margin: 0px; scrollbar-width: thin; scrollbar-color: rgba(60, 150, 202, 0.72) rgba(60, 150, 202, 0.08); text-align: left; white-space: normal; overflow-wrap: break-word; word-break: normal;">
     <p style=""><strong>0</strong></p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="background-repeat: no-repeat; box-sizing: inherit; padding: calc(0.571429em); margin: 0px; scrollbar-width: thin; scrollbar-color: rgba(60, 150, 202, 0.72) rgba(60, 150, 202, 0.08); text-align: left; white-space: normal; overflow-wrap: break-word; word-break: normal;">
     <p style="">1</p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="background-repeat: no-repeat; box-sizing: inherit; padding: calc(0.571429em); margin: 0px; scrollbar-width: thin; scrollbar-color: rgba(60, 150, 202, 0.72) rgba(60, 150, 202, 0.08); text-align: left; white-space: normal; overflow-wrap: break-word; word-break: normal;">
     <p style="">?</p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="background-repeat: no-repeat; box-sizing: inherit; padding: calc(0.571429em); margin: 0px; scrollbar-width: thin; scrollbar-color: rgba(60, 150, 202, 0.72) rgba(60, 150, 202, 0.08); text-align: left; white-space: normal; overflow-wrap: break-word; word-break: normal;">
     <p style="">?</p>
    </td>
   </tr>
   <tr style="background-repeat: no-repeat; box-sizing: inherit; padding: 0px; margin: 0px; scrollbar-width: thin; scrollbar-color: rgba(60, 150, 202, 0.72) rgba(60, 150, 202, 0.08); border-block-end: thin solid rgba(30, 136, 229, 0.12) !important; border-bottom-width: 1px; border-color: rgb(203, 213, 225);">
    <td colspan="1" rowspan="1" colwidth="100" style="background-repeat: no-repeat; box-sizing: inherit; padding: calc(0.571429em); margin: 0px; scrollbar-width: thin; scrollbar-color: rgba(60, 150, 202, 0.72) rgba(60, 150, 202, 0.08); text-align: left; white-space: normal; overflow-wrap: break-word; word-break: normal;">
     <p style=""><strong>3</strong></p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="background-repeat: no-repeat; box-sizing: inherit; padding: calc(0.571429em); margin: 0px; scrollbar-width: thin; scrollbar-color: rgba(60, 150, 202, 0.72) rgba(60, 150, 202, 0.08); text-align: left; white-space: normal; overflow-wrap: break-word; word-break: normal;">
     <p style="">–</p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="background-repeat: no-repeat; box-sizing: inherit; padding: calc(0.571429em); margin: 0px; scrollbar-width: thin; scrollbar-color: rgba(60, 150, 202, 0.72) rgba(60, 150, 202, 0.08); text-align: left; white-space: normal; overflow-wrap: break-word; word-break: normal;">
     <p style="">–</p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="background-repeat: no-repeat; box-sizing: inherit; padding: calc(0.571429em); margin: 0px; scrollbar-width: thin; scrollbar-color: rgba(60, 150, 202, 0.72) rgba(60, 150, 202, 0.08); text-align: left; white-space: normal; overflow-wrap: break-word; word-break: normal;">
     <p style="">–</p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="background-repeat: no-repeat; box-sizing: inherit; padding: calc(0.571429em); margin: 0px; scrollbar-width: thin; scrollbar-color: rgba(60, 150, 202, 0.72) rgba(60, 150, 202, 0.08); text-align: left; white-space: normal; overflow-wrap: break-word; word-break: normal;">
     <p style=""><strong>0</strong></p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="background-repeat: no-repeat; box-sizing: inherit; padding: calc(0.571429em); margin: 0px; scrollbar-width: thin; scrollbar-color: rgba(60, 150, 202, 0.72) rgba(60, 150, 202, 0.08); text-align: left; white-space: normal; overflow-wrap: break-word; word-break: normal;">
     <p style="">?</p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="background-repeat: no-repeat; box-sizing: inherit; padding: calc(0.571429em); margin: 0px; scrollbar-width: thin; scrollbar-color: rgba(60, 150, 202, 0.72) rgba(60, 150, 202, 0.08); text-align: left; white-space: normal; overflow-wrap: break-word; word-break: normal;">
     <p style="">?</p>
    </td>
   </tr>
   <tr style="background-repeat: no-repeat; box-sizing: inherit; padding: 0px; margin: 0px; scrollbar-width: thin; scrollbar-color: rgba(60, 150, 202, 0.72) rgba(60, 150, 202, 0.08); border-block-end: thin solid rgba(30, 136, 229, 0.12) !important; border-bottom-width: 1px; border-color: rgb(203, 213, 225);">
    <td colspan="1" rowspan="1" colwidth="100" style="background-repeat: no-repeat; box-sizing: inherit; padding: calc(0.571429em); margin: 0px; scrollbar-width: thin; scrollbar-color: rgba(60, 150, 202, 0.72) rgba(60, 150, 202, 0.08); text-align: left; white-space: normal; overflow-wrap: break-word; word-break: normal;">
     <p style=""><strong>4</strong></p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="background-repeat: no-repeat; box-sizing: inherit; padding: calc(0.571429em); margin: 0px; scrollbar-width: thin; scrollbar-color: rgba(60, 150, 202, 0.72) rgba(60, 150, 202, 0.08); text-align: left; white-space: normal; overflow-wrap: break-word; word-break: normal;">
     <p style="">–</p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="background-repeat: no-repeat; box-sizing: inherit; padding: calc(0.571429em); margin: 0px; scrollbar-width: thin; scrollbar-color: rgba(60, 150, 202, 0.72) rgba(60, 150, 202, 0.08); text-align: left; white-space: normal; overflow-wrap: break-word; word-break: normal;">
     <p style="">–</p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="background-repeat: no-repeat; box-sizing: inherit; padding: calc(0.571429em); margin: 0px; scrollbar-width: thin; scrollbar-color: rgba(60, 150, 202, 0.72) rgba(60, 150, 202, 0.08); text-align: left; white-space: normal; overflow-wrap: break-word; word-break: normal;">
     <p style="">–</p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="background-repeat: no-repeat; box-sizing: inherit; padding: calc(0.571429em); margin: 0px; scrollbar-width: thin; scrollbar-color: rgba(60, 150, 202, 0.72) rgba(60, 150, 202, 0.08); text-align: left; white-space: normal; overflow-wrap: break-word; word-break: normal;">
     <p style="">–</p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="background-repeat: no-repeat; box-sizing: inherit; padding: calc(0.571429em); margin: 0px; scrollbar-width: thin; scrollbar-color: rgba(60, 150, 202, 0.72) rgba(60, 150, 202, 0.08); text-align: left; white-space: normal; overflow-wrap: break-word; word-break: normal;">
     <p style=""><strong>0</strong></p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="background-repeat: no-repeat; box-sizing: inherit; padding: calc(0.571429em); margin: 0px; scrollbar-width: thin; scrollbar-color: rgba(60, 150, 202, 0.72) rgba(60, 150, 202, 0.08); text-align: left; white-space: normal; overflow-wrap: break-word; word-break: normal;">
     <p style="">?</p>
    </td>
   </tr>
   <tr style="background-repeat: no-repeat; box-sizing: inherit; padding: 0px; margin: 0px; scrollbar-width: thin; scrollbar-color: rgba(60, 150, 202, 0.72) rgba(60, 150, 202, 0.08); border-color: rgb(203, 213, 225);">
    <td colspan="1" rowspan="1" colwidth="100" style="background-repeat: no-repeat; box-sizing: inherit; padding: calc(0.571429em); margin: 0px; scrollbar-width: thin; scrollbar-color: rgba(60, 150, 202, 0.72) rgba(60, 150, 202, 0.08); text-align: left; white-space: normal; overflow-wrap: break-word; word-break: normal;">
     <p style=""><strong>5</strong></p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="background-repeat: no-repeat; box-sizing: inherit; padding: calc(0.571429em); margin: 0px; scrollbar-width: thin; scrollbar-color: rgba(60, 150, 202, 0.72) rgba(60, 150, 202, 0.08); text-align: left; white-space: normal; overflow-wrap: break-word; word-break: normal;">
     <p style="">–</p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="background-repeat: no-repeat; box-sizing: inherit; padding: calc(0.571429em); margin: 0px; scrollbar-width: thin; scrollbar-color: rgba(60, 150, 202, 0.72) rgba(60, 150, 202, 0.08); text-align: left; white-space: normal; overflow-wrap: break-word; word-break: normal;">
     <p style="">–</p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="background-repeat: no-repeat; box-sizing: inherit; padding: calc(0.571429em); margin: 0px; scrollbar-width: thin; scrollbar-color: rgba(60, 150, 202, 0.72) rgba(60, 150, 202, 0.08); text-align: left; white-space: normal; overflow-wrap: break-word; word-break: normal;">
     <p style="">–</p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="background-repeat: no-repeat; box-sizing: inherit; padding: calc(0.571429em); margin: 0px; scrollbar-width: thin; scrollbar-color: rgba(60, 150, 202, 0.72) rgba(60, 150, 202, 0.08); text-align: left; white-space: normal; overflow-wrap: break-word; word-break: normal;">
     <p style="">–</p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="background-repeat: no-repeat; box-sizing: inherit; padding: calc(0.571429em); margin: 0px; scrollbar-width: thin; scrollbar-color: rgba(60, 150, 202, 0.72) rgba(60, 150, 202, 0.08); text-align: left; white-space: normal; overflow-wrap: break-word; word-break: normal;">
     <p style="">–</p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="background-repeat: no-repeat; box-sizing: inherit; padding: calc(0.571429em); margin: 0px; scrollbar-width: thin; scrollbar-color: rgba(60, 150, 202, 0.72) rgba(60, 150, 202, 0.08); text-align: left; white-space: normal; overflow-wrap: break-word; word-break: normal;">
     <p style=""><strong>0</strong></p>
    </td>
   </tr>
  </tbody>
 </table>
</div>
<blockquote>
 <p style="line-height: 1.7"><strong><em>示例：SG(1,2) 的可达 SG 集合 = {SG(0,2)=2, SG(1,1)=0, SG(2,0)=2, SG(1,0)=1} = {0,1,2} → mex = 3
    <br>SG(2,3) 的可达 SG 集合 = {SG(1,3)=4, SG(0,4)=4, SG(0,3)=3, SG(2,2)=0, SG(3,1)=4, SG(4,0)=4, SG(2,1)=3, SG(3,0)=3, SG(2,0)=2} = {0,2,3,4} → mex = 1</em></strong></p>
</blockquote>
<p style="line-height: 1.7"><strong>由此我们可以发现一个规律</strong>：对角线全为 0（比败态），其余非零（必胜态）。</p>
<h2 style="" id="%E5%9B%9B%E3%80%81%E6%8E%A8%E5%B9%BF%E5%88%B0%E4%BB%BB%E6%84%8F-n">四、推广到任意 n</h2>
<p style=""><strong>定理（必败态的条件）</strong>：</p>
<blockquote>
 <p style="line-height: 1.7"><strong><em>先手必败 ⇔ n 为偶数，且将所有石子堆排序后，可以两两配对相等
    <br>（即 a₁ = a₂, a₃ = a₄, …, aₙ₋₁ = aₙ）</em></strong></p>
</blockquote>
<p style="line-height: 1.7"><strong>证明概要</strong>：</p>
<div style="overflow-x: auto; overflow-y: hidden;">
 <table style="width: 861px">
  <colgroup>
   <col style="width: 100px">
   <col style="width: 761px">
  </colgroup>
  <tbody>
   <tr style="background-repeat: no-repeat; box-sizing: inherit; padding: 0px; margin: 0px; scrollbar-width: thin; scrollbar-color: rgba(60, 150, 202, 0.72) rgba(60, 150, 202, 0.08); border-block-end: thin solid rgba(30, 136, 229, 0.12) !important; border-bottom-width: 1px;">
    <th colspan="1" rowspan="1" colwidth="100" style="background-repeat: no-repeat; box-sizing: inherit; padding: calc(0.571429em); margin: 0px; scrollbar-width: thin; scrollbar-color: rgba(60, 150, 202, 0.72) rgba(60, 150, 202, 0.08); text-align: left; font-weight: 600; white-space: normal; overflow-wrap: break-word; word-break: normal;">
     <p style=""><strong>局面类型</strong></p>
    </th>
    <th colspan="1" rowspan="1" colwidth="761" style="background-repeat: no-repeat; box-sizing: inherit; padding: calc(0.571429em); margin: 0px; scrollbar-width: thin; scrollbar-color: rgba(60, 150, 202, 0.72) rgba(60, 150, 202, 0.08); text-align: left; font-weight: 600; white-space: normal; overflow-wrap: break-word; word-break: normal;">
     <p style=""><strong>策略</strong></p>
    </th>
   </tr>
   <tr style="background-repeat: no-repeat; box-sizing: inherit; padding: 0px; margin: 0px; scrollbar-width: thin; scrollbar-color: rgba(60, 150, 202, 0.72) rgba(60, 150, 202, 0.08); border-block-end: thin solid rgba(30, 136, 229, 0.12) !important; border-bottom-width: 1px; border-color: rgb(203, 213, 225);">
    <td colspan="1" rowspan="1" colwidth="100" style="background-repeat: no-repeat; box-sizing: inherit; padding: calc(0.571429em); margin: 0px; scrollbar-width: thin; scrollbar-color: rgba(60, 150, 202, 0.72) rgba(60, 150, 202, 0.08); text-align: left; white-space: normal; overflow-wrap: break-word; word-break: normal;">
     <p style=""><strong>奇数堆</strong></p>
    </td>
    <td colspan="1" rowspan="1" colwidth="761" style="background-repeat: no-repeat; box-sizing: inherit; padding: calc(0.571429em); margin: 0px; scrollbar-width: thin; scrollbar-color: rgba(60, 150, 202, 0.72) rgba(60, 150, 202, 0.08); text-align: left; white-space: normal; overflow-wrap: break-word; word-break: normal;">
     <p style="">先手选最多的堆，将其搬空并分配石子，使剩余偶数堆两两配对，丢给后手一个必败态</p>
    </td>
   </tr>
   <tr style="background-repeat: no-repeat; box-sizing: inherit; padding: 0px; margin: 0px; scrollbar-width: thin; scrollbar-color: rgba(60, 150, 202, 0.72) rgba(60, 150, 202, 0.08); border-block-end: thin solid rgba(30, 136, 229, 0.12) !important; border-bottom-width: 1px; border-color: rgb(203, 213, 225);">
    <td colspan="1" rowspan="1" colwidth="100" style="background-repeat: no-repeat; box-sizing: inherit; padding: calc(0.571429em); margin: 0px; scrollbar-width: thin; scrollbar-color: rgba(60, 150, 202, 0.72) rgba(60, 150, 202, 0.08); text-align: left; white-space: normal; overflow-wrap: break-word; word-break: normal;">
     <p style=""><strong>偶数堆但不全配对</strong></p>
    </td>
    <td colspan="1" rowspan="1" colwidth="761" style="background-repeat: no-repeat; box-sizing: inherit; padding: calc(0.571429em); margin: 0px; scrollbar-width: thin; scrollbar-color: rgba(60, 150, 202, 0.72) rgba(60, 150, 202, 0.08); text-align: left; white-space: normal; overflow-wrap: break-word; word-break: normal;">
     <p style="">先手选最多的堆，将其削减到与最少堆相等，用差值去补齐其他未配对堆，同样构造必败态</p>
    </td>
   </tr>
   <tr style="background-repeat: no-repeat; box-sizing: inherit; padding: 0px; margin: 0px; scrollbar-width: thin; scrollbar-color: rgba(60, 150, 202, 0.72) rgba(60, 150, 202, 0.08); border-color: rgb(203, 213, 225);">
    <td colspan="1" rowspan="1" colwidth="100" style="background-repeat: no-repeat; box-sizing: inherit; padding: calc(0.571429em); margin: 0px; scrollbar-width: thin; scrollbar-color: rgba(60, 150, 202, 0.72) rgba(60, 150, 202, 0.08); text-align: left; white-space: normal; overflow-wrap: break-word; word-break: normal;">
     <p style=""><strong>偶数堆全配对</strong></p>
    </td>
    <td colspan="1" rowspan="1" colwidth="761" style="background-repeat: no-repeat; box-sizing: inherit; padding: calc(0.571429em); margin: 0px; scrollbar-width: thin; scrollbar-color: rgba(60, 150, 202, 0.72) rgba(60, 150, 202, 0.08); text-align: left; white-space: normal; overflow-wrap: break-word; word-break: normal;">
     <p style="">先手无论怎么操作都必然破坏配对，后手可恢复配对，最终先手耗尽</p>
    </td>
   </tr>
  </tbody>
 </table>
</div>
<h2 style="" id="%E4%BA%94%E3%80%81sg-%E5%80%BC%E8%A7%84%E5%BE%8B%E6%80%BB%E7%BB%93">五、SG 值规律总结</h2>
<div style="overflow-x: auto; overflow-y: hidden;">
 <table style="width: 439px">
  <colgroup>
   <col style="width: 100px">
   <col style="width: 100px">
   <col style="width: 100px">
   <col style="width: 139px">
  </colgroup>
  <tbody>
   <tr style="background-repeat: no-repeat; box-sizing: inherit; padding: 0px; margin: 0px; scrollbar-width: thin; scrollbar-color: rgba(60, 150, 202, 0.72) rgba(60, 150, 202, 0.08); border-block-end: thin solid rgba(30, 136, 229, 0.12) !important; border-bottom-width: 1px;">
    <th colspan="1" rowspan="1" colwidth="100" style="background-repeat: no-repeat; box-sizing: inherit; padding: calc(0.571429em); margin: 0px; scrollbar-width: thin; scrollbar-color: rgba(60, 150, 202, 0.72) rgba(60, 150, 202, 0.08); text-align: left; font-weight: 600; white-space: normal; overflow-wrap: break-word; word-break: normal;">
     <p style=""><strong>n 的奇偶</strong></p>
    </th>
    <th colspan="1" rowspan="1" colwidth="100" style="background-repeat: no-repeat; box-sizing: inherit; padding: calc(0.571429em); margin: 0px; scrollbar-width: thin; scrollbar-color: rgba(60, 150, 202, 0.72) rgba(60, 150, 202, 0.08); text-align: left; font-weight: 600; white-space: normal; overflow-wrap: break-word; word-break: normal;">
     <p style=""><strong>配对情况</strong></p>
    </th>
    <th colspan="1" rowspan="1" colwidth="100" style="background-repeat: no-repeat; box-sizing: inherit; padding: calc(0.571429em); margin: 0px; scrollbar-width: thin; scrollbar-color: rgba(60, 150, 202, 0.72) rgba(60, 150, 202, 0.08); text-align: left; font-weight: 600; white-space: normal; overflow-wrap: break-word; word-break: normal;">
     <p style=""><strong>SG</strong></p>
    </th>
    <th colspan="1" rowspan="1" colwidth="139" style="background-repeat: no-repeat; box-sizing: inherit; padding: calc(0.571429em); margin: 0px; scrollbar-width: thin; scrollbar-color: rgba(60, 150, 202, 0.72) rgba(60, 150, 202, 0.08); text-align: left; font-weight: 600; white-space: normal; overflow-wrap: break-word; word-break: normal;">
     <p style=""><strong>胜负</strong></p>
    </th>
   </tr>
   <tr style="background-repeat: no-repeat; box-sizing: inherit; padding: 0px; margin: 0px; scrollbar-width: thin; scrollbar-color: rgba(60, 150, 202, 0.72) rgba(60, 150, 202, 0.08); border-block-end: thin solid rgba(30, 136, 229, 0.12) !important; border-bottom-width: 1px; border-color: rgb(203, 213, 225);">
    <td colspan="1" rowspan="1" colwidth="100" style="background-repeat: no-repeat; box-sizing: inherit; padding: calc(0.571429em); margin: 0px; scrollbar-width: thin; scrollbar-color: rgba(60, 150, 202, 0.72) rgba(60, 150, 202, 0.08); text-align: left; white-space: normal; overflow-wrap: break-word; word-break: normal;">
     <p style="">奇数</p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="background-repeat: no-repeat; box-sizing: inherit; padding: calc(0.571429em); margin: 0px; scrollbar-width: thin; scrollbar-color: rgba(60, 150, 202, 0.72) rgba(60, 150, 202, 0.08); text-align: left; white-space: normal; overflow-wrap: break-word; word-break: normal;">
     <p style="">—</p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="background-repeat: no-repeat; box-sizing: inherit; padding: calc(0.571429em); margin: 0px; scrollbar-width: thin; scrollbar-color: rgba(60, 150, 202, 0.72) rgba(60, 150, 202, 0.08); text-align: left; white-space: normal; overflow-wrap: break-word; word-break: normal;">
     <p style="">≠ 0</p>
    </td>
    <td colspan="1" rowspan="1" colwidth="139" style="background-repeat: no-repeat; box-sizing: inherit; padding: calc(0.571429em); margin: 0px; scrollbar-width: thin; scrollbar-color: rgba(60, 150, 202, 0.72) rgba(60, 150, 202, 0.08); text-align: left; white-space: normal; overflow-wrap: break-word; word-break: normal;">
     <p style="">Alice 胜</p>
    </td>
   </tr>
   <tr style="background-repeat: no-repeat; box-sizing: inherit; padding: 0px; margin: 0px; scrollbar-width: thin; scrollbar-color: rgba(60, 150, 202, 0.72) rgba(60, 150, 202, 0.08); border-block-end: thin solid rgba(30, 136, 229, 0.12) !important; border-bottom-width: 1px; border-color: rgb(203, 213, 225);">
    <td colspan="1" rowspan="1" colwidth="100" style="background-repeat: no-repeat; box-sizing: inherit; padding: calc(0.571429em); margin: 0px; scrollbar-width: thin; scrollbar-color: rgba(60, 150, 202, 0.72) rgba(60, 150, 202, 0.08); text-align: left; white-space: normal; overflow-wrap: break-word; word-break: normal;">
     <p style="">偶数</p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="background-repeat: no-repeat; box-sizing: inherit; padding: calc(0.571429em); margin: 0px; scrollbar-width: thin; scrollbar-color: rgba(60, 150, 202, 0.72) rgba(60, 150, 202, 0.08); text-align: left; white-space: normal; overflow-wrap: break-word; word-break: normal;">
     <p style="">不能两两配对</p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="background-repeat: no-repeat; box-sizing: inherit; padding: calc(0.571429em); margin: 0px; scrollbar-width: thin; scrollbar-color: rgba(60, 150, 202, 0.72) rgba(60, 150, 202, 0.08); text-align: left; white-space: normal; overflow-wrap: break-word; word-break: normal;">
     <p style="">≠ 0</p>
    </td>
    <td colspan="1" rowspan="1" colwidth="139" style="background-repeat: no-repeat; box-sizing: inherit; padding: calc(0.571429em); margin: 0px; scrollbar-width: thin; scrollbar-color: rgba(60, 150, 202, 0.72) rgba(60, 150, 202, 0.08); text-align: left; white-space: normal; overflow-wrap: break-word; word-break: normal;">
     <p style="">Alice 胜</p>
    </td>
   </tr>
   <tr style="background-repeat: no-repeat; box-sizing: inherit; padding: 0px; margin: 0px; scrollbar-width: thin; scrollbar-color: rgba(60, 150, 202, 0.72) rgba(60, 150, 202, 0.08); border-color: rgb(203, 213, 225);">
    <td colspan="1" rowspan="1" colwidth="100" style="background-repeat: no-repeat; box-sizing: inherit; padding: calc(0.571429em); margin: 0px; scrollbar-width: thin; scrollbar-color: rgba(60, 150, 202, 0.72) rgba(60, 150, 202, 0.08); text-align: left; white-space: normal; overflow-wrap: break-word; word-break: normal;">
     <p style="">偶数</p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="background-repeat: no-repeat; box-sizing: inherit; padding: calc(0.571429em); margin: 0px; scrollbar-width: thin; scrollbar-color: rgba(60, 150, 202, 0.72) rgba(60, 150, 202, 0.08); text-align: left; white-space: normal; overflow-wrap: break-word; word-break: normal;">
     <p style="">能两两配对</p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="background-repeat: no-repeat; box-sizing: inherit; padding: calc(0.571429em); margin: 0px; scrollbar-width: thin; scrollbar-color: rgba(60, 150, 202, 0.72) rgba(60, 150, 202, 0.08); text-align: left; white-space: normal; overflow-wrap: break-word; word-break: normal;">
     <p style=""><strong>= 0</strong></p>
    </td>
    <td colspan="1" rowspan="1" colwidth="139" style="background-repeat: no-repeat; box-sizing: inherit; padding: calc(0.571429em); margin: 0px; scrollbar-width: thin; scrollbar-color: rgba(60, 150, 202, 0.72) rgba(60, 150, 202, 0.08); text-align: left; white-space: normal; overflow-wrap: break-word; word-break: normal;">
     <p style="">Bob 胜</p>
    </td>
   </tr>
  </tbody>
 </table>
</div>
<h2 style="" id="%E5%85%AD%E3%80%81%E7%AE%97%E6%B3%95%E5%AE%9E%E7%8E%B0%E6%80%9D%E8%B7%AF">六、算法实现思路</h2>
<p style="">然后根据上面的规律我们可以得出这个正解思路：</p>
<pre><code>1. 读入 n
2. 读入 n 个石子数，存入数组 a[]
3. 对 a 排序
4. 如果 n 是奇数 → 输出 1（Alice 胜）
5. 如果 n 是偶数：
     检查是否所有 a[2i-1] == a[2i]（i=1..n/2）
     若全等 → 输出 0（Bob 胜）
     否则   → 输出 1（Alice 胜）
</code></pre>
<h1 style="" id="ac%E4%BB%A3%E7%A0%81">AC代码</h1>
<pre><code class="language-cpp">#include &lt;bits/stdc++.h&gt;
#define ll long long
#define qwq ios::sync_with_stdio(0),cin.tie(0),cout.tie(0)
using namespace std;
const int N = 20;
int n;
int a[N];
int main() {
	qwq;
	while (cin &gt;&gt; n &amp;&amp; n) {
		for (int i = 1; i &lt;= n; ++i) cin &gt;&gt; a[i];
		if (n % 2) cout &lt;&lt; "1\n";
		else {
			int cnt = 0;
			for (int i = 1; i &lt;= n; ++i) {
				if (a[i] == -114514) {
					cnt++;
					continue;
				}
				for (int j = 1; j &lt;= n; ++j) {
					if (i == j || a[j] == -114514) continue;
					if (a[i] == a[j]) {
						cnt++;
						a[i] = a[j]= -114514;
						break;
					}
				}
			}
			if (cnt == n) cout &lt;&lt; "0\n";
			else cout &lt;&lt; "1\n";
		}
	}
	return 0;
}</code></pre>
<p style=""></p>]]></description><guid isPermaLink="false">/archives/1777859225483</guid><dc:creator>PYM</dc:creator><enclosure url="https://pym.plus/apis/api.storage.halo.run/v1alpha1/thumbnails/-/via-uri?uri=%2Fupload%2Fpoj-front.png&amp;size=m" type="image/jpeg" length="49024"/><category>OI</category><category>洛谷</category><category>C++</category><category>题解</category><pubDate>Mon, 4 May 2026 02:02:56 GMT</pubDate></item><item><title><![CDATA[Deepseek V4发布了！综合能力比肩顶级闭源模型！]]></title><link>https://pym.plus/archives/1777034414538-ITIcswtI</link><description><![CDATA[<img src="https://pym.plus/plugins/feed/assets/telemetry.gif?title=Deepseek%20V4%E5%8F%91%E5%B8%83%E4%BA%86%EF%BC%81%E7%BB%BC%E5%90%88%E8%83%BD%E5%8A%9B%E6%AF%94%E8%82%A9%E9%A1%B6%E7%BA%A7%E9%97%AD%E6%BA%90%E6%A8%A1%E5%9E%8B%EF%BC%81&amp;url=/archives/1777034414538-ITIcswtI" width="1" height="1" alt="" style="opacity:0;">
<p style=""><span style="background-color: rgb(255, 255, 255); color: rgb(15, 17, 21); font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, Oxygen, Ubuntu, Cantarell, &quot;Open Sans&quot;, &quot;Helvetica Neue&quot;, sans-serif; font-size: 16px">就在今天，DeepSeek 全新一代模型 V4 系列正式开源，并迅速冲上 Hugging Face 模型榜单首位。伴随模型开放，一份详尽的技术报告也同步公开，完整披露了该系列在硬件适配、架构改造、训练策略等环节的核心要点。无论从能力指标还是工程效率上看，这都是一次相当激进的迭代。</span></p>
<figure style="align-items: center; display: flex; flex-direction: column" data-content-type="image">
 <img src="https://pym.plus/apis/api.storage.halo.run/v1alpha1/thumbnails/-/via-uri?uri=%2Fupload%2Fimage-pVDx.png&amp;size=m" alt="image-pVDx.png" width="960px">
</figure>
<p style=""><span style="background-color: rgb(255, 255, 255); color: rgb(15, 17, 21); font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, Oxygen, Ubuntu, Cantarell, &quot;Open Sans&quot;, &quot;Helvetica Neue&quot;, sans-serif; font-size: 16px">与以往不同的是，V4 的跃升并不只是“更强了”。它首次把百万 token 上下文作为默认能力交付给社区，同时把单 token 推理的计算量降到 V3.2 版本的 27%，KV 缓存仅为原来的十分之一。这意味着，超长文本处理不再只是实验室里的演示，而是开始走向实用、低成本。</span></p>
<figure style="align-items: center; display: flex; flex-direction: column" data-content-type="image">
 <img src="https://pym.plus/apis/api.storage.halo.run/v1alpha1/thumbnails/-/via-uri?uri=%2Fupload%2Fimage-fEzM.png&amp;size=m" alt="image-fEzM.png" width="524px">
</figure>
<p style=""><span style="background-color: rgb(255, 255, 255); color: rgb(15, 17, 21); font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, Oxygen, Ubuntu, Cantarell, &quot;Open Sans&quot;, &quot;Helvetica Neue&quot;, sans-serif; font-size: 16px">硬件层面，DeepSeek 这次做了一个“跨生态”的全面适配——从训练到推理，整套流程已完整运行在华为昇腾 NPU 之上。同时，自研的细粒度专家并行方案 MegaMoE，把通信和计算交织成一条流水线，在英伟达 GPU 和昇腾 NPU 上分别实现了 1.50 到 1.73 倍的加速，延迟敏感场景下甚至可接近翻倍。其 CUDA 实现 MegaMoE2 也已开源，成为 DeepGEMM 工具包的一部分。</span></p>
<p style=""></p>
<p style=""><span style="background-color: rgb(255, 255, 255); color: rgb(15, 17, 21); font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, Oxygen, Ubuntu, Cantarell, &quot;Open Sans&quot;, &quot;Helvetica Neue&quot;, sans-serif; font-size: 16px">为了让碎片化的计算变得紧凑，团队用 TileLang 把大量零散的小算子融合成大型内核，调用开销从百微秒级骤降到 1 微秒以内，并借助 Z3 形式化验证器确保每次计算在任意批次位置下都给出完全一致的结果。这种“比特级可复现”的设计，对大型模型调试来说几乎是一种保命机制。此外，FP4 量化被部署在 MoE 专家权重和压缩稀疏注意力的 QK 路径上，让长上下文下的注意力分数计算进一步提速。</span></p>
<figure style="align-items: start; display: flex; flex-direction: column" data-content-type="image">
 <img src="https://pym.plus/apis/api.storage.halo.run/v1alpha1/thumbnails/-/via-uri?uri=%2Fupload%2Fimage-bcZb.png&amp;size=m" width="1080px">
</figure>
<p style="">架构改动是这次长文本效率突破的关键。V4 仍然沿用 MoE 结构和多 token 预测，但注意力部分彻底重构，将压缩稀疏注意力与另一种高压缩稠密注意力组合成“混合注意力”，在保证信息利用的同时大幅缩减计算和存储开销。同时，残差连接被替换为“流形约束超连接”，以增强表达力，训练端则引入 Muon 优化器，收敛更快且更稳定。推理时，KV 缓存可部分下沉至磁盘，使得极长上下文的部署不会直接撑爆内存。</p>
<p style="">预训练数据的总量超过 32 万亿 token，并首度引入了“样本级注意力掩码”机制。网页数据经过严格过滤，剔除批量生成和模板化的低质内容；数学、编程仍是核心，中期还加入智能体数据；多语言语料扩充了各个文化中的长尾知识，而长文档部分则优先收录论文和技术报告。在这些基础上，V4-Flash 基础模型虽参数更少，却在世界知识和长上下文等任务中超越了 V3.2 基础模型；V4-Pro 基础版则几乎在所有基准上刷新了 DeepSeek 的记录。</p>
<figure style="align-items: start; display: flex; flex-direction: column" data-content-type="image">
 <img src="https://pym.plus/apis/api.storage.halo.run/v1alpha1/thumbnails/-/via-uri?uri=%2Fupload%2Fimage-CRss.png&amp;size=m" width="1080px">
</figure>
<p style="">后训练阶段的路线也出现了重要转变。先前的混合强化学习阶段被完全移除，取而代之的是“基于策略的蒸馏”。具体做法是，先为每个目标领域分别训练一个专家模型，经过监督微调和 GRPO 强化学习后，得到一群各有所长的“专才”。接下来，统一的学生模型开始自己采样并答题，过程中十多位专家老师在完整词表维度上通过逆向 KL 损失进行 logit 级对齐，以此实现专长的融合。这种全词表蒸馏让梯度更稳定，训练曲线也更容易控制。</p>
<p style="">与蒸馏策略相配套的，还有对长窗口场景下推理记录的精细管理。当模型处于工具调用环境中时，所有思考轨迹会跨轮次完整保留，让智能体在长时间任务中能够保持连贯的推理链；而在普通对话下，则仍会清除上一轮的推理内容，维持上下文的简洁。</p>
<p style="">同时Deepseek V4模型也<span style="color: rgb(28, 30, 33); font-family: system-ui, -apple-system, &quot;Segoe UI&quot;, Roboto, Ubuntu, Cantarell, &quot;Noto Sans&quot;, sans-serif, BlinkMacSystemFont, &quot;Segoe UI&quot;, Helvetica, Arial, sans-serif, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;, &quot;Segoe UI Symbol&quot;; font-size: 16px">针对 Claude Code 、OpenClaw、OpenCode、CodeBuddy 等主流的 Agent 产品进行了适配和优化，在代码任务、文档生成任务等方面表现均有提升。</span></p>
<p style="">评测数据上，DeepSeek V4-Pro-Max 在知识、推理和代码能力上全线提升，综合表现已可对标 GPT-5.4、Claude Opus 4.6 等顶级闭源模型。其推理得分超过 GPT-5.2 和 Gemini 3.0 Pro，知识项略低于 Gemini 3.1 Pro。智能体能力与 Kimi K2.6、GLM-5.1 等领先开源模型持平，长上下文测试在学术基准上甚至超过了 Gemini 3.1 Pro。V4-Flash-Max 则在更低成本下提供了不俗的推理表现，展现出极高的性价比，在部分任务上接近 Pro 版本的水平。</p>
<figure style="align-items: start; display: flex; flex-direction: column" data-content-type="image">
 <img src="https://pym.plus/apis/api.storage.halo.run/v1alpha1/thumbnails/-/via-uri?uri=%2Fupload%2Fimage-TxVW.png&amp;size=m">
</figure>
<p style="">同时值得注意的是，这次Deepseek V4更新后仍然保持与ChatGPT、Claude等模型相对比非常便宜的定价。</p>
<p style="">其快速版本输入仅每百万Tokens 1元，输出仅每百万Tokens 2元，相较于ChatGPT，Claude等顶尖版本的模型，定价便宜了几十至数百元人民币。</p>
<figure style="align-items: center; display: flex; flex-direction: column" data-content-type="image">
 <img src="https://pym.plus/apis/api.storage.halo.run/v1alpha1/thumbnails/-/via-uri?uri=%2Fupload%2Fimage-XJfL.png&amp;size=m" alt="image-XJfL.png" width="461px">
</figure>
<p style=""><span style="background-color: rgb(255, 255, 255); color: rgb(15, 17, 21); font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, Oxygen, Ubuntu, Cantarell, &quot;Open Sans&quot;, &quot;Helvetica Neue&quot;, sans-serif; font-size: 16px">但是也有技术报告坦诚指出，目前的架构仍偏复杂，Anticipatory Routing 和 SwiGLU Clamping 等稳定性机制的内在机理还有待进一步厘清。后续工作方向包括简化结构、提升训练稳定性、向更多稀疏化方向探索、缩短长上下文推理延迟，以及增强多轮智能体和多模态能力等。</span></p>
<figure style="align-items: start; display: flex; flex-direction: column" data-content-type="image">
 <img src="https://pym.plus/apis/api.storage.halo.run/v1alpha1/thumbnails/-/via-uri?uri=%2Fupload%2Fimage-DTsS.png&amp;size=m" alt="image-DTsS.png" width="1080px">
</figure>
<p style=""><span style="background-color: rgb(255, 255, 255); color: rgb(15, 17, 21); font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, Oxygen, Ubuntu, Cantarell, &quot;Open Sans&quot;, &quot;Helvetica Neue&quot;, sans-serif; font-size: 16px">整体来讲，开源的DeepSeek V4 把超长上下文的效率推到新高度，其综合能力极为强大，再一次拉近开源模型与闭源模型的距离。同时这次Deepseek将V4模型分为多个版本，如flash、pro、max、base等版本，可能也是转向商业化的又一步。</span></p>]]></description><guid isPermaLink="false">/archives/1777034414538-ITIcswtI</guid><dc:creator>PYM</dc:creator><enclosure url="https://pym.plus/apis/api.storage.halo.run/v1alpha1/thumbnails/-/via-uri?uri=%2Fupload%2F%25E5%25B1%258F%25E5%25B9%2595%25E6%2588%25AA%25E5%259B%25BE%25202026-04-24%2520204213.png&amp;size=m" type="image/jpeg" length="130848"/><category>Deepseek</category><category>新闻咨询</category><category>AI</category><pubDate>Fri, 24 Apr 2026 13:01:19 GMT</pubDate></item><item><title><![CDATA[国内就可以使用的免费SuperGrok，无需登录无需排队，完全公益免费！]]></title><link>https://pym.plus/archives/1775871009005</link><description><![CDATA[<img src="https://pym.plus/plugins/feed/assets/telemetry.gif?title=%E5%9B%BD%E5%86%85%E5%B0%B1%E5%8F%AF%E4%BB%A5%E4%BD%BF%E7%94%A8%E7%9A%84%E5%85%8D%E8%B4%B9SuperGrok%EF%BC%8C%E6%97%A0%E9%9C%80%E7%99%BB%E5%BD%95%E6%97%A0%E9%9C%80%E6%8E%92%E9%98%9F%EF%BC%8C%E5%AE%8C%E5%85%A8%E5%85%AC%E7%9B%8A%E5%85%8D%E8%B4%B9%EF%BC%81&amp;url=/archives/1775871009005" width="1" height="1" alt="" style="opacity:0;">
<h1 style="" id="%E5%85%AC%E7%9B%8A%E7%AB%99%E4%BB%8B%E7%BB%8D">公益站介绍</h1>
<p style=""><a href="https://grok.dairoot.cn/admin" target="_blank" rel="">传送门链接</a></p>
<figure style="align-items: center; display: flex; flex-direction: column" data-content-type="image">
 <img src="https://pym.plus/apis/api.storage.halo.run/v1alpha1/thumbnails/-/via-uri?uri=%2Fupload%2Fimage-iZMI.png&amp;size=m" alt="image-iZMI.png" width="951px">
</figure>
<p style="">这是一个公益站点，目前里面有3个免费的SuperGrok账号，直接点击就能进入使用</p>
<figure style="align-items: center; display: flex; flex-direction: column" data-content-type="image">
 <img src="https://pym.plus/apis/api.storage.halo.run/v1alpha1/thumbnails/-/via-uri?uri=%2Fupload%2Fimage-bnni.png&amp;size=m" width="873px">
</figure>
<p style="">因为这个站点是完全免费的公益站，只能靠广告盈利来添加SuperGrok账号，所以说如果你是很喜欢广告建议自行添加屏蔽广告插件，本文不介绍屏蔽广告的方法。</p>
<p style=""></p>]]></description><guid isPermaLink="false">/archives/1775871009005</guid><dc:creator>PYM</dc:creator><enclosure url="https://pym.plus/apis/api.storage.halo.run/v1alpha1/thumbnails/-/via-uri?uri=%2Fupload%2Fimage-iZMI.png&amp;size=m" type="image/jpeg" length="18139"/><category>AI</category><pubDate>Sat, 11 Apr 2026 01:35:18 GMT</pubDate></item><item><title><![CDATA[保姆级干货：在AI时代薅羊毛，如何获得大量免费的AI API？学完这个你的小龙虾就不缺粮食了！]]></title><link>https://pym.plus/archives/1775866381964</link><description><![CDATA[<img src="https://pym.plus/plugins/feed/assets/telemetry.gif?title=%E4%BF%9D%E5%A7%86%E7%BA%A7%E5%B9%B2%E8%B4%A7%EF%BC%9A%E5%9C%A8AI%E6%97%B6%E4%BB%A3%E8%96%85%E7%BE%8A%E6%AF%9B%EF%BC%8C%E5%A6%82%E4%BD%95%E8%8E%B7%E5%BE%97%E5%A4%A7%E9%87%8F%E5%85%8D%E8%B4%B9%E7%9A%84AI%20API%EF%BC%9F%E5%AD%A6%E5%AE%8C%E8%BF%99%E4%B8%AA%E4%BD%A0%E7%9A%84%E5%B0%8F%E9%BE%99%E8%99%BE%E5%B0%B1%E4%B8%8D%E7%BC%BA%E7%B2%AE%E9%A3%9F%E4%BA%86%EF%BC%81&url=/archives/1775866381964" width="1" height="1" alt="" style="opacity:0;" /><p style="">本文不会推荐使用速度较慢，安全性较弱的API，都是可以国内使用的，全是干货，作者自己也在使用的！</p><h1 style="" id="1.-aihubmix%EF%BC%88%E6%8E%A8%E7%90%86%E6%97%B6%E4%BB%A3%EF%BC%89">1. AIHubMix（推理时代）</h1><p style=""><a href="https://console.aihubmix.com/sign-up?aff=JZRe" target="_blank" rel="">官网链接</a></p><p style="">在推理时代点击右上角的注册账号后，使用邮箱完成注册，随后打开<a href="https://aihubmix.com/models?aff=JZRe" target="_blank" rel="">模型广场</a>，标签选择 <code>免费</code>，可以看到有很多可以免费调用的大模型，这个列表设置还会随着时间而更新大模型。</p><figure style="align-items: center; display: flex; flex-direction: column" data-content-type="image"><img src="/upload/image-wIZP.png"></figure><p style="">然后进入<a href="https://console.aihubmix.com/token" target="_blank" rel="">密钥页面</a>点击 <code>创建Key</code> ，点开高级设置，模型范围里面可以设置能使用哪些模型，建议设置限制只能使用免费模型，参考示例（如图）：</p><figure style="align-items: center; display: flex; flex-direction: column" data-content-type="image"><img src="/upload/image-pntY.png" width="438px"></figure><p style="">然后你就可以使用这个免费的API了！OpenAI格式调用地址为 <code>https://aihubmix.com/v1</code></p><h1 style="" id="2.-modelscope%EF%BC%88%E9%AD%94%E6%90%AD%E7%A4%BE%E5%8C%BA%EF%BC%89">2. ModelScope（魔搭社区）</h1><p style=""><a href="https://www.modelscope.cn/models" target="_blank" rel="">官网链接</a></p><p style="">进入后使用手机号注册账号，然后点击进入<a href="https://www.modelscope.cn/models?filter=inference_type&amp;page=1&amp;tabKey=task" target="_blank" rel="">模型库</a>，在 <code>支持体验</code> -&gt; <code>勾选推理 API-Inference</code> 然后看到的这些模型才是可以通过API免费调用。</p><figure style="align-items: center; display: flex; flex-direction: column" data-content-type="image"><img src="/upload/image-bKsI.png" width="843px"></figure><p style="">需要注意这些虽然是完全免费的，但是有如下限制</p><figure style="align-items: center; display: flex; flex-direction: column" data-content-type="image"><img src="/upload/image-ImSP.png" width="815px"></figure><p style="">全部完成后就可以进行API调用，在模型页勾选<code>API-Inference</code> 后随便选择一个模型，进入看到这个，点击查看代码范例，里面会有你的API直接复制就可以使用所有免费模型了，OpenAI格式调用地址为 <code>https://api-inference.modelscope.cn/v1</code></p><figure style="align-items: center; display: flex; flex-direction: column" data-content-type="image"><img src="/upload/image-wGqC.png"></figure><h1 style="" id="3.-openrouter">3. OpenRouter</h1><p style=""><a href="https://openrouter.ai/" target="_blank" rel="">官网链接</a></p><p style="">每天提供50次免费调用；</p><p style="">但你充值10 credits，也就是10刀，就有每天1000次的调用次数。充值后的credits，也可以用于其他收费模型的调用。</p><p style="">有需求的可以充个10credits，提升调用次数。</p><p style="">免费模型可以进入模型库搜索Free如 <code>https://openrouter.ai/models?q=free</code> 里面都是可以免费使用的模型。</p><figure style="align-items: center; display: flex; flex-direction: column" data-content-type="image"><img src="/upload/image-QEqI.png" width="890px"></figure><p style="">进入到 <code>https://openrouter.ai/workspaces/default/keys</code> 里面创建一个API设置<span style="background-color: rgb(252, 252, 253); color: rgb(113, 113, 122); font-family: Inter, &quot;Inter Fallback&quot;, ui-sans-serif, system-ui, sans-serif, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;, &quot;Segoe UI Symbol&quot;, &quot;Noto Color Emoji&quot;; font-size: 14px"><strong>Credit limit (optional) </strong></span>为 0 就可以全免费调用了，到量后也不会花钱。</p><p style="">OpenAI格式调用地址为 <code>https://openrouter.ai/api/v1</code></p><h1 style="" id="4.-bigmodel%EF%BC%88%E6%99%BA%E8%B0%B1-ai%EF%BC%89">4. BigModel（智谱 AI）</h1><p style=""><a href="我正在智谱大模型开放平台 BigModel.cn上打造AI应用，智谱新一代旗舰模型GLM-5已上线， 在推理、代码、智能体综合能力达到开源模型 SOTA 水平，通过我的邀请链接注册即可获得 2000万Tokens 大礼包，期待和你一起在BigModel上畅享卓越模型能力；链接：https://www.bigmodel.cn/invite?icode=y2qhlaaXhGqG41KAlkgnsnHEaazDlIZGj9HxftzTbt4%3D" target="_blank" rel="">官网链接</a></p><p style="">手机号注册账号，实名验证后可以调用。</p><p style="">目前可以免费调用的模型有（覆盖视觉理解，深度思考，文本和图片生成）</p><figure style="align-items: start; display: flex; flex-direction: column" data-content-type="image"><img src="/upload/image-cnCW.png" width="462px"></figure><figure style="align-items: start; display: flex; flex-direction: column" data-content-type="image"><img src="/upload/image-UwSV.png"></figure><figure style="align-items: start; display: flex; flex-direction: column" data-content-type="image"><img src="/upload/image-Pacp.png" width="969px"></figure><figure style="align-items: start; display: flex; flex-direction: column" data-content-type="image"><img src="/upload/image-tTzk.png" width="446px"></figure><p style="">还送一些3个月的资源包，可以用用</p><figure style="align-items: start; display: flex; flex-direction: column" data-content-type="image"><img src="/upload/image-smsU.png" width="1126px"></figure><p style="">OpenAI格式调用地址为 <code>https://open.bigmodel.cn/api/paas/v4/</code></p><h1 style="" id="5.-grok%E5%85%AC%E7%9B%8A%E7%AB%99">5. Grok公益站</h1><p style=""><a href="https://grok.dairoot.cn/admin" target="_blank" rel="">链接</a></p><p style="">最后附上一个宝藏公益站，有 <code>SuperGrok账号</code> 且不用等陆排队就可以使用，除了广告有点多，可以安装一些浏览器插件解决</p><figure style="align-items: start; display: flex; flex-direction: column" data-content-type="image"><img src="/upload/image-iZMI.png" width="951px"></figure><p style="">且支持API使用，目前我体验过发现可以使用 <code>Grok4</code> 且还未发现有什么总量限制，还是很不错的</p><figure style="align-items: start; display: flex; flex-direction: column" data-content-type="image"><img src="/upload/image-nsuj.png" width="955px"></figure><h1 style="" id="%E7%BB%93%E5%B0%BE">结尾</h1><p style="">感谢你能读完这篇文章，大家如果有什么新的薅羊毛的方法可以分享在评论区，作者看到后也会不定期更新这篇文章，或者写一篇新的文章的！</p><p style=""><a href="https://aihubmix.com/?aff=JZRe" target="_blank" rel="">官网链接推理时代</a></p>]]></description><guid isPermaLink="false">/archives/1775866381964</guid><dc:creator>PYM</dc:creator><enclosure url="https://pym.plus/apis/api.storage.halo.run/v1alpha1/thumbnails/-/via-uri?uri=%2Fupload%2Fimage-wIZP.png&amp;size=m" type="image/jpeg" length="100721"/><category>AI</category><pubDate>Sat, 11 Apr 2026 01:22:37 GMT</pubDate></item><item><title><![CDATA[Deepseek-V4要来了的预兆？Deepseek专家模式低调上新！Deepseek首次引入模式分层！]]></title><link>https://pym.plus/archives/1775647416143</link><description><![CDATA[<img src="https://pym.plus/plugins/feed/assets/telemetry.gif?title=Deepseek-V4%E8%A6%81%E6%9D%A5%E4%BA%86%E7%9A%84%E9%A2%84%E5%85%86%EF%BC%9FDeepseek%E4%B8%93%E5%AE%B6%E6%A8%A1%E5%BC%8F%E4%BD%8E%E8%B0%83%E4%B8%8A%E6%96%B0%EF%BC%81Deepseek%E9%A6%96%E6%AC%A1%E5%BC%95%E5%85%A5%E6%A8%A1%E5%BC%8F%E5%88%86%E5%B1%82%EF%BC%81&amp;url=/archives/1775647416143" width="1" height="1" alt="" style="opacity:0;">
<h1 style="" id="%E5%89%8D%E8%A8%80">前言</h1>
<p style=""><span style="background-color: rgb(255, 255, 255); color: rgb(25, 25, 25); font-family: &quot;PingFang SC&quot;, Arial, 微软雅黑, 宋体, simsun, sans-serif; font-size: 16px">4月8日的凌晨，Deepseek在没有任何官方公告的情况下，上新了网页版的专家模式</span></p>
<figure style="align-items: center; display: flex; flex-direction: column" data-content-type="image">
 <img src="https://pym.plus/apis/api.storage.halo.run/v1alpha1/thumbnails/-/via-uri?uri=%2Fupload%2F%25E6%2589%25B9%25E6%25B3%25A8%25202026-04-08%2520192328.png&amp;size=m" alt="批注 2026-04-08 192328.png" width="818px">
</figure>
<p style="">日常小问题使用快速模式和专家模式的区别不大，但是在写代码，数学问题，<span style="background-color: rgb(255, 255, 255); color: rgb(25, 25, 25); font-family: &quot;PingFang SC&quot;, Arial, 微软雅黑, 宋体, simsun, sans-serif; font-size: 16px">物理问题等等上面，专家模式会明显优于快速模式，同时思考时间和逻辑严谨性也要高于快速模式。</span></p>
<p style=""></p>
<p style=""><span style="background-color: rgb(255, 255, 255); color: rgb(25, 25, 25); font-family: &quot;PingFang SC&quot;, Arial, 微软雅黑, 宋体, simsun, sans-serif; font-size: 16px">同时，灰度测试用户界面还出现了第三个选项“视觉模式”，不过这一模式并未出现在本次所有人的更新中。</span></p>
<p style=""></p>
<p style=""><span style="background-color: rgb(255, 255, 255); color: rgb(25, 25, 25); font-family: &quot;PingFang SC&quot;, Arial, 微软雅黑, 宋体, simsun, sans-serif; font-size: 16px">这次升级来得并不突然。3月30日，DeepSeek经历了超10小时的C端服务崩溃，网页端和App无法使用，但API调用正常。过去60天内，这已是第二次大规模中断。这是因为Deepseek的算力资源远低于实际日活需求，导致资源不足而崩溃，这也是Deepseek引入模式分层的原因之一。</span></p>
<p style=""></p>
<p style="">此次对话界面更新或许是DeepSeek V4版本发布的前奏。</p>
<figure style="align-items: center; display: flex; flex-direction: column" data-content-type="image">
 <img src="https://pym.plus/apis/api.storage.halo.run/v1alpha1/thumbnails/-/via-uri?uri=%2Fupload%2Fimage-IzZh.png&amp;size=m" width="687px">
</figure>
<p style=""></p>
<p style="">也有业内分析指出认为本次模式分层正是Deepseek不堪财务重负，迟迟无法实现大规模盈利，从而转为商业化的第一步，或许以后Deepseek将不再完全免费。</p>
<p style=""></p>
<h1 style="" id="%E5%AE%9E%E6%B5%8B">实测</h1>
<p style="">给 专家模式 和 快速模式 都使用同样的提示词，“编写小球真实物理模拟在复杂2D地形中下落弹跳滚动的html网页”</p>
<p style="">从专家模式生成的内容可以明显看出比快速模式优秀了不少！</p>
<h3 style="" id="%E5%BF%AB%E9%80%9F%E6%A8%A1%E5%BC%8F">快速模式</h3>
<figure style="align-items: center; display: flex; flex-direction: column" data-content-type="image">
 <img src="https://pym.plus/apis/api.storage.halo.run/v1alpha1/thumbnails/-/via-uri?uri=%2Fupload%2Fimage-XxnG.png&amp;size=m" width="799px">
</figure>
<h3 style="" id="%E4%B8%93%E5%AE%B6%E6%A8%A1%E5%BC%8F">专家模式</h3>
<figure style="align-items: center; display: flex; flex-direction: column" data-content-type="image">
 <img src="https://pym.plus/apis/api.storage.halo.run/v1alpha1/thumbnails/-/via-uri?uri=%2Fupload%2Fimage-tqFJ.png&amp;size=m" width="807px">
</figure>
<h1 style="" id="%E7%BB%93%E5%B0%BE">结尾</h1>
<p style="">Deepseek一直免费持续更新是愿景，但不得不迈向商业化，节省开销是现实。</p>
<p style="">或许在将来，我们会用上Deepseek V4、V5、V6，甚至更多新的模型，但到了那时也许Deepseek将逐渐融入现实的行业环境中来。</p>
<p style="">欢迎大家在评论区发表自己的看法！</p>]]></description><guid isPermaLink="false">/archives/1775647416143</guid><dc:creator>PYM</dc:creator><enclosure url="https://pym.plus/apis/api.storage.halo.run/v1alpha1/thumbnails/-/via-uri?uri=%2Fupload%2F%25E6%2589%25B9%25E6%25B3%25A8%25202026-04-08%2520192328.png&amp;size=m" type="image/jpeg" length="22718"/><category>新闻咨询</category><category>AI</category><pubDate>Wed, 8 Apr 2026 11:36:21 GMT</pubDate></item><item><title><![CDATA[游玩本站必读公告]]></title><link>https://pym.plus/archives/1772415751172</link><description><![CDATA[<img src="https://pym.plus/plugins/feed/assets/telemetry.gif?title=%E6%B8%B8%E7%8E%A9%E6%9C%AC%E7%AB%99%E5%BF%85%E8%AF%BB%E5%85%AC%E5%91%8A&amp;url=/archives/1772415751172" width="1" height="1" alt="" style="opacity:0;">
<p style="">本文用于长期保存各种重要公告。</p>
<h1 style="" id="%E5%AF%BC%E8%88%AA%E9%A1%B5">导航页</h1>
<p style="">这是网站一个比较重要的页面，里面有一些博主自己的搭建的工具和服务，感兴趣的小伙伴可以去看看，希望能够帮助到大家。</p>
<p style=""><a href="https://pym.plus/nav-page" target="_self" rel="">传送门链接</a></p>
<h1 style="" id="%E6%88%91%E7%9A%84%E8%81%94%E7%B3%BB%E6%96%B9%E5%BC%8F">我的联系方式</h1>
<p style="">邮箱： <code>me@pym.plus</code></p>
<p style="">在线聊天： <code>添加好友-&gt;pymcn</code></p>
<h1 style="" id="%E5%9C%A8%E7%BA%BF%E8%81%8A%E5%A4%A9">在线聊天</h1>
<p style="">注册账号并同意协议可以使用 <code>在线聊天</code> 服务，可以使用 <code>添加群聊</code> 搜索 <code>所有人</code> 加入所有人都可以加入的公共群聊。</p>
<p style="">一直掉线无法连接，请尝试清空聊天消息，可能是消息太多导致连接掉线。N</p>
<p style=""></p>]]></description><guid isPermaLink="false">/archives/1772415751172</guid><dc:creator>PYM</dc:creator><enclosure url="https://pym.plus/apis/api.storage.halo.run/v1alpha1/thumbnails/-/via-uri?uri=%2Fupload%2F%25E5%25B1%258F%25E5%25B9%2595%25E6%2588%25AA%25E5%259B%25BE%25202026-03-02%2520094336.png&amp;size=m" type="image/jpeg" length="12675"/><category>公告</category><pubDate>Wed, 8 Apr 2026 01:44:00 GMT</pubDate></item><item><title><![CDATA[Claude Code源代码惨遭泄露，几句话告诉你泄露的原因，附下载链接]]></title><link>https://pym.plus/archives/1775534130555</link><description><![CDATA[<img src="https://pym.plus/plugins/feed/assets/telemetry.gif?title=Claude%20Code%E6%BA%90%E4%BB%A3%E7%A0%81%E6%83%A8%E9%81%AD%E6%B3%84%E9%9C%B2%EF%BC%8C%E5%87%A0%E5%8F%A5%E8%AF%9D%E5%91%8A%E8%AF%89%E4%BD%A0%E6%B3%84%E9%9C%B2%E7%9A%84%E5%8E%9F%E5%9B%A0%EF%BC%8C%E9%99%84%E4%B8%8B%E8%BD%BD%E9%93%BE%E6%8E%A5&amp;url=/archives/1775534130555" width="1" height="1" alt="" style="opacity:0;">
<h1 style="" id="%E6%B3%84%E9%9C%B2%E8%BF%87%E7%A8%8B">泄露过程</h1>
<h3 style="text-align: left" id="%E7%AC%AC%E4%B8%80%E6%AC%A1%E6%B3%84%E9%9C%B2%EF%BC%882025-%E5%B9%B4-2-%E6%9C%88%EF%BC%89"><strong>第一次泄露（2025 年 2 月）</strong></h3>
<p style="text-align: left">Claude Code 随 Claude 3.7 一起发布，以 npm 包形式分发。在 v0.2.8 及之前版本中：</p>
<p style=""><strong>使用了开发环境配置打生产包，包含了</strong><span style="background-color: rgba(0, 0, 0, 0.04); color: rgb(192, 52, 29); font-family: ui-monospace, SFMono-Regular, &quot;SF Mono&quot;, Menlo, Consolas, &quot;Liberation Mono&quot;, monospace, sans-serif; font-size: 12px">inline-source-map</span><strong>所以混淆可以说是没有，被一行命令即可反解出全部源码</strong></p>
<p style="text-align: left">Anthropic发现后删除了 0.2.8 之前的包，并在 0.2.9 中修正。但 GitHub 上已经有人存档了完整代码（如 <a href="https://github.com/dnakov/claude-code" target="_blank" rel="noopener nofollow"><u>dnakov/claude-code</u></a>）。</p>
<h3 style="text-align: left" id="%E7%AC%AC%E4%BA%8C%E6%AC%A1%E6%B3%84%E9%9C%B2%EF%BC%882026-%E5%B9%B4-3-%E6%9C%88%EF%BC%89"><strong>第二次泄露（2026 年 3 月）</strong></h3>
<p style="text-align: left">版本从 <code>0.2.x</code> 到 <code>2.1.88</code>，代码量膨胀了近 10 倍，但是还是没涨记性：</p>
<p style="text-align: left"><strong>npm 包中误留了 cli.js.map 文件（59.8 MB）</strong></p>
<p style="text-align: left">所以又被放出源码了。。。</p>
<p style="text-align: left">提取方式也非常简单：</p>
<pre><code class="language-bash"># 下载 npm 包
npm pack @anthropic-ai/claude-code@2.1.88

# 解压
tar -xzf anthropic-ai-claude-code-2.1.88.tgz

# cli.js.map 的 sourcesContent 字段中包含了所有源码
# 一行 jq 即可提取
cat package/cli.js.map | jq -r '.sources[]' </code></pre>
<h2 style="" id="%E4%BB%A3%E7%A0%81%E7%BB%9F%E8%AE%A1"><strong>代码统计</strong></h2>
<div style="overflow-x: auto; overflow-y: hidden;">
 <table style="width: 200px">
  <colgroup>
   <col style="width: 100px">
   <col style="width: 100px">
  </colgroup>
  <tbody>
   <tr style="box-sizing: border-box; background-color: rgb(255, 255, 255); border-top: 1px solid rgba(209, 217, 224, 0.7);">
    <th colspan="1" rowspan="1" colwidth="100" style="box-sizing: border-box; padding: 6px 13px; font-weight: 600; border-color: rgb(209, 217, 224); border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 stretch;">
     <p style=""><strong>指标</strong></p>
    </th>
    <th colspan="1" rowspan="1" colwidth="100" style="box-sizing: border-box; padding: 6px 13px; font-weight: 600; border-color: rgb(209, 217, 224); border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 stretch;">
     <p style=""><strong>数量</strong></p>
    </th>
   </tr>
   <tr style="box-sizing: border-box; background-color: rgb(255, 255, 255); border-top: 1px solid rgba(209, 217, 224, 0.7);">
    <td colspan="1" rowspan="1" colwidth="100" style="box-sizing: border-box; padding: 6px 13px; border-color: rgb(209, 217, 224); border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 stretch;">
     <p style="">TypeScript 文件</p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="box-sizing: border-box; padding: 6px 13px; border-color: rgb(209, 217, 224); border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 stretch;">
     <p style="">~1884</p>
    </td>
   </tr>
   <tr style="box-sizing: border-box; background-color: rgb(246, 248, 250); border-top: 1px solid rgba(209, 217, 224, 0.7);">
    <td colspan="1" rowspan="1" colwidth="100" style="box-sizing: border-box; padding: 6px 13px; border-color: rgb(209, 217, 224); border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 stretch;">
     <p style="">命令数量</p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="box-sizing: border-box; padding: 6px 13px; border-color: rgb(209, 217, 224); border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 stretch;">
     <p style="">~50+</p>
    </td>
   </tr>
   <tr style="box-sizing: border-box; background-color: rgb(255, 255, 255); border-top: 1px solid rgba(209, 217, 224, 0.7);">
    <td colspan="1" rowspan="1" colwidth="100" style="box-sizing: border-box; padding: 6px 13px; border-color: rgb(209, 217, 224); border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 stretch;">
     <p style="">工具数量</p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="box-sizing: border-box; padding: 6px 13px; border-color: rgb(209, 217, 224); border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 stretch;">
     <p style="">~30+</p>
    </td>
   </tr>
   <tr style="box-sizing: border-box; background-color: rgb(246, 248, 250); border-top: 1px solid rgba(209, 217, 224, 0.7);">
    <td colspan="1" rowspan="1" colwidth="100" style="box-sizing: border-box; padding: 6px 13px; border-color: rgb(209, 217, 224); border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 stretch;">
     <p style="">UI 组件</p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="box-sizing: border-box; padding: 6px 13px; border-color: rgb(209, 217, 224); border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 stretch;">
     <p style="">~100+</p>
    </td>
   </tr>
  </tbody>
 </table>
</div>
<h2 style="" id="%E5%85%B3%E9%94%AE%E6%96%87%E4%BB%B6"><strong>关键文件</strong></h2>
<div style="overflow-x: auto; overflow-y: hidden;">
 <table style="width: 200px">
  <colgroup>
   <col style="width: 100px">
   <col style="width: 100px">
  </colgroup>
  <tbody>
   <tr style="box-sizing: border-box; background-color: rgb(255, 255, 255); border-top: 1px solid rgba(209, 217, 224, 0.7);">
    <th colspan="1" rowspan="1" colwidth="100" style="box-sizing: border-box; padding: 6px 13px; font-weight: 600; border-color: rgb(209, 217, 224); border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 stretch;">
     <p style=""><strong>文件</strong></p>
    </th>
    <th colspan="1" rowspan="1" colwidth="100" style="box-sizing: border-box; padding: 6px 13px; font-weight: 600; border-color: rgb(209, 217, 224); border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 stretch;">
     <p style=""><strong>描述</strong></p>
    </th>
   </tr>
   <tr style="box-sizing: border-box; background-color: rgb(255, 255, 255); border-top: 1px solid rgba(209, 217, 224, 0.7);">
    <td colspan="1" rowspan="1" colwidth="100" style="box-sizing: border-box; padding: 6px 13px; border-color: rgb(209, 217, 224); border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 stretch;">
     <p style=""><code>main.tsx</code></p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="box-sizing: border-box; padding: 6px 13px; border-color: rgb(209, 217, 224); border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 stretch;">
     <p style="">应用主入口</p>
    </td>
   </tr>
   <tr style="box-sizing: border-box; background-color: rgb(246, 248, 250); border-top: 1px solid rgba(209, 217, 224, 0.7);">
    <td colspan="1" rowspan="1" colwidth="100" style="box-sizing: border-box; padding: 6px 13px; border-color: rgb(209, 217, 224); border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 stretch;">
     <p style=""><code>commands.ts</code></p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="box-sizing: border-box; padding: 6px 13px; border-color: rgb(209, 217, 224); border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 stretch;">
     <p style="">命令注册中心</p>
    </td>
   </tr>
   <tr style="box-sizing: border-box; background-color: rgb(255, 255, 255); border-top: 1px solid rgba(209, 217, 224, 0.7);">
    <td colspan="1" rowspan="1" colwidth="100" style="box-sizing: border-box; padding: 6px 13px; border-color: rgb(209, 217, 224); border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 stretch;">
     <p style=""><code>tools.ts</code></p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="box-sizing: border-box; padding: 6px 13px; border-color: rgb(209, 217, 224); border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 stretch;">
     <p style="">工具注册中心</p>
    </td>
   </tr>
   <tr style="box-sizing: border-box; background-color: rgb(246, 248, 250); border-top: 1px solid rgba(209, 217, 224, 0.7);">
    <td colspan="1" rowspan="1" colwidth="100" style="box-sizing: border-box; padding: 6px 13px; border-color: rgb(209, 217, 224); border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 stretch;">
     <p style=""><code>context.ts</code></p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="box-sizing: border-box; padding: 6px 13px; border-color: rgb(209, 217, 224); border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 stretch;">
     <p style="">上下文管理</p>
    </td>
   </tr>
   <tr style="box-sizing: border-box; background-color: rgb(255, 255, 255); border-top: 1px solid rgba(209, 217, 224, 0.7);">
    <td colspan="1" rowspan="1" colwidth="100" style="box-sizing: border-box; padding: 6px 13px; border-color: rgb(209, 217, 224); border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 stretch;">
     <p style=""><code>ink.tsx</code></p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="box-sizing: border-box; padding: 6px 13px; border-color: rgb(209, 217, 224); border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 stretch;">
     <p style="">UI 渲染引擎</p>
    </td>
   </tr>
  </tbody>
 </table>
</div>
<h1 style="" id="%E6%BA%90%E7%A0%81%E4%B8%8B%E8%BD%BD">源码下载</h1>
<p style="">Github：<a href="https://github.com/huangserva/claude-code-cli" target="_blank" rel="">https://github.com/huangserva/claude-code-cli</a></p>
<p style="">网盘：<a href="https://pan.pym.plus/s/owc9" target="_blank" rel="">https://pan.pym.plus/s/owc9</a></p>
<p style=""></p>]]></description><guid isPermaLink="false">/archives/1775534130555</guid><dc:creator>PYM</dc:creator><enclosure url="https://pym.plus/apis/api.storage.halo.run/v1alpha1/thumbnails/-/via-uri?uri=%2Fupload%2F%25E6%2589%25B9%25E6%25B3%25A8%25202026-04-07%2520142458.png&amp;size=m" type="image/jpeg" length="39231"/><category>漏洞</category><category>Github</category><pubDate>Tue, 7 Apr 2026 06:27:24 GMT</pubDate></item><item><title><![CDATA[Docker快速部署Astrbot，开源的一站式 Agentic 个人和群聊助手]]></title><link>https://pym.plus/archives/1775183683911</link><description><![CDATA[<img src="https://pym.plus/plugins/feed/assets/telemetry.gif?title=Docker%E5%BF%AB%E9%80%9F%E9%83%A8%E7%BD%B2Astrbot%EF%BC%8C%E5%BC%80%E6%BA%90%E7%9A%84%E4%B8%80%E7%AB%99%E5%BC%8F%20Agentic%20%E4%B8%AA%E4%BA%BA%E5%92%8C%E7%BE%A4%E8%81%8A%E5%8A%A9%E6%89%8B&amp;url=/archives/1775183683911" width="1" height="1" alt="" style="opacity:0;">
<h1 style="" id="%E5%89%8D%E8%A8%80">前言</h1>
<p style="">Openclaw确实比较火，但其复杂的配置界面，并不直观的UI设计导致其上手难度对小白不是很友好，而最近Astrbot的Agent更新，使其有了与Openclaw差不多的能力，本文就来讲讲怎么用Docker快速部署Astrbot。</p>
<h1 style="" id="%E9%83%A8%E7%BD%B2">部署</h1>
<h2 style="" id="%E6%8B%89%E5%8F%96%E9%95%9C%E5%83%8F">拉取镜像</h2>
<p style="">首先你需要Docker，没有参考<a href="https://pym.plus/archives/1772243427656" target="_blank" rel="">这篇文章</a>部署</p>
<p style="">然后执行这条命令</p>
<pre><code class="language-shellscript">sudo docker run -itd -p 6185:6185 -p 6199:6199 -v $PWD/data:/AstrBot/data -v /etc/localtime:/etc/localtime:ro -v /etc/timezone:/etc/timezone:ro --name astrbot m.daocloud.io/docker.io/soulter/astrbot:latest</code></pre>
<p style="">然后等待拉取镜像和启动就可以了。</p>
<h2 style="" id="%E9%85%8D%E7%BD%AE">配置</h2>
<p style="">默认安装好的Astrbot并没有直接使用电脑的能力，需要设置一下才能使用。</p>
<p style="">进入 <code>配置文件</code> -&gt; <code>普通配置</code> -&gt;<code>使用电脑能力</code> -&gt; <code>运行环境</code> ，然后选择 <code>local</code> ，这代表在本地电脑运行，也可以选择 <code>sandbox</code> 代表在沙箱环境中运行。</p>
<figure style="align-items: start; display: flex; flex-direction: column" data-content-type="image">
 <img src="https://pym.plus/apis/api.storage.halo.run/v1alpha1/thumbnails/-/via-uri?uri=%2Fupload%2Fimage-Fmjm.png&amp;size=m">
</figure>
<p style="">需要注意的是，如果你勾选了 <code>需要 AstrBot 管理员权限</code> 且你更改了管理员账户的用户名时需要在当前这个页面点击左边的 <code>平台配置</code> ，然后修改<strong>管理员 ID</strong>为你的管理员用户名。</p>
<figure style="align-items: start; display: flex; flex-direction: column" data-content-type="image">
 <img src="https://pym.plus/apis/api.storage.halo.run/v1alpha1/thumbnails/-/via-uri?uri=%2Fupload%2Fimage-dyMm.png&amp;size=m" width="776px">
</figure>
<p style="">这样才能正常使用Agent能力</p>
<h2 style="" id="%E9%85%8D%E7%BD%AE%E6%A8%A1%E5%9E%8B">配置模型</h2>
<p style="">进入到模型提供商，然后点击新增就可以添加了，具体参考图片，如果新增里没有你的模型提供商也可以随便添加一个，然后修改 <code>API Base URL</code> 为你的模型提供商的适配OpenAI的请求地址，然后修改ID，可以自己随便写一个，最后点击 <code>保存并获取模型</code> ，等待模型列表出现，点击对应模型旁边的+号，然后再启用就可以使用了。</p>
<figure style="align-items: start; display: flex; flex-direction: column" data-content-type="image">
 <img src="https://pym.plus/apis/api.storage.halo.run/v1alpha1/thumbnails/-/via-uri?uri=%2Fupload%2Fimage-QbRh.png&amp;size=m">
</figure>
<h1 style="" id="%E5%AE%8C%E6%88%90">完成</h1>
<p style="">恭喜你到这里就大功告成了，快去试试吧，点击右上角的 <code>Bot/Chat</code> 选择 <code>Chat</code> 就可以直接在网页里聊天使用了。</p>
<figure style="align-items: start; display: flex; flex-direction: column" data-content-type="image">
 <img src="https://pym.plus/apis/api.storage.halo.run/v1alpha1/thumbnails/-/via-uri?uri=%2Fupload%2Fimage-erCP.png&amp;size=m">
</figure>
<p style=""></p>]]></description><guid isPermaLink="false">/archives/1775183683911</guid><dc:creator>PYM</dc:creator><enclosure url="https://pym.plus/apis/api.storage.halo.run/v1alpha1/thumbnails/-/via-uri?uri=%2Fupload%2F%25E6%2589%25B9%25E6%25B3%25A8%25202026-04-03%2520103432.png&amp;size=m" type="image/jpeg" length="38391"/><category>AI</category><category>Docker</category><category>服务器</category><pubDate>Fri, 3 Apr 2026 02:58:05 GMT</pubDate></item><item><title><![CDATA[今天是愚人节，请将这篇文章转发给你的亲朋好友]]></title><link>https://pym.plus/archives/1775045736845</link><description><![CDATA[<img src="https://pym.plus/plugins/feed/assets/telemetry.gif?title=%E4%BB%8A%E5%A4%A9%E6%98%AF%E6%84%9A%E4%BA%BA%E8%8A%82%EF%BC%8C%E8%AF%B7%E5%B0%86%E8%BF%99%E7%AF%87%E6%96%87%E7%AB%A0%E8%BD%AC%E5%8F%91%E7%BB%99%E4%BD%A0%E7%9A%84%E4%BA%B2%E6%9C%8B%E5%A5%BD%E5%8F%8B&amp;url=/archives/1775045736845" width="1" height="1" alt="" style="opacity:0;">
<p style="">今天是愚人节，转发这篇文章给你的亲朋好友，不用想太多，也不用纠结转发的意义，反正就是转发就好，没有任何目的，也没有任何回报，只是单纯地浪费一点时间，浪费你手指滑动的那几秒，浪费你打开通讯录、选择联系人的那几分钟，就像平时浪费的无数个瞬间一样，没有任何价值，也没有任何意义，就那样平平淡淡地消耗着这一天的时光，消耗着愚人节这一天独有的、本就无关紧要的几分几秒。</p>
<p style="">你不用在意转发之后亲朋好友会怎么想，不用在意他们会不会点开，会不会看完，甚至不用在意这篇文章里写的是什么内容，因为本来就没有什么有意义的东西，转发只是一个动作，一个无意义的动作，就像你平时发呆、走神、对着手机屏幕放空一样，都是在浪费时间，都是在做没有价值的事情。也许你转发的时候，只是随手一点，没有经过任何思考，也许你只是觉得，愚人节就应该做一些这样无厘头、无意义的事情，就应该浪费一点时间，不用追求任何结果，也不用在意任何回报。</p>
<p style="">转发这篇文章，不用管它能不能给你带来快乐，不用管它能不能给你的亲朋好友带来惊喜，反正都是浪费时间，反正都是没有意义的举动。你可以转发给你的父母，转发给你的兄弟姐妹，转发给你的同学朋友，转发给你认识的每一个人，不用筛选，不用犹豫，浪费一点时间在选择转发对象上，浪费一点时间在等待转发成功的瞬间，这些都是无意义的浪费，都是无关紧要的消耗，就像我们每天浪费的那些碎片化时间一样，悄无声息，没有痕迹，也没有任何价值。</p>
<p style="">也许有人会问，转发这篇文章有什么用？其实没有任何用，既不能让你暴富，也不能让你变得更好，更不能改变什么，只是单纯地浪费时间，只是在愚人节这一天，做一件和愚人节一样，看似有趣、实则无意义的事情。我们每天都在浪费时间，吃饭的时候浪费时间，睡觉的时候浪费时间，刷手机的时候浪费时间，发呆的时候浪费时间，而转发这篇文章，只是无数浪费时间的举动中的一个，没有什么特别，也没有什么不同，只是刚好赶上了愚人节，刚好有这样一篇无意义的文章，供我们浪费时间，供我们随手转发。</p>
<p style="">今天是愚人节，转发这篇文章给你的亲朋好友，不用想转发的意义，不用想浪费时间的可惜，反正时间本来就是用来浪费的，反正我们每天都在无意义地消耗着时光。转发之后，你可以继续刷手机，继续发呆，继续做那些没有意义的事情，继续浪费剩下的时间，没有任何负担，也没有任何顾虑。这篇文章没有任何营养，没有任何干货，没有任何值得你记住的内容，就像我们浪费的那些时间一样，过后就忘，没有留下一点痕迹，也没有给我们带来任何收获。</p>
<p style="">转发吧，不用犹豫，不用纠结，浪费一点时间又怎么样，反正我们有很多时间可以浪费，反正这些浪费的时间，也不会对我们的生活造成任何影响。今天是愚人节，就让我们一起，无意义地浪费一次时间，转发这篇文章，给你的亲朋好友，一起浪费时间，一起做没有意义的事情，不用追求任何结果，不用在意任何回报，只是单纯地享受这份无意义的浪费，享受这份不用思考、不用努力的轻松，就像平时无数个浪费时间的瞬间一样，平平淡淡，无滋无味，却又真实地消耗着我们的时光，直到这一天结束，直到我们又浪费了一天的时间，没有任何意义，也没有任何遗憾。</p>
<p style=""></p>
<p style="">最后，愚人节快乐~~~</p>]]></description><guid isPermaLink="false">/archives/1775045736845</guid><dc:creator>PYM</dc:creator><enclosure url="https://pym.plus/apis/api.storage.halo.run/v1alpha1/thumbnails/-/via-uri?uri=%2Fupload%2F%25E6%2589%25B9%25E6%25B3%25A8%25202026-04-01%2520201607.png&amp;size=m" type="image/jpeg" length="41361"/><category>生活</category><pubDate>Wed, 1 Apr 2026 12:17:10 GMT</pubDate></item><item><title><![CDATA[P4171 [JSOI2010] 满汉全席 2-SAT详细题解]]></title><link>https://pym.plus/archives/1774660003038</link><description><![CDATA[<img src="https://pym.plus/plugins/feed/assets/telemetry.gif?title=P4171%20%5BJSOI2010%5D%20%E6%BB%A1%E6%B1%89%E5%85%A8%E5%B8%AD%202-SAT%E8%AF%A6%E7%BB%86%E9%A2%98%E8%A7%A3&amp;url=/archives/1774660003038" width="1" height="1" alt="" style="opacity:0;">
<p style=""><a href="https://www.luogu.com.cn/problem/P4171" target="_blank" rel="">题目传送门</a></p>
<p style="">前置知识：2-SAT</p>
<h1 style="" id="%E9%A2%98%E7%9B%AE%E5%A4%A7%E6%84%8F">题目大意</h1>
<p style="">有 <span style="background-color: rgba(0, 0, 0, 0); color: rgb(0, 0, 0); font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 19.36px; line-height: 23.232px">n</span> 种材料，每种可做<strong>满式（m）或汉式（h）</strong>。<span style="background-color: rgba(0, 0, 0, 0); color: rgb(0, 0, 0); font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 19.36px; line-height: 23.232px">m</span> 位评审各有两个喜好（如 <code>m1</code>、<code>h2</code>），只要选手做出其中一个喜好的菜，该评审就通过。</p>
<p style="">问：是否存在一种做菜方案，能让<strong>所有评审都通过</strong>？</p>
<ul>
 <li>
  <p style="">存在输出 <code>GOOD</code>，否则输出 <code>BAD</code>。</p>
 </li>
</ul>
<h1 style="" id="%E8%A7%A3%E9%A2%98%E6%80%9D%E8%B7%AF">解题思路</h1>
<p style=""><s>显然</s>这是一道2-SAT裸题。</p>
<h2 style="" id="%E5%88%86%E6%9E%90%E9%A2%98%E7%9B%AE">分析题目</h2>
<p style="">把每样材料拆成 <span class="katex-inline"><span class="katex">
   <math xmlns="http://www.w3.org/1998/Math/MathML">
    <semantics>
     <mrow><mi>i</mi></mrow><annotation encoding="application/x-tex">i</annotation>
    </semantics>
   </math>
  </span></span> 拆开，用 <span class="katex-inline"><span class="katex">
   <math xmlns="http://www.w3.org/1998/Math/MathML">
    <semantics>
     <mrow><mi>i</mi></mrow><annotation encoding="application/x-tex">i</annotation>
    </semantics>
   </math>
  </span></span> 表示<strong>满式</strong>做法，用 <span class="katex-inline"><span class="katex">
   <math xmlns="http://www.w3.org/1998/Math/MathML">
    <semantics>
     <mrow><mi>i</mi><mo>+</mo><mi>n</mi></mrow><annotation encoding="application/x-tex">i +n </annotation>
    </semantics>
   </math>
  </span></span> 表示<strong>汉式</strong>做法。</p>
<p style="">因为每个评委的要求只要满足一样的即可，所以可以看作是<strong>或</strong></p>
<p style="">点 <span class="katex-inline"><span class="katex">
   <math xmlns="http://www.w3.org/1998/Math/MathML">
    <semantics>
     <mrow><mi>u</mi></mrow><annotation encoding="application/x-tex">u</annotation>
    </semantics>
   </math>
  </span></span> 可以是<strong>满/汉</strong>式，点 <span class="katex-inline"><span class="katex">
   <math xmlns="http://www.w3.org/1998/Math/MathML">
    <semantics>
     <mrow><mi>v</mi></mrow><annotation encoding="application/x-tex">v</annotation>
    </semantics>
   </math>
  </span></span> 也可以是<strong>满/汉</strong>式，所以有<strong>4种情况</strong>：</p>
<ol>
 <li>
  <p style="">要求点 <span class="katex-inline"><span class="katex">
     <math xmlns="http://www.w3.org/1998/Math/MathML">
      <semantics>
       <mrow><mi>u</mi></mrow><annotation encoding="application/x-tex">u</annotation>
      </semantics>
     </math>
    </span></span> 是满式 或 点 <span class="katex-inline"><span class="katex">
     <math xmlns="http://www.w3.org/1998/Math/MathML">
      <semantics>
       <mrow><mi>v</mi></mrow><annotation encoding="application/x-tex">v</annotation>
      </semantics>
     </math>
    </span></span> 是满式，那么若 <span class="katex-inline"><span class="katex">
     <math xmlns="http://www.w3.org/1998/Math/MathML">
      <semantics>
       <mrow><mi>u</mi></mrow><annotation encoding="application/x-tex">u</annotation>
      </semantics>
     </math>
    </span></span> 为汉式，则 <span class="katex-inline"><span class="katex">
     <math xmlns="http://www.w3.org/1998/Math/MathML">
      <semantics>
       <mrow><mi>v</mi></mrow><annotation encoding="application/x-tex">v</annotation>
      </semantics>
     </math>
    </span></span> 必为满式；若 <span class="katex-inline"><span class="katex">
     <math xmlns="http://www.w3.org/1998/Math/MathML">
      <semantics>
       <mrow><mi>v</mi></mrow><annotation encoding="application/x-tex">v</annotation>
      </semantics>
     </math>
    </span></span> 为汉式，则 <span class="katex-inline"><span class="katex">
     <math xmlns="http://www.w3.org/1998/Math/MathML">
      <semantics>
       <mrow><mi>u</mi></mrow><annotation encoding="application/x-tex">u</annotation>
      </semantics>
     </math>
    </span></span> 必为满式。</p>
 </li>
 <li>
  <p style="">要求点 <span class="katex-inline"><span class="katex">
     <math xmlns="http://www.w3.org/1998/Math/MathML">
      <semantics>
       <mrow><mi>u</mi></mrow><annotation encoding="application/x-tex">u</annotation>
      </semantics>
     </math>
    </span></span> 是满式 或 点 <span class="katex-inline"><span class="katex">
     <math xmlns="http://www.w3.org/1998/Math/MathML">
      <semantics>
       <mrow><mi>v</mi></mrow><annotation encoding="application/x-tex">v</annotation>
      </semantics>
     </math>
    </span></span> 是汉式，那么若 <span class="katex-inline"><span class="katex">
     <math xmlns="http://www.w3.org/1998/Math/MathML">
      <semantics>
       <mrow><mi>u</mi></mrow><annotation encoding="application/x-tex">u</annotation>
      </semantics>
     </math>
    </span></span> 为汉式，则 <span class="katex-inline"><span class="katex">
     <math xmlns="http://www.w3.org/1998/Math/MathML">
      <semantics>
       <mrow><mi>v</mi></mrow><annotation encoding="application/x-tex">v</annotation>
      </semantics>
     </math>
    </span></span> 必为汉式；若 <span class="katex-inline"><span class="katex">
     <math xmlns="http://www.w3.org/1998/Math/MathML">
      <semantics>
       <mrow><mi>v</mi></mrow><annotation encoding="application/x-tex">v</annotation>
      </semantics>
     </math>
    </span></span> 为汉式，则 <span class="katex-inline"><span class="katex">
     <math xmlns="http://www.w3.org/1998/Math/MathML">
      <semantics>
       <mrow><mi>u</mi></mrow><annotation encoding="application/x-tex">u</annotation>
      </semantics>
     </math>
    </span></span> 必为满式。</p>
 </li>
 <li>
  <p style="">要求点 <span class="katex-inline"><span class="katex">
     <math xmlns="http://www.w3.org/1998/Math/MathML">
      <semantics>
       <mrow><mi>u</mi></mrow><annotation encoding="application/x-tex">u</annotation>
      </semantics>
     </math>
    </span></span> 是汉式 或 点 <span class="katex-inline"><span class="katex">
     <math xmlns="http://www.w3.org/1998/Math/MathML">
      <semantics>
       <mrow><mi>v</mi></mrow><annotation encoding="application/x-tex">v</annotation>
      </semantics>
     </math>
    </span></span> 是汉式，那么若 <span class="katex-inline"><span class="katex">
     <math xmlns="http://www.w3.org/1998/Math/MathML">
      <semantics>
       <mrow><mi>u</mi></mrow><annotation encoding="application/x-tex">u</annotation>
      </semantics>
     </math>
    </span></span> 为满式，则 <span class="katex-inline"><span class="katex">
     <math xmlns="http://www.w3.org/1998/Math/MathML">
      <semantics>
       <mrow><mi>v</mi></mrow><annotation encoding="application/x-tex">v</annotation>
      </semantics>
     </math>
    </span></span> 必为汉式；若 <span class="katex-inline"><span class="katex">
     <math xmlns="http://www.w3.org/1998/Math/MathML">
      <semantics>
       <mrow><mi>v</mi></mrow><annotation encoding="application/x-tex">v</annotation>
      </semantics>
     </math>
    </span></span> 为满式，则 <span class="katex-inline"><span class="katex">
     <math xmlns="http://www.w3.org/1998/Math/MathML">
      <semantics>
       <mrow><mi>u</mi></mrow><annotation encoding="application/x-tex">u</annotation>
      </semantics>
     </math>
    </span></span> 必为汉式。</p>
 </li>
 <li>
  <p style="">要求点 <span class="katex-inline"><span class="katex">
     <math xmlns="http://www.w3.org/1998/Math/MathML">
      <semantics>
       <mrow><mi>u</mi></mrow><annotation encoding="application/x-tex">u</annotation>
      </semantics>
     </math>
    </span></span> 是汉式 或 点 <span class="katex-inline"><span class="katex">
     <math xmlns="http://www.w3.org/1998/Math/MathML">
      <semantics>
       <mrow><mi>v</mi></mrow><annotation encoding="application/x-tex">v</annotation>
      </semantics>
     </math>
    </span></span> 是满式，那么若 <span class="katex-inline"><span class="katex">
     <math xmlns="http://www.w3.org/1998/Math/MathML">
      <semantics>
       <mrow><mi>u</mi></mrow><annotation encoding="application/x-tex">u</annotation>
      </semantics>
     </math>
    </span></span> 为满式，则 <span class="katex-inline"><span class="katex">
     <math xmlns="http://www.w3.org/1998/Math/MathML">
      <semantics>
       <mrow><mi>v</mi></mrow><annotation encoding="application/x-tex">v</annotation>
      </semantics>
     </math>
    </span></span> 必为满式；若 <span class="katex-inline"><span class="katex">
     <math xmlns="http://www.w3.org/1998/Math/MathML">
      <semantics>
       <mrow><mi>v</mi></mrow><annotation encoding="application/x-tex">v</annotation>
      </semantics>
     </math>
    </span></span> 为汉式，则 <span class="katex-inline"><span class="katex">
     <math xmlns="http://www.w3.org/1998/Math/MathML">
      <semantics>
       <mrow><mi>u</mi></mrow><annotation encoding="application/x-tex">u</annotation>
      </semantics>
     </math>
    </span></span> 必为汉式。</p>
 </li>
</ol>
<h2 style="" id="%E5%BB%BA%E5%9B%BE">建图</h2>
<p style="">从上面的分析，我们可以得出通过特殊建图再跑一边板子2-SAT可以完成这道题。</p>
<pre><code class="language-cpp">for (int i = 1; i &lt;= m; ++i) {
	string Su, Sv;
	cin &gt;&gt; Su &gt;&gt; Sv;
	char op1 = Su[0], op2 = Sv[0];
	int u = 0, v = 0;
	for (int j = 1; j &lt; Su.size(); ++j) u = u * 10 + (Su[j] - '0' + 0);
	for (int j = 1; j &lt; Sv.size(); ++j) v = v * 10 + (Sv[j] - '0' + 0);
	if (op1 == 'm') {
		if (op2 == 'h') add(v, u), add(u + n, v + n); // 第二种情况
		else add(u + n, v), add(v + n, u); // 第一种情况
	} else {
		if (op2 == 'h') add(u, v + n), add(v, u + n); // 第三种情况
		else add(u, v), add(v + n, u + n); // 第四种情况
	}
}</code></pre>
<p style="">恭喜你这道题做完了。</p>
<h2 style="" id="%E5%88%A4%E6%96%ADgood%E8%BF%98%E6%98%AFbad">判断GOOD还是BAD</h2>
<p style="">因为 <span class="katex-inline"><span class="katex">
   <math xmlns="http://www.w3.org/1998/Math/MathML">
    <semantics>
     <mrow><mi>i</mi></mrow><annotation encoding="application/x-tex">i</annotation>
    </semantics>
   </math>
  </span></span> 为满式， <span class="katex-inline"><span class="katex">
   <math xmlns="http://www.w3.org/1998/Math/MathML">
    <semantics>
     <mrow><mi>i</mi><mo>+</mo><mi>n</mi></mrow><annotation encoding="application/x-tex">i + n</annotation>
    </semantics>
   </math>
  </span></span> 为汉式，所有只要判断 <span class="katex-inline"><span class="katex">
   <math xmlns="http://www.w3.org/1998/Math/MathML">
    <semantics>
     <mrow><mi>s</mi><mi>c</mi><mi>c</mi><mo stretchy="false">[</mo><mi>i</mi><mo stretchy="false">]</mo><mo>=</mo><mo>=</mo><mi>s</mi><mi>c</mi><mi>c</mi><mo stretchy="false">[</mo><mi>i</mi><mo>+</mo><mi>n</mi><mo stretchy="false">]</mo></mrow><annotation encoding="application/x-tex">scc[i] == scc[i+n]</annotation>
    </semantics>
   </math>
  </span></span>就可以了，如果相等就不成立，输出 <code>BAD</code> ，反之输出 <code>GOOD</code></p>
<pre><code class="language-cpp">bool flag = true;
for (int i = 1; i &lt;= n; ++i) {
	if (scc[i] == scc[i + n]) {
		flag = false;
		break;
	}
}
cout &lt;&lt; (flag ? "GOOD" :  "BAD") &lt;&lt; "\n";</code></pre>
<h1 style="" id="ac%E4%BB%A3%E7%A0%81">AC代码</h1>
<pre><code class="language-cpp">#include &lt;bits/stdc++.h&gt;
#define ll long long
using namespace std;
const int N = 1000 + 5;
int T;
int n, m;
vector&lt;vector&lt;int&gt;&gt; e;
void add(int u, int v) {
	e[u].emplace_back(v);
}
int tot, cnt;
int dfn[2 * N], low[2 * N], scc[2 * N];
stack&lt;int&gt; q;
bitset&lt;2 * N&gt; vis;
void tarjan(int u) {
	dfn[u] = low[u] = ++tot;
	q.emplace(u);
	vis[u] = true;
	for (auto v : e[u]) {
		if (!dfn[v]) {
			tarjan(v);
			low[u] = min(low[u], low[v]);
		} else if (vis[v]) {
			low[u] = min(low[u], dfn[v]);
		}
	}
	if (low[u] == dfn[u]) {
		++cnt;
		int v;
		do {
			v = q.top(); q.pop();
			vis[v] = false;
			scc[v] = cnt;
		} while(v != u);
	}
}
void init() {
	cnt = tot = 0;
	e.clear();
	e.resize(2 * N);
	stack&lt;int&gt;().swap(q);
	vis.reset();
	for (int i = 1; i &lt;= 2 * n; ++i) {
		dfn[i] = low[i] = scc[i] = 0;
	}
}
int main() {
	ios::sync_with_stdio(0);
	cin.tie(0), cout.tie(0);
	cin &gt;&gt; T;
	while (T--) {
		init();
		cin &gt;&gt; n &gt;&gt; m;
		for (int i = 1; i &lt;= m; ++i) {
			string Su, Sv;
			cin &gt;&gt; Su &gt;&gt; Sv;
			char op1 = Su[0], op2 = Sv[0];
			int u = 0, v = 0;
			for (int j = 1; j &lt; Su.size(); ++j) u = u * 10 + (Su[j] - '0' + 0);
			for (int j = 1; j &lt; Sv.size(); ++j) v = v * 10 + (Sv[j] - '0' + 0);
			if (op1 == 'm') {
				if (op2 == 'h') add(v, u), add(u + n, v + n);
				else add(u + n, v), add(v + n, u);
			} else {
				if (op2 == 'h') add(u, v + n), add(v, u + n);
				else add(u, v), add(v + n, u + n);
			}
		}
		for (int i = 1; i &lt;= 2 * n; ++i) if (!dfn[i]) tarjan(i);
		bool flag = true;
		for (int i = 1; i &lt;= n; ++i) {
			if (scc[i] == scc[i + n]) {
				flag = false;
				break;
			}
		}
		cout &lt;&lt; (flag ? "GOOD" :  "BAD") &lt;&lt; "\n";
	}
	return 0;
}</code></pre>
<p style=""></p>]]></description><guid isPermaLink="false">/archives/1774660003038</guid><dc:creator>PYM</dc:creator><enclosure url="https://pym.plus/apis/api.storage.halo.run/v1alpha1/thumbnails/-/via-uri?uri=%2Fupload%2F%25E6%2589%25B9%25E6%25B3%25A8%25202026-03-28%2520090614.png&amp;size=m" type="image/jpeg" length="115514"/><category>C++</category><category>题解</category><pubDate>Sat, 28 Mar 2026 01:57:49 GMT</pubDate></item><item><title><![CDATA[P1993 小 K 的农场 差分约束SPFA判断负环 详细题解]]></title><link>https://pym.plus/archives/1774615046821</link><description><![CDATA[<img src="https://pym.plus/plugins/feed/assets/telemetry.gif?title=P1993%20%E5%B0%8F%20K%20%E7%9A%84%E5%86%9C%E5%9C%BA%20%E5%B7%AE%E5%88%86%E7%BA%A6%E6%9D%9FSPFA%E5%88%A4%E6%96%AD%E8%B4%9F%E7%8E%AF%20%E8%AF%A6%E7%BB%86%E9%A2%98%E8%A7%A3&amp;url=/archives/1774615046821" width="1" height="1" alt="" style="opacity:0;">
<p style=""><a href="https://www.luogu.com.cn/problem/P1993'" target="_blank" rel="">题目传送门</a></p>
<h1 style="" id="%E9%A2%98%E7%9B%AE%E5%A4%A7%E6%84%8F">题目大意</h1>
<p style="">一共 <span class="katex-inline"><span class="katex">
   <math xmlns="http://www.w3.org/1998/Math/MathML">
    <semantics>
     <mrow><mi>N</mi></mrow><annotation encoding="application/x-tex">N</annotation>
    </semantics>
   </math>
  </span></span> 个点， <span class="katex-inline"><span class="katex">
   <math xmlns="http://www.w3.org/1998/Math/MathML">
    <semantics>
     <mrow><mi>M</mi></mrow><annotation encoding="application/x-tex">M</annotation>
    </semantics>
   </math>
  </span></span> 条边。</p>
<p style="">有 <span class="katex-inline"><span class="katex">
   <math xmlns="http://www.w3.org/1998/Math/MathML">
    <semantics>
     <mrow><mn>3</mn></mrow><annotation encoding="application/x-tex">3</annotation>
    </semantics>
   </math>
  </span></span> 种类型的边：</p>
<ol>
 <li>
  <p style="">单向边：从点 <span class="katex-inline"><span class="katex">
     <math xmlns="http://www.w3.org/1998/Math/MathML">
      <semantics>
       <mrow><mi>i</mi></mrow><annotation encoding="application/x-tex">i</annotation>
      </semantics>
     </math>
    </span></span> 到点 <span class="katex-inline"><span class="katex">
     <math xmlns="http://www.w3.org/1998/Math/MathML">
      <semantics>
       <mrow><mi>j</mi></mrow><annotation encoding="application/x-tex">j</annotation>
      </semantics>
     </math>
    </span></span> 至少有 <span class="katex-inline"><span class="katex">
     <math xmlns="http://www.w3.org/1998/Math/MathML">
      <semantics>
       <mrow><mi>c</mi></mrow><annotation encoding="application/x-tex">c</annotation>
      </semantics>
     </math>
    </span></span>，也就是 <span style="font-family: KaTeX_Math; font-size: 1.21em; line-height: 1.2"><em>a</em></span><span style="font-family: KaTeX_Math; font-size: 0.7em; line-height: 1.2"><em>i</em></span><span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1px; line-height: 1.2">​</span><span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1.21em; line-height: 1.2">−</span><span style="font-family: KaTeX_Math; font-size: 1.21em; line-height: 1.2"><em>a</em></span><span style="font-family: KaTeX_Math; font-size: 0.7em; line-height: 1.2"><em>j</em></span><span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1px; line-height: 1.2">​</span><span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1.21em; line-height: 1.2">≥</span><span style="font-family: KaTeX_Math; font-size: 1.21em; line-height: 1.2"><em>c</em></span></p>
 </li>
 <li>
  <p style="">单向边：从点 <span class="katex-inline"><span class="katex">
     <math xmlns="http://www.w3.org/1998/Math/MathML">
      <semantics>
       <mrow><mi>i</mi></mrow><annotation encoding="application/x-tex">i</annotation>
      </semantics>
     </math>
    </span></span> 到点 <span class="katex-inline"><span class="katex">
     <math xmlns="http://www.w3.org/1998/Math/MathML">
      <semantics>
       <mrow><mi>j</mi></mrow><annotation encoding="application/x-tex">j</annotation>
      </semantics>
     </math>
    </span></span> 至多有 <span class="katex-inline"><span class="katex">
     <math xmlns="http://www.w3.org/1998/Math/MathML">
      <semantics>
       <mrow><mi>c</mi></mrow><annotation encoding="application/x-tex">c</annotation>
      </semantics>
     </math>
    </span></span>，<span style="font-family: KaTeX_Math; font-size: 1.21em; line-height: 1.2"><em>a</em></span><span style="font-family: KaTeX_Math; font-size: 0.7em; line-height: 1.2"><em>i</em></span><span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1px; line-height: 1.2">​</span><span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1.21em; line-height: 1.2">−</span><span style="font-family: KaTeX_Math; font-size: 1.21em; line-height: 1.2"><em>a</em></span><span style="font-family: KaTeX_Math; font-size: 0.7em; line-height: 1.2"><em>j</em></span><span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1px; line-height: 1.2">​</span><span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1.21em; line-height: 1.2">≤</span><span style="font-family: KaTeX_Math; font-size: 1.21em; line-height: 1.2"><em>c</em></span></p>
 </li>
 <li>
  <p style="">双向边：从点 <span class="katex-inline"><span class="katex">
     <math xmlns="http://www.w3.org/1998/Math/MathML">
      <semantics>
       <mrow><mi>i</mi></mrow><annotation encoding="application/x-tex">i</annotation>
      </semantics>
     </math>
    </span></span> 到点 <span class="katex-inline"><span class="katex">
     <math xmlns="http://www.w3.org/1998/Math/MathML">
      <semantics>
       <mrow><mi>j</mi></mrow><annotation encoding="application/x-tex">j</annotation>
      </semantics>
     </math>
    </span></span>一样多，<span style="font-family: KaTeX_Math; font-size: 1.21em; line-height: 1.2"><em>a</em></span><span style="font-family: KaTeX_Math; font-size: 0.7em; line-height: 1.2"><em>i</em></span><span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1px; line-height: 1.2">​</span><span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1.21em; line-height: 1.2">=</span><span style="font-family: KaTeX_Math; font-size: 1.21em; line-height: 1.2"><em>a</em></span><span style="font-family: KaTeX_Math; font-size: 0.7em; line-height: 1.2"><em>j</em></span><span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1px; line-height: 1.2">​</span></p>
 </li>
</ol>
<p style="">
 <br>
 将这 <span class="katex-inline"><span class="katex">
   <math xmlns="http://www.w3.org/1998/Math/MathML">
    <semantics>
     <mrow><mn>3</mn></mrow><annotation encoding="application/x-tex">3</annotation>
    </semantics>
   </math>
  </span></span> 种边转换一下可以得到：
</p>
<ol>
 <li>
  <p style=""><span style="font-family: KaTeX_Math; font-size: 1.21em; line-height: 1.2"><em>a</em></span><span style="font-family: KaTeX_Math; font-size: 0.7em; line-height: 1.2"><em>j</em></span><span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1px; line-height: 1.2">​</span><span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1.21em; line-height: 1.2">≤</span><span style="font-family: KaTeX_Math; font-size: 1.21em; line-height: 1.2"><em>a</em></span><span style="font-family: KaTeX_Math; font-size: 0.7em; line-height: 1.2"><em>i</em></span><span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1px; line-height: 1.2">​</span><span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1.21em; line-height: 1.2">−</span><span style="font-family: KaTeX_Math; font-size: 1.21em; line-height: 1.2"><em>c</em></span></p>
 </li>
 <li>
  <p style=""><span style="font-family: KaTeX_Math; font-size: 1.21em; line-height: 1.2"><em>a</em></span><span style="font-family: KaTeX_Math; font-size: 0.7em; line-height: 1.2"><em>i</em></span><span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1px; line-height: 1.2">​</span><span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1.21em; line-height: 1.2">≤</span><span style="font-family: KaTeX_Math; font-size: 1.21em; line-height: 1.2"><em>a</em></span><span style="font-family: KaTeX_Math; font-size: 0.7em; line-height: 1.2"><em>j</em></span><span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1px; line-height: 1.2">​</span><span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1.21em; line-height: 1.2">+</span><span style="font-family: KaTeX_Math; font-size: 1.21em; line-height: 1.2"><em>c</em></span></p>
 </li>
 <li>
  <p style=""><span style="font-family: KaTeX_Math; font-size: 1.21em; line-height: 1.2"><em>a</em></span><span style="font-family: KaTeX_Math; font-size: 0.7em; line-height: 1.2"><em>i</em></span><span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1px; line-height: 1.2">​</span><span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1.21em; line-height: 1.2">=</span><span style="font-family: KaTeX_Math; font-size: 1.21em; line-height: 1.2"><em>a</em></span><span style="font-family: KaTeX_Math; font-size: 0.7em; line-height: 1.2"><em>j</em></span><span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1px; line-height: 1.2">​</span><span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1.21em; line-height: 1.2">+0</span> 与 <span style="font-family: KaTeX_Math; font-size: 1.21em; line-height: 1.2"><em>a</em></span><span style="font-family: KaTeX_Math; font-size: 0.7em; line-height: 1.2"><em>j</em></span><span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1px; line-height: 1.2">​</span><span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1.21em; line-height: 1.2">=</span><span style="font-family: KaTeX_Math; font-size: 1.21em; line-height: 1.2"><em>a</em></span><span style="font-family: KaTeX_Math; font-size: 0.7em; line-height: 1.2"><em>i</em></span><span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1px; line-height: 1.2">​</span><span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1.21em; line-height: 1.2">+0</span></p>
 </li>
</ol>
<h1 style="" id="%E8%A7%A3%E9%A2%98%E6%80%9D%E8%B7%AF">解题思路</h1>
<h2 style="" id="%E5%88%A4%E6%96%AD%E8%B4%9F%E7%8E%AF">判断负环</h2>
<p style="">如果K的记忆冲突了，那么就说明有负环（小K绕晕了<span data-name="dizzy_face" class="emoji-node" data-type="emoji">😵</span>），输出 <strong>NO</strong></p>
<p style="">如果K的记忆有至少1种情况没有冲突， 那么就说明图中不存在负环，则输出 <strong>YES</strong></p>
<pre><code class="language-cpp">// 判断负环
cnt[v] = cnt[u] + 1;
if (cnt[v] &gt; n) {
	cout &lt;&lt; "No\n"; // 有，就输出NO
	exit(0);
}


// 没有负环，在函数外输出YES
spfa(0);
cout &lt;&lt; "Yes\n";
return 0;</code></pre>
<h2 style="" id="%E5%A4%84%E7%90%86-3-%E7%A7%8D%E8%BE%B9">处理 3 种边</h2>
<p style=""><span class="katex-inline"><span class="katex">
   <math xmlns="http://www.w3.org/1998/Math/MathML">
    <semantics>
     <mrow><mi>c</mi></mrow><annotation encoding="application/x-tex">c</annotation>
    </semantics>
   </math>
  </span></span> 代表从某一点至某一点的边所需的花费。</p>
<p style="">对于第一种，从点 <span class="katex-inline"><span class="katex">
   <math xmlns="http://www.w3.org/1998/Math/MathML">
    <semantics>
     <mrow><mi>i</mi></mrow><annotation encoding="application/x-tex">i</annotation>
    </semantics>
   </math>
  </span></span> 到点 <span class="katex-inline"><span class="katex">
   <math xmlns="http://www.w3.org/1998/Math/MathML">
    <semantics>
     <mrow><mi>j</mi></mrow><annotation encoding="application/x-tex">j</annotation>
    </semantics>
   </math>
  </span></span> <strong>至少</strong>有 <span class="katex-inline"><span class="katex">
   <math xmlns="http://www.w3.org/1998/Math/MathML">
    <semantics>
     <mrow><mi>c</mi></mrow><annotation encoding="application/x-tex">c</annotation>
    </semantics>
   </math>
  </span></span>：</p>
<p style="text-indent: 2em">观察式子 <span style="font-family: KaTeX_Math; font-size: 1.21em; line-height: 1.2"><em>a</em></span><span style="font-family: KaTeX_Math; font-size: 0.7em; line-height: 1.2"><em>j</em></span><span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1px; line-height: 1.2">​</span><span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1.21em; line-height: 1.2">≤</span><span style="font-family: KaTeX_Math; font-size: 1.21em; line-height: 1.2"><em>a</em></span><span style="font-family: KaTeX_Math; font-size: 0.7em; line-height: 1.2"><em>i</em></span><span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1px; line-height: 1.2">​</span><span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1.21em; line-height: 1.2">−</span><span style="font-family: KaTeX_Math; font-size: 1.21em; line-height: 1.2"><em>c </em></span>可得出 从点 <span class="katex-inline"><span class="katex">
   <math xmlns="http://www.w3.org/1998/Math/MathML">
    <semantics>
     <mrow><mi>i</mi></mrow><annotation encoding="application/x-tex">i</annotation>
    </semantics>
   </math>
  </span></span>到点 <span class="katex-inline"><span class="katex">
   <math xmlns="http://www.w3.org/1998/Math/MathML">
    <semantics>
     <mrow><mi>j</mi></mrow><annotation encoding="application/x-tex">j</annotation>
    </semantics>
   </math>
  </span></span> 花费为 <span class="katex-inline"><span class="katex">
   <math xmlns="http://www.w3.org/1998/Math/MathML">
    <semantics>
     <mrow><mo>−</mo><mi>c</mi></mrow><annotation encoding="application/x-tex">-c</annotation>
    </semantics>
   </math>
  </span></span></p>
<p style="text-indent: 2em"></p>
<p style="">对于第二种，从点 <span class="katex-inline"><span class="katex">
   <math xmlns="http://www.w3.org/1998/Math/MathML">
    <semantics>
     <mrow><mi>i</mi></mrow><annotation encoding="application/x-tex">i</annotation>
    </semantics>
   </math>
  </span></span> 到点 <span class="katex-inline"><span class="katex">
   <math xmlns="http://www.w3.org/1998/Math/MathML">
    <semantics>
     <mrow><mi>j</mi></mrow><annotation encoding="application/x-tex">j</annotation>
    </semantics>
   </math>
  </span></span> <strong>至多</strong>有 <span class="katex-inline"><span class="katex">
   <math xmlns="http://www.w3.org/1998/Math/MathML">
    <semantics>
     <mrow><mi>c</mi></mrow><annotation encoding="application/x-tex">c</annotation>
    </semantics>
   </math>
  </span></span>：</p>
<p style="text-indent: 2em">观察式子 <span style="font-family: KaTeX_Math; font-size: 1.21em; line-height: 1.2"><em>a</em></span><span style="font-family: KaTeX_Math; font-size: 0.7em; line-height: 1.2"><em>i</em></span><span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1px; line-height: 1.2">​</span><span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1.21em; line-height: 1.2">≤</span><span style="font-family: KaTeX_Math; font-size: 1.21em; line-height: 1.2"><em>a</em></span><span style="font-family: KaTeX_Math; font-size: 0.7em; line-height: 1.2"><em>j</em></span><span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1px; line-height: 1.2">​</span><span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1.21em; line-height: 1.2">+</span><span style="font-family: KaTeX_Math; font-size: 1.21em; line-height: 1.2"><em>c </em></span>可得出 从点 <span class="katex-inline"><span class="katex">
   <math xmlns="http://www.w3.org/1998/Math/MathML">
    <semantics>
     <mrow><mi>j</mi></mrow><annotation encoding="application/x-tex">j</annotation>
    </semantics>
   </math>
  </span></span>到点 <span class="katex-inline"><span class="katex">
   <math xmlns="http://www.w3.org/1998/Math/MathML">
    <semantics>
     <mrow><mi>i</mi></mrow><annotation encoding="application/x-tex">i</annotation>
    </semantics>
   </math>
  </span></span> 花费为 <span class="katex-inline"><span class="katex">
   <math xmlns="http://www.w3.org/1998/Math/MathML">
    <semantics>
     <mrow><mi>c</mi></mrow><annotation encoding="application/x-tex">c</annotation>
    </semantics>
   </math>
  </span></span></p>
<p style=""></p>
<p style="">对于第三种，从点 <span class="katex-inline"><span class="katex">
   <math xmlns="http://www.w3.org/1998/Math/MathML">
    <semantics>
     <mrow><mi>i</mi></mrow><annotation encoding="application/x-tex">i</annotation>
    </semantics>
   </math>
  </span></span> 到 <span class="katex-inline"><span class="katex">
   <math xmlns="http://www.w3.org/1998/Math/MathML">
    <semantics>
     <mrow><mi>j</mi></mrow><annotation encoding="application/x-tex">j</annotation>
    </semantics>
   </math>
  </span></span> 数量一样，即 <span class="katex-inline"><span class="katex">
   <math xmlns="http://www.w3.org/1998/Math/MathML">
    <semantics>
     <mrow><mi>c</mi></mrow><annotation encoding="application/x-tex">c</annotation>
    </semantics>
   </math>
  </span></span> 为 <span class="katex-inline"><span class="katex">
   <math xmlns="http://www.w3.org/1998/Math/MathML">
    <semantics>
     <mrow><mn>0</mn></mrow><annotation encoding="application/x-tex">0</annotation>
    </semantics>
   </math>
  </span></span>：</p>
<p style="text-indent: 2em">观察式子 <span style="font-family: KaTeX_Math; font-size: 1.21em; line-height: 1.2"><em>a</em></span><span style="font-family: KaTeX_Math; font-size: 0.7em; line-height: 1.2"><em>i</em></span><span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1px; line-height: 1.2">​</span><span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1.21em; line-height: 1.2">=</span><span style="font-family: KaTeX_Math; font-size: 1.21em; line-height: 1.2"><em>a</em></span><span style="font-family: KaTeX_Math; font-size: 0.7em; line-height: 1.2"><em>j</em></span><span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1px; line-height: 1.2">​</span><span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1.21em; line-height: 1.2">+0</span> 与 <span style="font-family: KaTeX_Math; font-size: 1.21em; line-height: 1.2"><em>a</em></span><span style="font-family: KaTeX_Math; font-size: 0.7em; line-height: 1.2"><em>j</em></span><span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1px; line-height: 1.2">​</span><span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1.21em; line-height: 1.2">=</span><span style="font-family: KaTeX_Math; font-size: 1.21em; line-height: 1.2"><em>a</em></span><span style="font-family: KaTeX_Math; font-size: 0.7em; line-height: 1.2"><em>i</em></span><span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1px; line-height: 1.2">​</span><span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1.21em; line-height: 1.2">+0</span><span style="font-family: KaTeX_Math; font-size: 1.21em; line-height: 1.2"><em> </em></span>可得出 从点 <span class="katex-inline"><span class="katex">
   <math xmlns="http://www.w3.org/1998/Math/MathML">
    <semantics>
     <mrow><mi>i</mi><mi mathvariant="normal">/</mi><mi>j</mi></mrow><annotation encoding="application/x-tex">i/j</annotation>
    </semantics>
   </math>
  </span></span>到点 <span class="katex-inline"><span class="katex">
   <math xmlns="http://www.w3.org/1998/Math/MathML">
    <semantics>
     <mrow><mi>i</mi><mi mathvariant="normal">/</mi><mi>j</mi></mrow><annotation encoding="application/x-tex">i/j</annotation>
    </semantics>
   </math>
  </span></span> 花费为 <span class="katex-inline"><span class="katex">
   <math xmlns="http://www.w3.org/1998/Math/MathML">
    <semantics>
     <mrow><mn>0</mn></mrow><annotation encoding="application/x-tex">0</annotation>
    </semantics>
   </math>
  </span></span>，是一条<strong>双向边</strong></p>
<pre><code class="language-cpp">for (int i = 1; i &lt;= m; ++i) {
	int op; cin &gt;&gt; op;
	int u, v, w = 0;
	if (op == 1) {
		cin &gt;&gt; u &gt;&gt; v &gt;&gt; w;
		e[u].emplace_back(v, -w);
	} else if (op == 2) {
		cin &gt;&gt; u &gt;&gt; v &gt;&gt; w;
		e[v].emplace_back(u, w);
	} else {
		cin &gt;&gt; u &gt;&gt; v;
		e[u].emplace_back(v, 0);
		e[v].emplace_back(u, 0);
	}
}</code></pre>
<h2 style="" id="%E8%B6%85%E7%BA%A7%E6%BA%90%E7%82%B9">超级源点</h2>
<p style="">因为题目并没有规定从哪一点出发，且题目需要求解出所有情况来判断</p>
<p style="">因此我们需要一个超级源点来连接所有点，方便求出所有情况</p>
<pre><code class="language-cpp">for (int i = 1; i &lt;= n; ++i) e[0].emplace_back(i, 0);</code></pre>
<h1 style="" id="ac%E4%BB%A3%E7%A0%81">AC代码</h1>
<pre><code class="language-cpp">#include &lt;bits/stdc++.h&gt;
#define ll long long
using namespace std;
const int N = 1e4 + 5;
int n, m;
vector&lt;vector&lt;pair&lt;int, int&gt;&gt;&gt; e(N);
ll dis[N]; // 记录距离
int cnt[N]; // 记录任意点在队列的次数，以便判断负环
bool vis[N]; // 记录任意点是否在队列中
void spfa(int s) { // SPFA板子
	queue&lt;int&gt; q;
	q.emplace(s);
	fill(dis + 1, dis + n + 1, INT_MAX); //SPFA必要的初始化
	vis[s] = true;
	dis[s] = 0; // 从超级源点0出发
	while (!q.empty()) {
		int u = q.front(); q.pop();
		vis[u] = false;
		for (auto tmp : e[u]) { // 适配C++14的写法
			int v, w;
			tie(v, w) = tmp;
			if (dis[v] &gt; dis[u] + w) {
				dis[v] = dis[u] + w;
				cnt[v] = cnt[u] + 1; // 累计点v在队列的次数，因为每个点至多n次，所有如果&gt;n就是有负环
				if (cnt[v] &gt; n) {
					cout &lt;&lt; "No\n"; // 有负环，输出NO
					exit(0); // exit(0)是退出整个程序
				}
				if (!vis[v]) {
					vis[v] = true;
					q.emplace(v);
				}
			}
		}
	}
}
int main() {
	// 输入输出加速
	ios::sync_with_stdio(0);
	cin.tie(0), cout.tie(0);
	cin &gt;&gt; n &gt;&gt; m;
	for (int i = 1; i &lt;= m; ++i) {
		int op; cin &gt;&gt; op;
		int u, v, w = 0;
		if (op == 1) { // 第一种边：农场a比农场b至少多种植了c个单位的作物
			cin &gt;&gt; u &gt;&gt; v &gt;&gt; w;
			e[u].emplace_back(v, -w);
		} else if (op == 2) { // 第二种边：农场a比农场b至多多种植了c个单位的作物
			cin &gt;&gt; u &gt;&gt; v &gt;&gt; w;
			e[v].emplace_back(u, w);
		} else { // 第三种边：农场a终止的数量和b一样多
			cin &gt;&gt; u &gt;&gt; v;
			e[u].emplace_back(v, 0);
			e[v].emplace_back(u, 0);
		}
	}
	for (int i = 1; i &lt;= n; ++i) e[0].emplace_back(i, 0); // 建立超级源点
	spfa(0);
	cout &lt;&lt; "Yes\n"; // 没有负环输出YES
	return 0;
}</code></pre>
<p style=""></p>]]></description><guid isPermaLink="false">/archives/1774615046821</guid><dc:creator>PYM</dc:creator><enclosure url="https://pym.plus/apis/api.storage.halo.run/v1alpha1/thumbnails/-/via-uri?uri=%2Fupload%2F%25E6%2589%25B9%25E6%25B3%25A8%25202026-03-27%2520205712.png&amp;size=m" type="image/jpeg" length="76051"/><category>C++</category><category>题解</category><pubDate>Fri, 27 Mar 2026 13:16:16 GMT</pubDate></item><item><title><![CDATA[P6145 [USACO20FEB] Timeline G SPFA差分约束最长路题解]]></title><link>https://pym.plus/archives/1774438176730</link><description><![CDATA[<img src="https://pym.plus/plugins/feed/assets/telemetry.gif?title=P6145%20%5BUSACO20FEB%5D%20Timeline%20G%20SPFA%E5%B7%AE%E5%88%86%E7%BA%A6%E6%9D%9F%E6%9C%80%E9%95%BF%E8%B7%AF%E9%A2%98%E8%A7%A3&amp;url=/archives/1774438176730" width="1" height="1" alt="" style="opacity:0;">
<p style=""><a href="https://www.luogu.com.cn/problem/P6145" target="_blank" rel="">题目传送门</a></p>
<h1 style="" id="%E9%A2%98%E6%84%8F%E7%AE%80%E8%BF%B0">题意简述</h1>
<p style="">有 <strong>N 次挤奶</strong>，在 <strong>M 天</strong> 内完成，需要求出<strong>每次挤奶的最早可行日期</strong>，同时满足两个硬性约束：</p>
<ol>
 <li>
  <p style=""><strong>基础约束</strong>：第 <code>i</code> 次挤奶的日期 <strong>不能早于第 Sᵢ 天</strong>；</p>
 </li>
 <li>
  <p style=""><strong>时序约束</strong>：给定 C 条规则 <code>(a, b, x)</code>，要求<strong>第 b 次挤奶的日期 ≥ 第 a 次挤奶的日期 + x</strong>（b 比 a 至少晚 x 天）；</p>
 </li>
 <li>
  <p style="">题目保证所有约束无矛盾，一定存在合法方案。</p>
 </li>
</ol>
<h1 style="" id="%E9%A2%98%E7%9B%AE%E6%80%9D%E8%B7%AF">题目思路</h1>
<h2 style="" id="%E6%AD%A5%E9%AA%A4-1%EF%BC%9A%E5%BB%BA%E5%9B%BE">步骤 1：建图</h2>
<p style="">我们引入<strong>超级源点 0</strong>，这样可以让 SPFA 能一次性处理所有规则，不用额外写代码特殊处理。</p>
<p style="">值得注意的是，超级源点 0 到其他点的单向边代价应该是 这个点不早于第 Sᵢ 天挤奶的时间，也就是 <strong>Sᵢ </strong>，不然的话SPFA不会按照限定的时间，可能会提前。</p>
<hr>
<h2 style="" id="%E6%AD%A5%E9%AA%A4-2%EF%BC%9Aspfa-%E5%88%9D%E5%A7%8B%E5%8C%96">步骤 2：SPFA 初始化</h2>
<ol>
 <li>
  <p style="">距离数组 <code>dis[]</code>：<strong>全部初始化为负无穷</strong>（因为我们要求的是最长路）</p>
 </li>
 <li>
  <p style="">超级源点 <code>dis[0] = 0</code></p>
 </li>
 <li>
  <p style="">用队列存储待松弛的节点，初始把节点 <code>0</code> 入队</p>
 </li>
 <li>
  <p style="">标记数组 <code>vis[]</code>：标记节点是否在队列中，避免重复入队</p>
 </li>
</ol>
<hr>
<h2 style="" id="%E6%AD%A5%E9%AA%A4-3%EF%BC%9Aspfa-%E6%9C%80%E9%95%BF%E8%B7%AF%E6%9D%BE%E5%BC%9B">步骤 3：SPFA 最长路松弛</h2>
<p style="">标准 SPFA 流程，但是判断 <code>dis[v]&nbsp;&gt;&nbsp;dis[u]&nbsp;+&nbsp;w</code> 改成 <code>dis[v]&nbsp;&lt;&nbsp;dis[u]&nbsp;+&nbsp;w</code></p>
<hr>
<h2 style="" id="%E6%AD%A5%E9%AA%A4-4%EF%BC%9A%E5%BE%97%E5%88%B0%E7%AD%94%E6%A1%88">步骤 4：得到答案</h2>
<p style="">队列空时，<code>dis[i]</code> 就是第 <code>i</code> 个变量的<strong>最小合法值</strong>（满足所有约束）。</p>
<p style="">然后直接输出就可以了，恭喜你做完了这道题！</p>
<h1 style="" id="ac%E4%BB%A3%E7%A0%81">AC代码</h1>
<pre><code class="language-cpp">#include &lt;bits/stdc++.h&gt;
#define ll long long
using namespace std;
const int N = 1e5 + 5, INF = 1e9 + 7;
int n, m, kk;        // n:挤奶次数 m:总天数 kk:约束条数
int lim[N];          // 存储每次挤奶的最早天数下限
vector&lt;vector&lt;pair&lt;int, int&gt;&gt;&gt; e(N); // 邻接表存图
bool vis[N];         // SPFA标记数组
ll dis[N];           // 存储答案（最长路结果）

int main() {
	ios::sync_with_stdio(0);
	cin.tie(0), cout.tie(0);
	cin &gt;&gt; n &gt;&gt; m &gt;&gt; kk;
	for (int i = 1; i &lt;= n; ++i) cin &gt;&gt; lim[i]; // 读取下限约束
	for (int i = 1; i &lt;= kk; ++i) {
		int u, v, w;
		cin &gt;&gt; u &gt;&gt; v &gt;&gt; w;
		e[u].emplace_back(v, w); // 建约束边：v &gt;= u + w
	}
	for (int i = 1; i &lt;= n; ++i) {
		e[0].emplace_back(i, lim[i]); // 超级源点：满足i &gt;= lim[i]
	}
	fill(dis + 1, dis + n + 1, -INF); // 最长路初始化：负无穷
	vis[0] = true;
	dis[0] = 0;
	queue&lt;int&gt; q;
	q.emplace(0);
	while (!q.empty()) {
		int u = q.front();
		q.pop();
		vis[u] = false;
		for (auto tmp : e[u]) {
			int v, w;
			tie(v, w) = tmp;
			if (dis[v] &lt; dis[u] + w) { // 最长路松弛操作
				dis[v] = dis[u] + w;
				if (!vis[v]) {
					vis[v] = true;
					q.emplace(v);
				}
			}
		}
	}
	for (int i = 1; i &lt;= n; ++i) {
		cout &lt;&lt; dis[i] &lt;&lt; "\n"; // 输出每次挤奶的最早日期
	}
	return 0;
}</code></pre>
<p style=""></p>]]></description><guid isPermaLink="false">/archives/1774438176730</guid><dc:creator>PYM</dc:creator><enclosure url="https://pym.plus/apis/api.storage.halo.run/v1alpha1/thumbnails/-/via-uri?uri=%2Fupload%2F%25E6%2589%25B9%25E6%25B3%25A8%25202026-03-25%2520192758.png&amp;size=m" type="image/jpeg" length="101905"/><category>洛谷</category><category>C++</category><category>题解</category><pubDate>Wed, 25 Mar 2026 11:45:19 GMT</pubDate></item><item><title><![CDATA[Luogu P2850 [USACO06DEC] Wormholes G SPFA算法思路与C++代码详解]]></title><link>https://pym.plus/archives/1774075403607</link><description><![CDATA[<img src="https://pym.plus/plugins/feed/assets/telemetry.gif?title=Luogu%20P2850%20%5BUSACO06DEC%5D%20Wormholes%20G%20SPFA%E7%AE%97%E6%B3%95%E6%80%9D%E8%B7%AF%E4%B8%8EC%2B%2B%E4%BB%A3%E7%A0%81%E8%AF%A6%E8%A7%A3&amp;url=/archives/1774075403607" width="1" height="1" alt="" style="opacity:0;">
<h1 style="" id="%E5%85%88%E6%94%BE%E5%9B%BE">先放图</h1>
<figure data-content-type="image" style="display: flex; flex-direction: column;">
 <img src="https://pym.plus/apis/api.storage.halo.run/v1alpha1/thumbnails/-/via-uri?uri=%2Fupload%2F%25E6%2589%25B9%25E6%25B3%25A8%25202026-03-21%2520144145.png&amp;size=m" alt="批注 2026-03-21 144145.png" width="1222px">
</figure>
<h1 style="" id="%E9%A2%98%E7%9B%AE">题目</h1>
<p style=""><a href="https://www.luogu.com.cn/problem/P2850" target="_blank" rel="">洛谷传送门</a></p>
<h2 style="" id="%E9%A2%98%E7%9B%AE%E8%83%8C%E6%99%AF"><strong>题目背景</strong></h2>
<p style=""><a href="https://www.luogu.com.cn/paste/mxuf6zpl">英文题面见此链接</a></p>
<h2 style="" id="%E9%A2%98%E7%9B%AE%E6%8F%8F%E8%BF%B0"><strong>题目描述</strong></h2>
<p style="">Farmer John 在探索他的农场时发现了许多神奇的虫洞。虫洞的特性非常特殊——它是一个单向通道，能将你传送到它的目的地，而且时间还会回溯到过去！FJ 的每个农场包含 <span style="font-family: KaTeX_Math; font-size: 1.21em; line-height: 1.2"><em>N</em></span><span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1.21em; line-height: 1.2">(1≤</span><span style="font-family: KaTeX_Math; font-size: 1.21em; line-height: 1.2"><em>N</em></span><span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1.21em; line-height: 1.2">≤500)</span> 块编号为 <span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1.21em; line-height: 1.2">1∼</span><span style="font-family: KaTeX_Math; font-size: 1.21em; line-height: 1.2"><em>N</em></span> 的田地、<span style="font-family: KaTeX_Math; font-size: 1.21em; line-height: 1.2"><em>M</em></span><span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1.21em; line-height: 1.2">(1≤</span><span style="font-family: KaTeX_Math; font-size: 1.21em; line-height: 1.2"><em>M</em></span><span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1.21em; line-height: 1.2">≤2500)</span> 条双向路径和 <span style="font-family: KaTeX_Math; font-size: 1.21em; line-height: 1.2"><em>W</em></span><span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1.21em; line-height: 1.2">(1≤</span><span style="font-family: KaTeX_Math; font-size: 1.21em; line-height: 1.2"><em>W</em></span><span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1.21em; line-height: 1.2">≤200)</span> 个虫洞。</p>
<p style="">作为狂热的时间旅行爱好者，FJ 希望实现：从某块田地出发，经过若干路径和虫洞后，在初始离开时间之前回到起点。这样或许他能遇见自己 :)</p>
<p style="">为了判断可行性，FJ 将提供 <span style="font-family: KaTeX_Math; font-size: 1.21em; line-height: 1.2"><em>F</em></span><span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1.21em; line-height: 1.2">(1≤</span><span style="font-family: KaTeX_Math; font-size: 1.21em; line-height: 1.2"><em>F</em></span><span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1.21em; line-height: 1.2">≤5)</span> 个农场的完整地图。所有路径通行耗时不超过 <span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1.21em; line-height: 1.2">10,000</span> 秒，虫洞最多能将 FJ 带回 <span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1.21em; line-height: 1.2">10,000</span> 秒前。</p>
<h2 style="" id="%E8%BE%93%E5%85%A5%E6%A0%BC%E5%BC%8F"><strong>输入格式</strong></h2>
<p style="">第 <span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1.21em; line-height: 1.2">1</span> 行：一个整数 <span style="font-family: KaTeX_Math; font-size: 1.21em; line-height: 1.2"><em>F</em></span>，表示农场数。后续为 <span style="font-family: KaTeX_Math; font-size: 1.21em; line-height: 1.2"><em>F</em></span> 个农场的数据。</p>
<p style="">每个农场：</p>
<ul>
 <li>
  <p style="">第 <span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1.21em; line-height: 1.2">1</span> 行：三个空格分隔的整数 <span style="font-family: KaTeX_Math; font-size: 1.21em; line-height: 1.2"><em>N</em></span>（田地数）, <span style="font-family: KaTeX_Math; font-size: 1.21em; line-height: 1.2"><em>M</em></span>（双向路径数）, <span style="font-family: KaTeX_Math; font-size: 1.21em; line-height: 1.2"><em>W</em></span>（虫洞数）。</p>
 </li>
 <li>
  <p style="">第 <span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1.21em; line-height: 1.2">2∼</span><span style="font-family: KaTeX_Math; font-size: 1.21em; line-height: 1.2"><em>M</em></span><span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1.21em; line-height: 1.2">+1</span> 行：每行三个空格分隔的整数 <span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1.21em; line-height: 1.2">(</span><span style="font-family: KaTeX_Math; font-size: 1.21em; line-height: 1.2"><em>S</em></span><span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1.21em; line-height: 1.2">,</span><span style="font-family: KaTeX_Math; font-size: 1.21em; line-height: 1.2"><em>E</em></span><span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1.21em; line-height: 1.2">,</span><span style="font-family: KaTeX_Math; font-size: 1.21em; line-height: 1.2"><em>T</em></span><span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1.21em; line-height: 1.2">)</span>，表示 <span style="font-family: KaTeX_Math; font-size: 1.21em; line-height: 1.2"><em>S</em></span> 和 <span style="font-family: KaTeX_Math; font-size: 1.21em; line-height: 1.2"><em>E</em></span> 间有一条耗时 <span style="font-family: KaTeX_Math; font-size: 1.21em; line-height: 1.2"><em>T</em></span> 秒的双向路径。两块田地间可能存在多条路径。</p>
 </li>
 <li>
  <p style="">第 <span style="font-family: KaTeX_Math; font-size: 1.21em; line-height: 1.2"><em>M</em></span><span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1.21em; line-height: 1.2">+2∼</span><span style="font-family: KaTeX_Math; font-size: 1.21em; line-height: 1.2"><em>M</em></span><span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1.21em; line-height: 1.2">+</span><span style="font-family: KaTeX_Math; font-size: 1.21em; line-height: 1.2"><em>W</em></span><span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1.21em; line-height: 1.2">+1</span> 行：每行三个空格分隔的整数 <span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1.21em; line-height: 1.2">(</span><span style="font-family: KaTeX_Math; font-size: 1.21em; line-height: 1.2"><em>S</em></span><span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1.21em; line-height: 1.2">,</span><span style="font-family: KaTeX_Math; font-size: 1.21em; line-height: 1.2"><em>E</em></span><span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1.21em; line-height: 1.2">,</span><span style="font-family: KaTeX_Math; font-size: 1.21em; line-height: 1.2"><em>T</em></span><span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1.21em; line-height: 1.2">)</span>，表示一条从 <span style="font-family: KaTeX_Math; font-size: 1.21em; line-height: 1.2"><em>S</em></span> 到 <span style="font-family: KaTeX_Math; font-size: 1.21em; line-height: 1.2"><em>E</em></span> 的单向虫洞，可将 FJ 带回 <span style="font-family: KaTeX_Math; font-size: 1.21em; line-height: 1.2"><em>T</em></span> 秒前。</p>
 </li>
</ul>
<h2 style="" id="%E8%BE%93%E5%87%BA%E6%A0%BC%E5%BC%8F"><strong>输出格式</strong></h2>
<p style="">输出 <span style="font-family: KaTeX_Math; font-size: 1.21em; line-height: 1.2"><em>F</em></span> 行：对每个农场，若 FJ 能达成目标输出<code>YES</code>，否则输出<code>NO</code>。</p>
<h2 style="" id="%E8%BE%93%E5%85%A5%E8%BE%93%E5%87%BA%E6%A0%B7%E4%BE%8B"><strong>输入输出样例</strong></h2>
<p style=""><strong>输入 #1</strong></p>
<pre><code>2
3 3 1
1 2 2
1 3 4
2 3 1
3 1 3
3 2 1
1 2 3
2 3 4
3 1 8</code></pre>
<p style=""><strong>输出 #1</strong></p>
<pre><code>NO
YES</code></pre>
<h2 style="" id="%E8%AF%B4%E6%98%8E%2F%E6%8F%90%E7%A4%BA"><strong>说明/提示</strong></h2>
<ul>
 <li>
  <p style="">农场 <span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1.21em; line-height: 1.2">1</span>：FJ 无法实现时间回溯。</p>
 </li>
 <li>
  <p style="">农场 <span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1.21em; line-height: 1.2">2</span>：FJ 可通过环 <span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1.21em; line-height: 1.2">1→2→3→1</span> 回到起点 <span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1.21em; line-height: 1.2">1</span> 秒前（可从环上任意点出发实现）。</p>
 </li>
</ul>
<p style="">翻译：DeepSeek-R1</p>
<h1 style="" id="%E6%80%9D%E8%B7%AF">思路</h1>
<h2 style="" id="%E9%A2%98%E7%9B%AE%E8%A7%A3%E6%9E%90">题目解析</h2>
<p style="">这是一道SPFA板子题，题目大意可以理解为：</p>
<ul>
 <li>
  <p style="">有 <span class="katex-inline"><span class="katex">
     <math xmlns="http://www.w3.org/1998/Math/MathML">
      <semantics>
       <mrow><mi>N</mi></mrow><annotation encoding="application/x-tex">N</annotation>
      </semantics>
     </math>
    </span></span>个点</p>
 </li>
 <li>
  <p style="">有 <span class="katex-inline"><span class="katex">
     <math xmlns="http://www.w3.org/1998/Math/MathML">
      <semantics>
       <mrow><mi>M</mi></mrow><annotation encoding="application/x-tex">M</annotation>
      </semantics>
     </math>
    </span></span>条双向边，经过会增加时间</p>
 </li>
 <li>
  <p style="">有 <span class="katex-inline"><span class="katex">
     <math xmlns="http://www.w3.org/1998/Math/MathML">
      <semantics>
       <mrow><mi>W</mi></mrow><annotation encoding="application/x-tex">W</annotation>
      </semantics>
     </math>
    </span></span>条单向边，经过可以减少时间（<s>穿越了</s>）</p>
 </li>
</ul>
<p style="">然后这是一道多组测试数据的题，有 <span class="katex-inline"><span class="katex">
   <math xmlns="http://www.w3.org/1998/Math/MathML">
    <semantics>
     <mrow><mi>F</mi></mrow><annotation encoding="application/x-tex">F</annotation>
    </semantics>
   </math>
  </span></span>组数据</p>
<p style="">题目需要你求出，从任意一点出发，会不会遇到负环（因为有负环，所以FJ可以回到起点），有就输出 <code>YES</code> ，没有也就是FJ没法回到起点，输出 <code>NO</code></p>
<p style=""></p>
<h2 style="" id="%E4%BB%A3%E7%A0%81%E6%9E%84%E6%80%9D">代码构思</h2>
<p style="">首先注意到我们可以从任意点出发，所以我们需要建一个 <strong>超级源点</strong>， 有了超级源点后，我们跑SPFA从超级源点出发，这样就可以到达所有点，避免了跑很多遍SPFA来求最优解。那么超级源点是什么呢？就是一个点，比如点0，连接了其他所有点，然后每条连接的边都是单向边，且花费为0，这里我们搭配图片理解：</p>
<figure style="align-items: center; display: flex; flex-direction: column" data-content-type="image">
 <img src="https://pym.plus/apis/api.storage.halo.run/v1alpha1/thumbnails/-/via-uri?uri=%2Fupload%2F%25E6%2589%25B9%25E6%25B3%25A8%25202026-03-21%2520150905.png&amp;size=m" width="326px">
</figure>
<p style="">然后就是SPFA求负环的板子了，不知道SPFA怎么求负环的可以看看<a href="https://pym.plus/archives/1774059454871" target="_blank" rel="">这篇文章</a>，里面有讲SPFA如何求负环，那么最终代码如下：</p>
<pre><code class="language-cpp">#include &lt;bits/stdc++.h&gt;
#define ll long long
using namespace std;
const int N = 500 + 5;
int T;
int n, m, mm;
vector&lt;vector&lt;pair&lt;int, int&gt;&gt;&gt; e; // 奇葩STL，不喜欢可以写结构体，会麻烦点
ll dis[N]; // 没啥用的距离数组，辅助求负环
bool vis[N]; // 标记任意点是否在队列中
int cnt[N]; // 标记任意点的使用次数，用来求负环
bool spfa() {
	// 初始化
	fill(dis + 1, dis + n + 1, INT_MAX);
	fill(cnt + 1, cnt + n + 1, 0);
	fill(vis + 1, vis + n + 1, false);
	queue&lt;int&gt; q;
	q.emplace(0);
	dis[0] = 0;
	vis[0] = true;

	// SPFA板子
	while (!q.empty()) {
		int u = q.front(); q.pop();
		vis[u] = false;
		for (auto tmp : e[u]) { // 适配C++14的写法
			int v, w;
			tie(v, w) = tmp;
			if (dis[v] &gt; dis[u] + w) {
				dis[v] = dis[u] + w;
				cnt[v] = cnt[u] + 1; // 求负环
				if (cnt[v] &gt; n) return false; // 多了一个超级源点，所以是大于n，有负环
				if (!vis[v]) {
					vis[v] = true;
					q.emplace(v);
				}
			}
		}
	}
	return true; //没有负环
}
int main() {
	ios::sync_with_stdio(0);
	cin.tie(0), cout.tie(0);
	cin &gt;&gt; T;
	while (T--) {
		// 因为有多组数据，每次e数组清空，然后重设大小
		e.clear();
		e.resize(N);
		cin &gt;&gt; n &gt;&gt; m &gt;&gt; mm;
		for (int i = 1; i &lt;= m; ++i) {
			int u, v, w;
			cin &gt;&gt; u &gt;&gt; v &gt;&gt; w; // 输入普通的双向边
			e[u].emplace_back(v, w);
			e[v].emplace_back(u, w);
		}
		for (int i = 1; i &lt;= mm; ++i) {
			int u, v, w;
			cin &gt;&gt; u &gt;&gt; v &gt;&gt; w; // 输入虫洞
			e[u].emplace_back(v, -w);
		}
		
		// 超级源点
		for (int i = 1; i &lt;= n; ++i) {
			e[0].emplace_back(i, 0); // 建立单向边，将0指向其他所有点，且花费为0
		}
		cout &lt;&lt; (spfa() ? "NO" : "YES") &lt;&lt; "\n"; // 有负环就是可以回到起点，输出YES，否则是NO
	}
	return 0;
}</code></pre>
<p style=""></p>]]></description><guid isPermaLink="false">/archives/1774075403607</guid><dc:creator>PYM</dc:creator><enclosure url="https://pym.plus/apis/api.storage.halo.run/v1alpha1/thumbnails/-/via-uri?uri=%2Fupload%2F%25E6%2589%25B9%25E6%25B3%25A8%25202026-03-21%2520144145.png&amp;size=m" type="image/jpeg" length="32634"/><category>C++</category><category>题解</category><pubDate>Sat, 21 Mar 2026 07:18:25 GMT</pubDate></item><item><title><![CDATA[Luogu P2136 拉近距离 SPFA判断负环题解 与 思路]]></title><link>https://pym.plus/archives/1774059454871</link><description><![CDATA[<img src="https://pym.plus/plugins/feed/assets/telemetry.gif?title=Luogu%20P2136%20%E6%8B%89%E8%BF%91%E8%B7%9D%E7%A6%BB%20SPFA%E5%88%A4%E6%96%AD%E8%B4%9F%E7%8E%AF%E9%A2%98%E8%A7%A3%20%E4%B8%8E%20%E6%80%9D%E8%B7%AF&amp;url=/archives/1774059454871" width="1" height="1" alt="" style="opacity:0;">
<h1 style="" id="%E9%A2%98%E7%9B%AE">题目</h1>
<p style=""><a href="https://www.luogu.com.cn/problem/P2136" target="_blank" rel="">Luogu P2136</a></p>
<h2 style="" id="%E9%A2%98%E7%9B%AE%E8%83%8C%E6%99%AF"><strong>题目背景</strong></h2>
<p style="">我是源点，你是终点。我们之间有负权环。 ——小明</p>
<h2 style="" id="%E9%A2%98%E7%9B%AE%E6%8F%8F%E8%BF%B0"><strong>题目描述</strong></h2>
<p style="">在小明和小红的生活中，有 <span style="font-family: KaTeX_Math; font-size: 1.21em; line-height: 1.2"><em>N</em></span> 个关键的节点。有 <span style="font-family: KaTeX_Math; font-size: 1.21em; line-height: 1.2"><em>M</em></span> 个事件，记为一个三元组 <span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1.21em; line-height: 1.2">(</span><span style="font-family: KaTeX_Math; font-size: 1.21em; line-height: 1.2"><em>S</em></span><span style="font-family: KaTeX_Math; font-size: 0.7em; line-height: 1.2"><em>i</em></span><span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1px; line-height: 1.2">​</span><span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1.21em; line-height: 1.2">,</span><span style="font-family: KaTeX_Math; font-size: 1.21em; line-height: 1.2"><em>T</em></span><span style="font-family: KaTeX_Math; font-size: 0.7em; line-height: 1.2"><em>i</em></span><span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1px; line-height: 1.2">​</span><span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1.21em; line-height: 1.2">,</span><span style="font-family: KaTeX_Math; font-size: 1.21em; line-height: 1.2"><em>W</em></span><span style="font-family: KaTeX_Math; font-size: 0.7em; line-height: 1.2"><em>i</em></span><span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1px; line-height: 1.2">​</span><span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1.21em; line-height: 1.2">)</span>，表示从节点 <span style="font-family: KaTeX_Math; font-size: 1.21em; line-height: 1.2"><em>S</em></span><span style="font-family: KaTeX_Math; font-size: 0.7em; line-height: 1.2"><em>i</em></span><span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1px; line-height: 1.2">​</span> 有一个事件可以转移到 <span style="font-family: KaTeX_Math; font-size: 1.21em; line-height: 1.2"><em>T</em></span><span style="font-family: KaTeX_Math; font-size: 0.7em; line-height: 1.2"><em>i</em></span><span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1px; line-height: 1.2">​</span>，事件的效果就是使他们之间的距离减少 <span style="font-family: KaTeX_Math; font-size: 1.21em; line-height: 1.2"><em>W</em></span><span style="font-family: KaTeX_Math; font-size: 0.7em; line-height: 1.2"><em>i</em></span><span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1px; line-height: 1.2">​</span>。</p>
<p style="">这些节点构成了一个网络，其中节点 <span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1.21em; line-height: 1.2">1</span> 和 <span style="font-family: KaTeX_Math; font-size: 1.21em; line-height: 1.2"><em>N</em></span> 是特殊的，节点 <span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1.21em; line-height: 1.2">1</span> 代表小明，节点 <span style="font-family: KaTeX_Math; font-size: 1.21em; line-height: 1.2"><em>N</em></span> 代表小红，其他代表进展的阶段。所有事件可以自由选择是否进行，但每次只能进行当前节点邻接的。请你帮他们写一个程序，计算出他们之间可能的最短距离。</p>
<h2 style="" id="%E8%BE%93%E5%85%A5%E6%A0%BC%E5%BC%8F"><strong>输入格式</strong></h2>
<p style="">第一行，两个正整数 <span style="font-family: KaTeX_Math; font-size: 1.21em; line-height: 1.2"><em>N</em></span><span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1.21em; line-height: 1.2">,</span><span style="font-family: KaTeX_Math; font-size: 1.21em; line-height: 1.2"><em>M</em></span>。</p>
<p style="">之后 <span style="font-family: KaTeX_Math; font-size: 1.21em; line-height: 1.2"><em>M</em></span> 行，每行 <span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1.21em; line-height: 1.2">3</span> 个空格隔开的整数 <span style="font-family: KaTeX_Math; font-size: 1.21em; line-height: 1.2"><em>S</em></span><span style="font-family: KaTeX_Math; font-size: 0.7em; line-height: 1.2"><em>i</em></span><span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1px; line-height: 1.2">​</span><span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1.21em; line-height: 1.2">,</span><span style="font-family: KaTeX_Math; font-size: 1.21em; line-height: 1.2"><em>T</em></span><span style="font-family: KaTeX_Math; font-size: 0.7em; line-height: 1.2"><em>i</em></span><span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1px; line-height: 1.2">​</span><span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1.21em; line-height: 1.2">,</span><span style="font-family: KaTeX_Math; font-size: 1.21em; line-height: 1.2"><em>W</em></span><span style="font-family: KaTeX_Math; font-size: 0.7em; line-height: 1.2"><em>i</em></span><span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1px; line-height: 1.2">​</span>。</p>
<h2 style="" id="%E8%BE%93%E5%87%BA%E6%A0%BC%E5%BC%8F"><strong>输出格式</strong></h2>
<p style="">一行，一个整数表示他们之间可能的最短距离。如果这个距离可以无限缩小，输出<code>Forever love</code>。</p>
<h2 style="" id="%E8%BE%93%E5%85%A5%E8%BE%93%E5%87%BA%E6%A0%B7%E4%BE%8B"><strong>输入输出样例</strong></h2>
<p style=""><strong>输入 #1</strong></p>
<pre><code>3 3
1 2 3
2 3 -1
3 1 -10</code></pre>
<p style=""><strong>输出 #1</strong></p>
<pre><code>-2</code></pre>
<h2 style="" id="%E8%AF%B4%E6%98%8E%2F%E6%8F%90%E7%A4%BA"><strong>说明/提示</strong></h2>
<p style="">对于 <span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1.21em; line-height: 1.2">20%</span> 数据，<span style="font-family: KaTeX_Math; font-size: 1.21em; line-height: 1.2"><em>N</em></span><span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1.21em; line-height: 1.2">≤10</span>，<span style="font-family: KaTeX_Math; font-size: 1.21em; line-height: 1.2"><em>M</em></span><span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1.21em; line-height: 1.2">≤50</span>。</p>
<p style="">对于 <span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1.21em; line-height: 1.2">50%</span> 数据，<span style="font-family: KaTeX_Math; font-size: 1.21em; line-height: 1.2"><em>N</em></span><span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1.21em; line-height: 1.2">≤300</span>，<span style="font-family: KaTeX_Math; font-size: 1.21em; line-height: 1.2"><em>M</em></span><span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1.21em; line-height: 1.2">≤5000</span>。</p>
<p style="">对于 <span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1.21em; line-height: 1.2">100%</span> 数据，<span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1.21em; line-height: 1.2">1≤</span><span style="font-family: KaTeX_Math; font-size: 1.21em; line-height: 1.2"><em>N</em></span><span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1.21em; line-height: 1.2">≤10</span><span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 0.7em; line-height: 1.2">3</span>，<span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1.21em; line-height: 1.2">1≤</span><span style="font-family: KaTeX_Math; font-size: 1.21em; line-height: 1.2"><em>M</em></span><span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1.21em; line-height: 1.2">≤10</span><span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 0.7em; line-height: 1.2">4</span>，<span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1.21em; line-height: 1.2">∣</span><span style="font-family: KaTeX_Math; font-size: 1.21em; line-height: 1.2"><em>W</em></span><span style="font-family: KaTeX_Math; font-size: 0.7em; line-height: 1.2"><em>i</em></span><span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1px; line-height: 1.2">​</span><span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1.21em; line-height: 1.2">∣≤100</span>，保证从节点 <span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1.21em; line-height: 1.2">1</span> 到 <span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1.21em; line-height: 1.2">2…</span><span style="font-family: KaTeX_Math; font-size: 1.21em; line-height: 1.2"><em>N</em></span> 有路径，从节点 <span style="font-family: KaTeX_Math; font-size: 1.21em; line-height: 1.2"><em>N</em></span> 到 <span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1.21em; line-height: 1.2">1…</span><span style="font-family: KaTeX_Math; font-size: 1.21em; line-height: 1.2"><em>N</em></span><span style="font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif; font-size: 1.21em; line-height: 1.2">−1</span> 有路径。</p>
<h1 style="" id="%E6%80%9D%E8%B7%AF">思路</h1>
<p style="">这道题很显然是一道单源最短路的题目，通过观察题目，我们可以得出以下信息：</p>
<ul>
 <li>
  <p style="">是单向图</p>
 </li>
 <li>
  <p style="">计算的是小红与小明之间的最短距离，这意味着可以是小红到小明，也可以是小明到小红</p>
 </li>
 <li>
  <p style="">题目有明显的负环，需要输出 <code>Forever love</code></p>
 </li>
 <li>
  <p style="">题目中的边权不是相加是相减，为了避免麻烦改代码，可以对边权取反来建图。</p>
 </li>
</ul>
<p style="">那么这道题是非常良心的<span data-name="+1" class="emoji-node" data-type="emoji">👍</span>，出题人没有卡SPFA，所以我们使用SPFA来求解。</p>
<p style="">对于SPFA来找负环，可以建立一个 <span class="katex-inline"><span class="katex">
   <math xmlns="http://www.w3.org/1998/Math/MathML">
    <semantics>
     <mrow><mi>c</mi><mi>n</mi><mi>t</mi></mrow><annotation encoding="application/x-tex">cnt</annotation>
    </semantics>
   </math>
  </span></span> 数组，我们定义 𝑐𝑛𝑡[𝑖] 表示点 𝑖 距离源点经过的边数 每次 𝑖 → 𝑗 转移的时候 𝑐𝑛𝑡[𝑗] = 𝑐𝑛𝑡[𝑖] + 1 如果有点的 𝑐𝑛𝑡 大于等于 𝑛 时说明有负环，就直接输出 <code>Forever love</code></p>
<p style="">多说无益，我们看代码：</p>
<pre><code class="language-cpp">#include &lt;bits/stdc++.h&gt;
#define ll long long
using namespace std;
// N是数组大小，INF用来给dis赋初始值，即极大值
const int N = 1000 + 5, INF = 100000000;
int n, m;
vector&lt;vector&lt;pair&lt;int, int&gt;&gt;&gt; e(N); // 比较奇葩的STL写法，不喜欢的可以写结构体
ll dis[N]; // 记录从起点到任意点的最短距离的数组
bool vis[N]; // 判断任意点是否在队列中
int cnt[N]; // 记录任意点的出队次数，用来判断负环
void spfa(int s) {
	// SPFA的初始化
	fill(dis + 1, dis + n + 1, INF); 
	fill(vis + 1, vis + n + 1, false);
	fill(cnt + 1, cnt + n + 1, 0);
	dis[s] = 0, vis[s] = true;
	queue&lt;int&gt; q;
	q.emplace(s);
	
	// SPFA
	while (!q.empty()) {
		int u = q.front();
		q.pop();
		vis[u] = false; // 标记点u不在队列中了
		for (pair&lt;int, int&gt; tmp : e[u]) { //适配C++14的写法
			int v, w;
			tie(v, w) = tmp;
			if (dis[v] &gt; dis[u] + w) {
				dis[v] = dis[u] + w;
				cnt[v] = cnt[u] + 1; // 找负环
				if (cnt[v] &gt;= n) {
					cout &lt;&lt; "Forever love\n"; // 有负环
					exit(0);
				}
				if (!vis[v]) {
					vis[v] = true; // 点v在队列中了
					q.emplace(v); // 把点v加入队列
				}
			}
		}
	}
}
int main() {
	ios::sync_with_stdio(0);
	cin.tie(0), cout.tie(0);
	cin &gt;&gt; n &gt;&gt; m;
	for (int i = 1; i &lt;= m; ++i) {
		int u, v, w;
		cin &gt;&gt; u &gt;&gt; v &gt;&gt; w;
		e[u].emplace_back(v, -w); // 对边权取反，方便处理
	}
	spfa(1); // 从小明到小红
	ll ans1 = dis[n];
	spfa(n); // 从小红到小明
	ll ans2 = dis[1];
	cout &lt;&lt; min(ans1, ans2) &lt;&lt; "\n"; // 对两个答案取较小值
	return 0;
}</code></pre>
<p style=""></p>
<p style="">代码提交结果如下：</p>
<figure data-content-type="image" style="display: flex; flex-direction: column;">
 <img src="https://pym.plus/apis/api.storage.halo.run/v1alpha1/thumbnails/-/via-uri?uri=%2Fupload%2F%25E6%2589%25B9%25E6%25B3%25A8%25202026-03-21%2520103233.png&amp;size=m" width="1222px">
</figure>
<p style=""></p>]]></description><guid isPermaLink="false">/archives/1774059454871</guid><dc:creator>PYM</dc:creator><enclosure url="https://pym.plus/apis/api.storage.halo.run/v1alpha1/thumbnails/-/via-uri?uri=%2Fupload%2F%25E6%2589%25B9%25E6%25B3%25A8%25202026-03-21%2520102012.png&amp;size=m" type="image/jpeg" length="77169"/><category>C++</category><category>题解</category><pubDate>Sat, 21 Mar 2026 03:00:46 GMT</pubDate></item><item><title><![CDATA[开源 UI 元素社区库，让你的网站更加美观！]]></title><link>https://pym.plus/archives/1774005790198</link><description><![CDATA[<img src="https://pym.plus/plugins/feed/assets/telemetry.gif?title=%E5%BC%80%E6%BA%90%20UI%20%E5%85%83%E7%B4%A0%E7%A4%BE%E5%8C%BA%E5%BA%93%EF%BC%8C%E8%AE%A9%E4%BD%A0%E7%9A%84%E7%BD%91%E7%AB%99%E6%9B%B4%E5%8A%A0%E7%BE%8E%E8%A7%82%EF%BC%81&amp;url=/archives/1774005790198" width="1" height="1" alt="" style="opacity:0;">
<p style="">uiverse.io：<a href="https://uiverse.io/elements" target="_blank" rel="">网站链接</a></p>
<p style="">uiverse.io 是全球规模较大的<strong>开源 UI 元素社区库</strong>，由全球开发者与设计师共建，全部基于<strong>纯 CSS 或 Tailwind CSS</strong> 实现，<strong>免费可商用</strong>（MIT 协议）</p>
<p style="">有需求的小伙伴可以看看，里面的东西还是很高质量的！</p>
<p style=""></p>]]></description><guid isPermaLink="false">/archives/1774005790198</guid><dc:creator>PYM</dc:creator><enclosure url="https://pym.plus/apis/api.storage.halo.run/v1alpha1/thumbnails/-/via-uri?uri=%2Fupload%2F%25E6%2589%25B9%25E6%25B3%25A8%25202026-03-20%2520192645.png&amp;size=m" type="image/jpeg" length="11122"/><category>开发</category><category>css</category><pubDate>Fri, 20 Mar 2026 11:28:32 GMT</pubDate></item><item><title><![CDATA[免费的AI和付费的API区别到底在哪里？付费的AI真的更聪明吗？]]></title><link>https://pym.plus/archives/1773721817520</link><description><![CDATA[<img src="https://pym.plus/plugins/feed/assets/telemetry.gif?title=%E5%85%8D%E8%B4%B9%E7%9A%84AI%E5%92%8C%E4%BB%98%E8%B4%B9%E7%9A%84API%E5%8C%BA%E5%88%AB%E5%88%B0%E5%BA%95%E5%9C%A8%E5%93%AA%E9%87%8C%EF%BC%9F%E4%BB%98%E8%B4%B9%E7%9A%84AI%E7%9C%9F%E7%9A%84%E6%9B%B4%E8%81%AA%E6%98%8E%E5%90%97%EF%BC%9F&amp;url=/archives/1773721817520" width="1" height="1" alt="" style="opacity:0;">
<h1 style="" id="%E5%8F%A0%E7%94%B2">叠甲</h1>
<p style="">本文并不针对任何一个AI，文中的免费AI，付费AI也不代指或暗指任何一个AI。</p>
<p style="">本文属于个人观点。</p>
<h1 style="" id="%E5%89%8D%E8%A8%80">前言</h1>
<p style="">不知道大家有没有感觉，在使用一个免费AI回答某个问题时，如果对话的篇幅很长，你会感觉这个AI越来越笨笨的了。或者，你问免费的AI它是什么模型，它通常不会告诉你它是什么模型，只会说是XXX公司的XX AI。而付费的AI（以付费API为例）的，你问它是什么模型，它是会告诉你的，且对话篇幅很长不会出现变笨了的感觉，<s>只是感觉钱包空空了</s></p>
<h1 style="" id="%E5%8C%BA%E5%88%AB">区别</h1>
<h2 style="" id="%E5%85%8D%E8%B4%B9%E7%9A%84ai">免费的AI</h2>
<p style="">免费的AI通常有3大限制：</p>
<ol>
 <li>
  <p style="">限流，限定时间内提问过快过多，AI可能就不会理你了</p>
 </li>
 <li>
  <p style="">自己会切模型，问多了，因为考虑到成本，你用的ProAI可能就变成了LiteAI或者MiniAI，能力瞬间下降，这也是为什么用免费AI解决不了某个问题时，开个新对话，或者等会再问，AI可能就变聪明了</p>
 </li>
 <li>
  <p style="">提问内容的限制，官网的一些免费AI远比它的付费版本，内容限制多得多</p>
 </li>
</ol>
<h2 style="" id="%E4%BB%98%E8%B4%B9%E7%9A%84ai">付费的AI</h2>
<p style="">提到付费的AI，大家可能首先想到的就是XXX套餐或者XXX会员，但是我这里想讲的是AI的付费API</p>
<p style="">这种给AI掏钱买API用的方式与免费的通常有2个区别：</p>
<ol>
 <li>
  <p style="">不限流，你余额还有钱就可以稳定输出</p>
 </li>
 <li>
  <p style="">可以指定使用什么模型，不会遇到变笨的情况</p>
 </li>
</ol>
<h1 style="" id="%E6%80%BB%E7%BB%93">总结</h1>
<p style="">总结一下，付费的AI，无论是XX套餐或者会员，还是它的付费API的形式，并不是比免费的AI多聪明多少，而是能一直稳定，按照你需求的质量输出。</p>
<p style="">至于大家是需要付费的AI，还是免费的AI，就看个人需求了。</p>]]></description><guid isPermaLink="false">/archives/1773721817520</guid><dc:creator>PYM</dc:creator><enclosure url="https://pym.plus/apis/api.storage.halo.run/v1alpha1/thumbnails/-/via-uri?uri=%2Fupload%2Fth.jfif&amp;size=m" type="image/jpeg" length="7365"/><category>AI</category><pubDate>Tue, 17 Mar 2026 04:44:17 GMT</pubDate></item><item><title><![CDATA[每个月900万免费Tokens的AI，书生大模型！]]></title><link>https://pym.plus/archives/1773452396154</link><description><![CDATA[<img src="https://pym.plus/plugins/feed/assets/telemetry.gif?title=%E6%AF%8F%E4%B8%AA%E6%9C%88900%E4%B8%87%E5%85%8D%E8%B4%B9Tokens%E7%9A%84AI%EF%BC%8C%E4%B9%A6%E7%94%9F%E5%A4%A7%E6%A8%A1%E5%9E%8B%EF%BC%81&amp;url=/archives/1773452396154" width="1" height="1" alt="" style="opacity:0;">
<h1 style="" id="%E5%89%8D%E8%A8%80">前言</h1>
<p style="">前些天在网上找免费API的AI，找到了<hyperlink-inline-card target="_blank" href="https://chat.intern-ai.org.cn/models" theme="inline"><a href="https://chat.intern-ai.org.cn/models" target="_blank">https://chat.intern-ai.org.cn/models</a></hyperlink-inline-card>，据说这个AI的Intern-S1-Pro模型参数高达968B，最最最关键的是：
 <br>
 普通用户注册后有免费的额度，每个月都有</p>
<p style=""><span style="color: rgb(18, 19, 22); font-size: 20px; line-height: 30px"><strong>9,000,000</strong></span><span style="color: rgba(18, 19, 22, 0.8); font-size: 12px; line-height: 18px">input tokens/月</span></p>
<p style=""><span style="color: rgb(18, 19, 22); font-size: 20px; line-height: 30px"><strong>3,000,000</strong></span><span style="color: rgba(18, 19, 22, 0.8); font-size: 12px; line-height: 18px">output tokens/月</span></p>
<h1 style="" id="%E8%8E%B7%E5%8F%96api-key">获取API Key</h1>
<p style="">在<a href="https://internlm.intern-ai.org.cn/api/tokens" target="_blank" rel="">https://internlm.intern-ai.org.cn/api/tokens</a>获取，需要手机号注册，注册后可以直接创建API Key，但是每6个月需要更换，否则会失效。</p>
<figure data-content-type="image" style="display: flex; flex-direction: column;">
 <img src="https://pym.plus/apis/api.storage.halo.run/v1alpha1/thumbnails/-/via-uri?uri=%2Fupload%2Fyq202314.png&amp;size=m" width="1040px">
</figure>
<h1 style="" id="%E7%94%B3%E8%AF%B7%E6%9B%B4%E9%AB%98%E9%99%90%E6%B5%81">申请更高限流</h1>
<p style="">
 <br>
 默认是限制每分钟只能调用30次，每分钟最大50000Tokens，但是可以在<a href="https://internlm.intern-ai.org.cn/api/strategy" target="_blank" rel="">https://internlm.intern-ai.org.cn/api/strategy</a>申请更高限流
 <br>
 我目前申请到了每分钟60次，最大300000Tokens。
</p>
<figure style="align-items: start; display: flex; flex-direction: column" data-content-type="image">
 <img src="https://pym.plus/apis/api.storage.halo.run/v1alpha1/thumbnails/-/via-uri?uri=%2Fupload%2Fimage.png&amp;size=m">
</figure>
<h1 style="" id="%E6%A8%A1%E5%9E%8B%E5%88%97%E8%A1%A8">模型列表</h1>
<div style="overflow-x: auto; overflow-y: hidden;">
 <table style="width: 300px">
  <colgroup>
   <col style="width: 100px">
   <col style="width: 100px">
   <col style="width: 100px">
  </colgroup>
  <tbody>
   <tr style="box-sizing: border-box; background-color: rgba(0, 0, 0, 0); border-top: 1px solid rgb(218, 221, 225); border-bottom: 2px solid rgb(218, 221, 225); margin: auto; max-width: 1000px !important;">
    <th colspan="1" rowspan="1" colwidth="100" style="box-sizing: border-box; border-color: rgb(218, 221, 225); border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 stretch; padding: 12px; background-color: rgba(0, 0, 0, 0); color: rgb(28, 30, 33); font-weight: 700; margin: auto; max-width: 1000px !important; text-align: left;">
     <p style=""><strong>模型</strong></p>
    </th>
    <th colspan="1" rowspan="1" colwidth="100" style="box-sizing: border-box; border-color: rgb(218, 221, 225); border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 stretch; padding: 12px; background-color: rgba(0, 0, 0, 0); color: rgb(28, 30, 33); font-weight: 700; text-align: left;">
     <p style=""><strong>描述</strong></p>
    </th>
    <th colspan="1" rowspan="1" colwidth="100" style="box-sizing: border-box; border-color: rgb(218, 221, 225); border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 stretch; padding: 12px; background-color: rgba(0, 0, 0, 0); color: rgb(28, 30, 33); font-weight: 700; text-align: left;">
     <p style=""><strong>窗口长度</strong></p>
    </th>
   </tr>
   <tr style="box-sizing: border-box; background-color: rgba(0, 0, 0, 0); border-top: 1px solid rgb(218, 221, 225); margin: auto; max-width: 1000px !important;">
    <td colspan="1" rowspan="1" colwidth="100" style="box-sizing: border-box; border-color: rgb(218, 221, 225); border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 stretch; padding: 12px; color: rgb(28, 30, 33); margin: auto; max-width: 1000px !important; text-align: left;">
     <p style="">intern-latest</p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="box-sizing: border-box; border-color: rgb(218, 221, 225); border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 stretch; padding: 12px; color: rgb(28, 30, 33); text-align: left;">
     <p style="">默认指向我们最新发布的 Intern 系列模型，当前指向<code>intern-s1-pro</code></p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="box-sizing: border-box; border-color: rgb(218, 221, 225); border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 stretch; padding: 12px; color: rgb(28, 30, 33); text-align: left;">
     <p style="">256K</p>
    </td>
   </tr>
   <tr style="box-sizing: border-box; background-color: rgba(0, 0, 0, 0.03); border-top: 1px solid rgb(218, 221, 225);">
    <td colspan="1" rowspan="1" colwidth="100" style="box-sizing: border-box; border-color: rgb(218, 221, 225); border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 stretch; padding: 12px; color: rgb(28, 30, 33); margin: auto; max-width: 1000px !important; text-align: left;">
     <p style="">internvl3.5-latest</p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="box-sizing: border-box; border-color: rgb(218, 221, 225); border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 stretch; padding: 12px; color: rgb(28, 30, 33); text-align: left;">
     <p style="">默认指向 InternVL3.5 系列最新模型，当前指向<code>internvl3.5-241b-a28b</code></p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="box-sizing: border-box; border-color: rgb(218, 221, 225); border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 stretch; padding: 12px; color: rgb(28, 30, 33); text-align: left;">
     <p style="">32K</p>
    </td>
   </tr>
   <tr style="box-sizing: border-box; background-color: rgba(0, 0, 0, 0); border-top: 1px solid rgb(218, 221, 225);">
    <td colspan="1" rowspan="1" colwidth="100" style="box-sizing: border-box; border-color: rgb(218, 221, 225); border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 stretch; padding: 12px; color: rgb(28, 30, 33); margin: auto; max-width: 1000px !important; text-align: left;">
     <p style="">intern-s1-pro</p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="box-sizing: border-box; border-color: rgb(218, 221, 225); border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 stretch; padding: 12px; color: rgb(28, 30, 33); text-align: left;">
     <p style="">我们最新发布的最先进的开源科学多模态推理模型，拥有极致的表现</p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="box-sizing: border-box; border-color: rgb(218, 221, 225); border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 stretch; padding: 12px; color: rgb(28, 30, 33); text-align: left;">
     <p style="">256K</p>
    </td>
   </tr>
   <tr style="box-sizing: border-box; background-color: rgba(0, 0, 0, 0.03); border-top: 1px solid rgb(218, 221, 225);">
    <td colspan="1" rowspan="1" colwidth="100" style="box-sizing: border-box; border-color: rgb(218, 221, 225); border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 stretch; padding: 12px; color: rgb(28, 30, 33); margin: auto; max-width: 1000px !important; text-align: left;">
     <p style="">intern-s1</p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="box-sizing: border-box; border-color: rgb(218, 221, 225); border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 stretch; padding: 12px; color: rgb(28, 30, 33); text-align: left;">
     <p style="">融合了专业科学能力的多模态大模型</p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="box-sizing: border-box; border-color: rgb(218, 221, 225); border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 stretch; padding: 12px; color: rgb(28, 30, 33); text-align: left;">
     <p style="">32K</p>
    </td>
   </tr>
   <tr style="box-sizing: border-box; background-color: rgba(0, 0, 0, 0); border-top: 1px solid rgb(218, 221, 225);">
    <td colspan="1" rowspan="1" colwidth="100" style="box-sizing: border-box; border-color: rgb(218, 221, 225); border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 stretch; padding: 12px; color: rgb(28, 30, 33); margin: auto; max-width: 1000px !important; text-align: left;">
     <p style="">intern-s1-mini</p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="box-sizing: border-box; border-color: rgb(218, 221, 225); border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 stretch; padding: 12px; color: rgb(28, 30, 33); text-align: left;">
     <p style="">轻量级科学强推理多模态大模型</p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="box-sizing: border-box; border-color: rgb(218, 221, 225); border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 stretch; padding: 12px; color: rgb(28, 30, 33); text-align: left;">
     <p style="">32K</p>
    </td>
   </tr>
   <tr style="box-sizing: border-box; background-color: rgba(0, 0, 0, 0.03); border-top: 1px solid rgb(218, 221, 225);">
    <td colspan="1" rowspan="1" colwidth="100" style="box-sizing: border-box; border-color: rgb(218, 221, 225); border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 stretch; padding: 12px; color: rgb(28, 30, 33); margin: auto; max-width: 1000px !important; text-align: left;">
     <p style="">internvl3.5-241b-a28b</p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="box-sizing: border-box; border-color: rgb(218, 221, 225); border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 stretch; padding: 12px; color: rgb(28, 30, 33); text-align: left;">
     <p style="">我们最新发布多模态大模型，具备更强的图文理解能力、长时序图片理解能力，性能比肩顶尖闭源模型</p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="box-sizing: border-box; border-color: rgb(218, 221, 225); border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 stretch; padding: 12px; color: rgb(28, 30, 33); text-align: left;">
     <p style="">32K</p>
    </td>
   </tr>
  </tbody>
 </table>
</div>
<h1 style="" id="%E8%B0%83%E7%94%A8%E6%A8%A1%E5%9E%8B">调用模型</h1>
<p style="">BaseUrl： <span style="background-color: rgb(246, 248, 250); color: rgb(227, 17, 108); font-family: SFMono-Regular, Menlo, Monaco, Consolas, &quot;Liberation Mono&quot;, &quot;Courier New&quot;, monospace; font-size: 13.3px">https://chat.intern-ai.org.cn/api/v1/</span></p>
<pre><code class="language-python">from openai import OpenAI

client = OpenAI(
    api_key="eyJ0eXBlIjoiSl...请填写准确的 token！",  # 此处传token，不带Bearer
    base_url="https://chat.intern-ai.org.cn/api/v1/",
)

chat_rsp = client.chat.completions.create(
    model="intern-latest",
    messages=[{"role": "user", "content": "hello"}],
)

for choice in chat_rsp.choices:
    print(choice.message.content)</code></pre>
<p style=""></p>]]></description><guid isPermaLink="false">/archives/1773452396154</guid><dc:creator>PYM</dc:creator><enclosure url="https://pym.plus/apis/api.storage.halo.run/v1alpha1/thumbnails/-/via-uri?uri=%2Fupload%2F%25E6%2589%25B9%25E6%25B3%25A8%25202026-03-14%2520100047.png&amp;size=m" type="image/jpeg" length="88418"/><category>AI</category><pubDate>Sat, 14 Mar 2026 02:12:06 GMT</pubDate></item><item><title><![CDATA[OpenClaw老烧钱了，有没有方法省点钱？有的有的！]]></title><link>https://pym.plus/archives/1773120903924</link><description><![CDATA[<img src="https://pym.plus/plugins/feed/assets/telemetry.gif?title=OpenClaw%E8%80%81%E7%83%A7%E9%92%B1%E4%BA%86%EF%BC%8C%E6%9C%89%E6%B2%A1%E6%9C%89%E6%96%B9%E6%B3%95%E7%9C%81%E7%82%B9%E9%92%B1%EF%BC%9F%E6%9C%89%E7%9A%84%E6%9C%89%E7%9A%84%EF%BC%81&amp;url=/archives/1773120903924" width="1" height="1" alt="" style="opacity:0;">
<figure style="align-items: start; display: flex; flex-direction: column" data-content-type="image">
 <img src="https://pym.plus/apis/api.storage.halo.run/v1alpha1/thumbnails/-/via-uri?uri=%2Fupload%2F%25E5%25B1%258F%25E5%25B9%2595%25E6%2588%25AA%25E5%259B%25BE%25202026-03-10%2520133532.png&amp;size=m" alt="屏幕截图 2026-03-10 133532.png" width="519px">
</figure>
<p style="">今天闲得无聊，随便问了几个问题（可能20个的样子），然后花出去13.67元，那太贵了，有没有方法省点钱呢？</p>
<p style="">还真有，每家大厂都有自己的CodingPlan，如果你Token用的多的话相当于是打了1折，CodingPlan是什么呢？</p>
<p style="">请看下图（示例对象为豆包模型的火山方舟）：
 <br></p>
<div data-type="gallery" data-group-size="2" data-layout="auto" data-gap="8">
 <div style="display: grid; gap: 8px;">
  <div data-type="gallery-group" style="display: flex; flex-direction: row; justify-content: center; gap: 8px;">
   <div style="flex: 1.3746918652423994 1 0%;" data-aspect-ratio="1.3746918652423994">
    <img src="https://pym.plus/apis/api.storage.halo.run/v1alpha1/thumbnails/-/via-uri?uri=https%3A%2F%2Fpym.plus%2Fupload%2F%25E5%25B1%258F%25E5%25B9%2595%25E6%2588%25AA%25E5%259B%25BE%25202026-03-10%2520133920.webp&amp;size=m" data-type="gallery-image" style="width: 100%; height: 100%; margin: 0; object-fit: cover;">
   </div>
   <div style="flex: 2.1997319034852545 1 0%;" data-aspect-ratio="2.1997319034852545">
    <img src="https://pym.plus/apis/api.storage.halo.run/v1alpha1/thumbnails/-/via-uri?uri=https%3A%2F%2Fpym.plus%2Fupload%2F%25E5%25B1%258F%25E5%25B9%2595%25E6%2588%25AA%25E5%259B%25BE%25202026-03-10%2520133853.webp&amp;size=m" data-type="gallery-image" style="width: 100%; height: 100%; margin: 0; object-fit: cover;">
   </div>
  </div>
  <div data-type="gallery-group" style="display: flex; flex-direction: row; justify-content: center; gap: 8px;">
   <div style="flex: 1.3746918652423994 1 0%;" data-aspect-ratio="1.3746918652423994">
    <img src="https://pym.plus/apis/api.storage.halo.run/v1alpha1/thumbnails/-/via-uri?uri=https%3A%2F%2Fpym.plus%2Fupload%2F%25E5%25B1%258F%25E5%25B9%2595%25E6%2588%25AA%25E5%259B%25BE%25202026-03-10%2520133920.webp&amp;size=m" data-type="gallery-image" style="width: 100%; height: 100%; margin: 0; object-fit: cover;">
   </div>
   <div style="flex: 2.1997319034852545 1 0%;" data-aspect-ratio="2.1997319034852545">
    <img src="https://pym.plus/apis/api.storage.halo.run/v1alpha1/thumbnails/-/via-uri?uri=https%3A%2F%2Fpym.plus%2Fupload%2F%25E5%25B1%258F%25E5%25B9%2595%25E6%2588%25AA%25E5%259B%25BE%25202026-03-10%2520133853.webp&amp;size=m" data-type="gallery-image" style="width: 100%; height: 100%; margin: 0; object-fit: cover;">
   </div>
  </div>
 </div>
</div>
<p style="">由此我们可以知道，如果自己请求很多的话用CodingPlan无非是等等，价格却是相当于打了1折，非常便宜，基本可以说是个人使用随便问了。</p>
<p style="">下面给出3家大厂的链接（基本都集成了很多模型）：</p>
<p style="">阿里云（主要是Qwen模型）：<a href="https://www.aliyun.com/benefit/scene/codingplan">阿里云百炼 Coding Plan - AI 编码订阅计划 - 阿里云</a></p>
<p style="">腾讯云（主要是<span style="background-color: rgb(255, 255, 255); color: rgba(0, 0, 0, 0.7); font-family: &quot;pingfang SC&quot;, &quot;helvetica neue&quot;, arial, &quot;hiragino sans gb&quot;, &quot;microsoft yahei ui&quot;, &quot;microsoft yahei&quot;, simsun, &quot;sans-serif&quot;; font-size: 14px">HY模型</span>）：<a href="https://cloud.tencent.com/act/pro/codingplan">腾讯云 Coding Plan 智能 AI 编程订阅服务</a></p>
<p style="">火山引擎（主要是Doubao模型）：<a href="https://www.volcengine.com/activity/codingplan">方舟Coding-Plan</a></p>]]></description><guid isPermaLink="false">/archives/1773120903924</guid><dc:creator>PYM</dc:creator><enclosure url="https://pym.plus/apis/api.storage.halo.run/v1alpha1/thumbnails/-/via-uri?uri=%2Fupload%2F%25E5%25B1%258F%25E5%25B9%2595%25E6%2588%25AA%25E5%259B%25BE%25202026-03-10%2520133920.webp&amp;size=m" type="image/jpeg" length="86372"/><category>AI</category><pubDate>Tue, 10 Mar 2026 05:44:12 GMT</pubDate></item><item><title><![CDATA[Docker Compose部署OpenClaw，真正能做事的 AI！]]></title><link>https://pym.plus/archives/1772877423955</link><description><![CDATA[<img src="https://pym.plus/plugins/feed/assets/telemetry.gif?title=Docker%20Compose%E9%83%A8%E7%BD%B2OpenClaw%EF%BC%8C%E7%9C%9F%E6%AD%A3%E8%83%BD%E5%81%9A%E4%BA%8B%E7%9A%84%20AI%EF%BC%81&amp;url=/archives/1772877423955" width="1" height="1" alt="" style="opacity:0;">
<h1 style="" id="%E5%89%8D%E8%A8%80">前言</h1>
<p style="">最近OpenClaw老火了，号称啥事都能帮你干的AI，任务丢过去就会自己完成，<s>完美解决了Token滞销的问题</s>，那么今天就用Docker Compose来搞一个玩玩！</p>
<p style=""><strong>注意：不要随便给别人用！！！否则AI可能把你的API和个人信息之类的打包发给别人！！！也不要在自己的主力电脑上部署，小心AI直接给你文件删完了！！！附带一句<s>请随时注意你的Token账单和你的钱包！</s></strong></p>
<h1 style="" id="%E5%AE%89%E8%A3%85">安装</h1>
<h3 style="" id="%E6%AD%A5%E9%AA%A4-1%EF%BC%9A%E5%88%9B%E5%BB%BA%E5%B7%A5%E4%BD%9C%E7%9B%AE%E5%BD%95"><strong>步骤 1：创建工作目录</strong></h3>
<pre><code class="language-shellscript">mkdir -p ~/openclaw-docker
cd ~/openclaw-docker</code></pre>
<h3 style="" id="%E6%AD%A5%E9%AA%A4-2%EF%BC%9A%E5%88%9B%E5%BB%BA-.env-%E7%8E%AF%E5%A2%83%E6%96%87%E4%BB%B6"><strong>步骤 2：创建 .env 环境文件</strong></h3>
<pre><code class="language-shellscript">nano .env # 创建.env文件 </code></pre>
<p style="line-height: 28px">将以下内容复制到 <code>.env</code> 文件：</p>
<pre><code class="language-yaml"># 镜像配置
OPENCLAW_IMAGE=jiulingyun803/openclaw-cn:latest

# 数据目录（相对于 docker-compose.yml 所在目录）
OPENCLAW_CONFIG_DIR=./data/.openclaw
OPENCLAW_WORKSPACE_DIR=./data/clawd

# 网关配置
OPENCLAW_GATEWAY_PORT=18789
OPENCLAW_BRIDGE_PORT=18790
OPENCLAW_GATEWAY_BIND=lan
OPENCLAW_GATEWAY_TOKEN=your-secure-token-here

# Claude 集成（可选，仅使用 Claude 作为后端时填写）
CLAUDE_AI_SESSION_KEY=
CLAUDE_WEB_SESSION_KEY=
CLAUDE_WEB_COOKIE=</code></pre>
<p style="">这里附一份表格，关于.env的配置解释：</p>
<div style="overflow-x: auto; overflow-y: hidden;">
 <table style="width: 500px">
  <colgroup>
   <col style="width: 100px">
   <col style="width: 100px">
   <col style="width: 100px">
   <col style="width: 100px">
   <col style="width: 100px">
  </colgroup>
  <tbody>
   <tr style="animation-delay: -1ms !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; background-attachment: initial !important; scroll-behavior: auto !important; transition: background-color 0.5s; box-sizing: border-box; --vp-code-copy-copied-text-content: &quot;已复制&quot;; background-color: rgb(255, 255, 255); border-top: 1px solid rgb(226, 226, 227);">
    <th colspan="1" rowspan="1" colwidth="100" style="animation-delay: -1ms !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; background-attachment: initial !important; scroll-behavior: auto !important; transition-duration: 0s !important; transition-delay: 0s !important; box-sizing: border-box; --vp-code-copy-copied-text-content: &quot;已复制&quot;; border-color: rgb(226, 226, 227); border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 stretch; padding: 8px 16px; text-align: left; font-size: 14px; font-weight: 600; color: rgb(103, 103, 108); background-color: rgb(246, 246, 247);">
     <p style=""><strong>变量</strong></p>
    </th>
    <th colspan="1" rowspan="1" colwidth="100" style="animation-delay: -1ms !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; background-attachment: initial !important; scroll-behavior: auto !important; transition-duration: 0s !important; transition-delay: 0s !important; box-sizing: border-box; --vp-code-copy-copied-text-content: &quot;已复制&quot;; border-color: rgb(226, 226, 227); border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 stretch; padding: 8px 16px; text-align: left; font-size: 14px; font-weight: 600; color: rgb(103, 103, 108); background-color: rgb(246, 246, 247);">
     <p style=""><strong>含义</strong></p>
    </th>
    <th colspan="1" rowspan="1" colwidth="100" style="animation-delay: -1ms !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; background-attachment: initial !important; scroll-behavior: auto !important; transition-duration: 0s !important; transition-delay: 0s !important; box-sizing: border-box; --vp-code-copy-copied-text-content: &quot;已复制&quot;; border-color: rgb(226, 226, 227); border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 stretch; padding: 8px 16px; text-align: left; font-size: 14px; font-weight: 600; color: rgb(103, 103, 108); background-color: rgb(246, 246, 247);">
     <p style=""><strong>默认值</strong></p>
    </th>
    <th colspan="1" rowspan="1" colwidth="100" style="animation-delay: -1ms !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; background-attachment: initial !important; scroll-behavior: auto !important; transition-duration: 0s !important; transition-delay: 0s !important; box-sizing: border-box; --vp-code-copy-copied-text-content: &quot;已复制&quot;; border-color: rgb(226, 226, 227); border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 stretch; padding: 8px 16px; text-align: left; font-size: 14px; font-weight: 600; color: rgb(103, 103, 108); background-color: rgb(246, 246, 247);">
     <p style=""><strong>必需</strong></p>
    </th>
    <th colspan="1" rowspan="1" colwidth="100" style="animation-delay: -1ms !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; background-attachment: initial !important; scroll-behavior: auto !important; transition-duration: 0s !important; transition-delay: 0s !important; box-sizing: border-box; --vp-code-copy-copied-text-content: &quot;已复制&quot;; border-color: rgb(226, 226, 227); border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 stretch; padding: 8px 16px; text-align: left; font-size: 14px; font-weight: 600; color: rgb(103, 103, 108); background-color: rgb(246, 246, 247);">
     <p style=""><strong>说明</strong></p>
    </th>
   </tr>
   <tr style="animation-delay: -1ms !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; background-attachment: initial !important; scroll-behavior: auto !important; transition: background-color 0.5s; box-sizing: border-box; --vp-code-copy-copied-text-content: &quot;已复制&quot;; background-color: rgb(255, 255, 255); border-top: 1px solid rgb(226, 226, 227);">
    <td colspan="1" rowspan="1" colwidth="100" style="animation-delay: -1ms !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; background-attachment: initial !important; scroll-behavior: auto !important; transition-duration: 0s !important; transition-delay: 0s !important; box-sizing: border-box; --vp-code-copy-copied-text-content: &quot;已复制&quot;; border-color: rgb(226, 226, 227); border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 stretch; padding: 8px 16px; font-size: 14px;">
     <p style=""><code>OPENCLAW_IMAGE</code></p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="animation-delay: -1ms !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; background-attachment: initial !important; scroll-behavior: auto !important; transition-duration: 0s !important; transition-delay: 0s !important; box-sizing: border-box; --vp-code-copy-copied-text-content: &quot;已复制&quot;; border-color: rgb(226, 226, 227); border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 stretch; padding: 8px 16px; font-size: 14px;">
     <p style="">Docker 镜像名称</p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="animation-delay: -1ms !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; background-attachment: initial !important; scroll-behavior: auto !important; transition-duration: 0s !important; transition-delay: 0s !important; box-sizing: border-box; --vp-code-copy-copied-text-content: &quot;已复制&quot;; border-color: rgb(226, 226, 227); border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 stretch; padding: 8px 16px; font-size: 14px;">
     <p style=""><code>openclaw-cn:local</code></p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="animation-delay: -1ms !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; background-attachment: initial !important; scroll-behavior: auto !important; transition-duration: 0s !important; transition-delay: 0s !important; box-sizing: border-box; --vp-code-copy-copied-text-content: &quot;已复制&quot;; border-color: rgb(226, 226, 227); border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 stretch; padding: 8px 16px; font-size: 14px;">
     <p style=""><span data-name="x" class="emoji-node" data-type="emoji">❌</span></p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="animation-delay: -1ms !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; background-attachment: initial !important; scroll-behavior: auto !important; transition-duration: 0s !important; transition-delay: 0s !important; box-sizing: border-box; --vp-code-copy-copied-text-content: &quot;已复制&quot;; border-color: rgb(226, 226, 227); border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 stretch; padding: 8px 16px; font-size: 14px;">
     <p style="">使用预构建镜像：<code>jiulingyun803/openclaw-cn:latest</code> 或 <code>jiulingyun803/openclaw-cn:vX.Y.Z</code></p>
    </td>
   </tr>
   <tr style="animation-delay: -1ms !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; background-attachment: initial !important; scroll-behavior: auto !important; transition: background-color 0.5s; box-sizing: border-box; --vp-code-copy-copied-text-content: &quot;已复制&quot;; background-color: rgb(246, 246, 247); border-top: 1px solid rgb(226, 226, 227);">
    <td colspan="1" rowspan="1" colwidth="100" style="animation-delay: -1ms !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; background-attachment: initial !important; scroll-behavior: auto !important; transition-duration: 0s !important; transition-delay: 0s !important; box-sizing: border-box; --vp-code-copy-copied-text-content: &quot;已复制&quot;; border-color: rgb(226, 226, 227); border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 stretch; padding: 8px 16px; font-size: 14px;">
     <p style=""><code>OPENCLAW_CONFIG_DIR</code></p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="animation-delay: -1ms !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; background-attachment: initial !important; scroll-behavior: auto !important; transition-duration: 0s !important; transition-delay: 0s !important; box-sizing: border-box; --vp-code-copy-copied-text-content: &quot;已复制&quot;; border-color: rgb(226, 226, 227); border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 stretch; padding: 8px 16px; font-size: 14px;">
     <p style="">配置文件目录</p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="animation-delay: -1ms !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; background-attachment: initial !important; scroll-behavior: auto !important; transition-duration: 0s !important; transition-delay: 0s !important; box-sizing: border-box; --vp-code-copy-copied-text-content: &quot;已复制&quot;; border-color: rgb(226, 226, 227); border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 stretch; padding: 8px 16px; font-size: 14px;">
     <p style=""><code>~/.openclaw</code></p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="animation-delay: -1ms !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; background-attachment: initial !important; scroll-behavior: auto !important; transition-duration: 0s !important; transition-delay: 0s !important; box-sizing: border-box; --vp-code-copy-copied-text-content: &quot;已复制&quot;; border-color: rgb(226, 226, 227); border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 stretch; padding: 8px 16px; font-size: 14px;">
     <p style=""><span data-name="x" class="emoji-node" data-type="emoji">❌</span></p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="animation-delay: -1ms !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; background-attachment: initial !important; scroll-behavior: auto !important; transition-duration: 0s !important; transition-delay: 0s !important; box-sizing: border-box; --vp-code-copy-copied-text-content: &quot;已复制&quot;; border-color: rgb(226, 226, 227); border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 stretch; padding: 8px 16px; font-size: 14px;">
     <p style="">Clawdbot 配置和凭证存储位置</p>
    </td>
   </tr>
   <tr style="animation-delay: -1ms !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; background-attachment: initial !important; scroll-behavior: auto !important; transition: background-color 0.5s; box-sizing: border-box; --vp-code-copy-copied-text-content: &quot;已复制&quot;; background-color: rgb(255, 255, 255); border-top: 1px solid rgb(226, 226, 227);">
    <td colspan="1" rowspan="1" colwidth="100" style="animation-delay: -1ms !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; background-attachment: initial !important; scroll-behavior: auto !important; transition-duration: 0s !important; transition-delay: 0s !important; box-sizing: border-box; --vp-code-copy-copied-text-content: &quot;已复制&quot;; border-color: rgb(226, 226, 227); border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 stretch; padding: 8px 16px; font-size: 14px;">
     <p style=""><code>OPENCLAW_WORKSPACE_DIR</code></p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="animation-delay: -1ms !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; background-attachment: initial !important; scroll-behavior: auto !important; transition-duration: 0s !important; transition-delay: 0s !important; box-sizing: border-box; --vp-code-copy-copied-text-content: &quot;已复制&quot;; border-color: rgb(226, 226, 227); border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 stretch; padding: 8px 16px; font-size: 14px;">
     <p style="">工作空间目录</p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="animation-delay: -1ms !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; background-attachment: initial !important; scroll-behavior: auto !important; transition-duration: 0s !important; transition-delay: 0s !important; box-sizing: border-box; --vp-code-copy-copied-text-content: &quot;已复制&quot;; border-color: rgb(226, 226, 227); border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 stretch; padding: 8px 16px; font-size: 14px;">
     <p style=""><code>~/clawd</code></p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="animation-delay: -1ms !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; background-attachment: initial !important; scroll-behavior: auto !important; transition-duration: 0s !important; transition-delay: 0s !important; box-sizing: border-box; --vp-code-copy-copied-text-content: &quot;已复制&quot;; border-color: rgb(226, 226, 227); border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 stretch; padding: 8px 16px; font-size: 14px;">
     <p style=""><span data-name="x" class="emoji-node" data-type="emoji">❌</span></p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="animation-delay: -1ms !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; background-attachment: initial !important; scroll-behavior: auto !important; transition-duration: 0s !important; transition-delay: 0s !important; box-sizing: border-box; --vp-code-copy-copied-text-content: &quot;已复制&quot;; border-color: rgb(226, 226, 227); border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 stretch; padding: 8px 16px; font-size: 14px;">
     <p style="">代理工作文件存储位置</p>
    </td>
   </tr>
   <tr style="animation-delay: -1ms !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; background-attachment: initial !important; scroll-behavior: auto !important; transition: background-color 0.5s; box-sizing: border-box; --vp-code-copy-copied-text-content: &quot;已复制&quot;; background-color: rgb(246, 246, 247); border-top: 1px solid rgb(226, 226, 227);">
    <td colspan="1" rowspan="1" colwidth="100" style="animation-delay: -1ms !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; background-attachment: initial !important; scroll-behavior: auto !important; transition-duration: 0s !important; transition-delay: 0s !important; box-sizing: border-box; --vp-code-copy-copied-text-content: &quot;已复制&quot;; border-color: rgb(226, 226, 227); border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 stretch; padding: 8px 16px; font-size: 14px;">
     <p style=""><code>OPENCLAW_GATEWAY_PORT</code></p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="animation-delay: -1ms !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; background-attachment: initial !important; scroll-behavior: auto !important; transition-duration: 0s !important; transition-delay: 0s !important; box-sizing: border-box; --vp-code-copy-copied-text-content: &quot;已复制&quot;; border-color: rgb(226, 226, 227); border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 stretch; padding: 8px 16px; font-size: 14px;">
     <p style="">网关端口号</p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="animation-delay: -1ms !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; background-attachment: initial !important; scroll-behavior: auto !important; transition-duration: 0s !important; transition-delay: 0s !important; box-sizing: border-box; --vp-code-copy-copied-text-content: &quot;已复制&quot;; border-color: rgb(226, 226, 227); border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 stretch; padding: 8px 16px; font-size: 14px;">
     <p style=""><code>18789</code></p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="animation-delay: -1ms !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; background-attachment: initial !important; scroll-behavior: auto !important; transition-duration: 0s !important; transition-delay: 0s !important; box-sizing: border-box; --vp-code-copy-copied-text-content: &quot;已复制&quot;; border-color: rgb(226, 226, 227); border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 stretch; padding: 8px 16px; font-size: 14px;">
     <p style=""><span data-name="x" class="emoji-node" data-type="emoji">❌</span></p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="animation-delay: -1ms !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; background-attachment: initial !important; scroll-behavior: auto !important; transition-duration: 0s !important; transition-delay: 0s !important; box-sizing: border-box; --vp-code-copy-copied-text-content: &quot;已复制&quot;; border-color: rgb(226, 226, 227); border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 stretch; padding: 8px 16px; font-size: 14px;">
     <p style="">访问 Web UI 的端口（如需修改，访问时用新端口）</p>
    </td>
   </tr>
   <tr style="animation-delay: -1ms !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; background-attachment: initial !important; scroll-behavior: auto !important; transition: background-color 0.5s; box-sizing: border-box; --vp-code-copy-copied-text-content: &quot;已复制&quot;; background-color: rgb(255, 255, 255); border-top: 1px solid rgb(226, 226, 227);">
    <td colspan="1" rowspan="1" colwidth="100" style="animation-delay: -1ms !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; background-attachment: initial !important; scroll-behavior: auto !important; transition-duration: 0s !important; transition-delay: 0s !important; box-sizing: border-box; --vp-code-copy-copied-text-content: &quot;已复制&quot;; border-color: rgb(226, 226, 227); border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 stretch; padding: 8px 16px; font-size: 14px;">
     <p style=""><code>OPENCLAW_BRIDGE_PORT</code></p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="animation-delay: -1ms !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; background-attachment: initial !important; scroll-behavior: auto !important; transition-duration: 0s !important; transition-delay: 0s !important; box-sizing: border-box; --vp-code-copy-copied-text-content: &quot;已复制&quot;; border-color: rgb(226, 226, 227); border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 stretch; padding: 8px 16px; font-size: 14px;">
     <p style="">桥接端口号</p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="animation-delay: -1ms !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; background-attachment: initial !important; scroll-behavior: auto !important; transition-duration: 0s !important; transition-delay: 0s !important; box-sizing: border-box; --vp-code-copy-copied-text-content: &quot;已复制&quot;; border-color: rgb(226, 226, 227); border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 stretch; padding: 8px 16px; font-size: 14px;">
     <p style=""><code>18790</code></p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="animation-delay: -1ms !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; background-attachment: initial !important; scroll-behavior: auto !important; transition-duration: 0s !important; transition-delay: 0s !important; box-sizing: border-box; --vp-code-copy-copied-text-content: &quot;已复制&quot;; border-color: rgb(226, 226, 227); border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 stretch; padding: 8px 16px; font-size: 14px;">
     <p style=""><span data-name="x" class="emoji-node" data-type="emoji">❌</span></p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="animation-delay: -1ms !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; background-attachment: initial !important; scroll-behavior: auto !important; transition-duration: 0s !important; transition-delay: 0s !important; box-sizing: border-box; --vp-code-copy-copied-text-content: &quot;已复制&quot;; border-color: rgb(226, 226, 227); border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 stretch; padding: 8px 16px; font-size: 14px;">
     <p style="">用于客户端连接的端口</p>
    </td>
   </tr>
   <tr style="animation-delay: -1ms !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; background-attachment: initial !important; scroll-behavior: auto !important; transition: background-color 0.5s; box-sizing: border-box; --vp-code-copy-copied-text-content: &quot;已复制&quot;; background-color: rgb(246, 246, 247); border-top: 1px solid rgb(226, 226, 227);">
    <td colspan="1" rowspan="1" colwidth="100" style="animation-delay: -1ms !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; background-attachment: initial !important; scroll-behavior: auto !important; transition-duration: 0s !important; transition-delay: 0s !important; box-sizing: border-box; --vp-code-copy-copied-text-content: &quot;已复制&quot;; border-color: rgb(226, 226, 227); border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 stretch; padding: 8px 16px; font-size: 14px;">
     <p style=""><code>OPENCLAW_GATEWAY_BIND</code></p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="animation-delay: -1ms !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; background-attachment: initial !important; scroll-behavior: auto !important; transition-duration: 0s !important; transition-delay: 0s !important; box-sizing: border-box; --vp-code-copy-copied-text-content: &quot;已复制&quot;; border-color: rgb(226, 226, 227); border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 stretch; padding: 8px 16px; font-size: 14px;">
     <p style="">网关绑定地址</p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="animation-delay: -1ms !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; background-attachment: initial !important; scroll-behavior: auto !important; transition-duration: 0s !important; transition-delay: 0s !important; box-sizing: border-box; --vp-code-copy-copied-text-content: &quot;已复制&quot;; border-color: rgb(226, 226, 227); border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 stretch; padding: 8px 16px; font-size: 14px;">
     <p style=""><code>lan</code></p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="animation-delay: -1ms !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; background-attachment: initial !important; scroll-behavior: auto !important; transition-duration: 0s !important; transition-delay: 0s !important; box-sizing: border-box; --vp-code-copy-copied-text-content: &quot;已复制&quot;; border-color: rgb(226, 226, 227); border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 stretch; padding: 8px 16px; font-size: 14px;">
     <p style=""><span data-name="x" class="emoji-node" data-type="emoji">❌</span></p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="animation-delay: -1ms !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; background-attachment: initial !important; scroll-behavior: auto !important; transition-duration: 0s !important; transition-delay: 0s !important; box-sizing: border-box; --vp-code-copy-copied-text-content: &quot;已复制&quot;; border-color: rgb(226, 226, 227); border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 stretch; padding: 8px 16px; font-size: 14px;">
     <p style=""><code>localhost</code>（仅本机）/ <code>lan</code>（局域网）/ <code>0.0.0.0</code>（公网可访问，⚠️ 谨慎使用）</p>
    </td>
   </tr>
   <tr style="animation-delay: -1ms !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; background-attachment: initial !important; scroll-behavior: auto !important; transition: background-color 0.5s; box-sizing: border-box; --vp-code-copy-copied-text-content: &quot;已复制&quot;; background-color: rgb(255, 255, 255); border-top: 1px solid rgb(226, 226, 227);">
    <td colspan="1" rowspan="1" colwidth="100" style="animation-delay: -1ms !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; background-attachment: initial !important; scroll-behavior: auto !important; transition-duration: 0s !important; transition-delay: 0s !important; box-sizing: border-box; --vp-code-copy-copied-text-content: &quot;已复制&quot;; border-color: rgb(226, 226, 227); border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 stretch; padding: 8px 16px; font-size: 14px;">
     <p style=""><code>OPENCLAW_GATEWAY_TOKEN</code></p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="animation-delay: -1ms !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; background-attachment: initial !important; scroll-behavior: auto !important; transition-duration: 0s !important; transition-delay: 0s !important; box-sizing: border-box; --vp-code-copy-copied-text-content: &quot;已复制&quot;; border-color: rgb(226, 226, 227); border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 stretch; padding: 8px 16px; font-size: 14px;">
     <p style="">网关认证令牌</p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="animation-delay: -1ms !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; background-attachment: initial !important; scroll-behavior: auto !important; transition-duration: 0s !important; transition-delay: 0s !important; box-sizing: border-box; --vp-code-copy-copied-text-content: &quot;已复制&quot;; border-color: rgb(226, 226, 227); border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 stretch; padding: 8px 16px; font-size: 14px;">
     <p style="">自动生成</p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="animation-delay: -1ms !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; background-attachment: initial !important; scroll-behavior: auto !important; transition-duration: 0s !important; transition-delay: 0s !important; box-sizing: border-box; --vp-code-copy-copied-text-content: &quot;已复制&quot;; border-color: rgb(226, 226, 227); border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 stretch; padding: 8px 16px; font-size: 14px;">
     <p style=""><span data-name="x" class="emoji-node" data-type="emoji">❌</span></p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="animation-delay: -1ms !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; background-attachment: initial !important; scroll-behavior: auto !important; transition-duration: 0s !important; transition-delay: 0s !important; box-sizing: border-box; --vp-code-copy-copied-text-content: &quot;已复制&quot;; border-color: rgb(226, 226, 227); border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 stretch; padding: 8px 16px; font-size: 14px;">
     <p style="">Web UI 登录令牌（可自定义或留空自动生成）</p>
    </td>
   </tr>
   <tr style="animation-delay: -1ms !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; background-attachment: initial !important; scroll-behavior: auto !important; transition: background-color 0.5s; box-sizing: border-box; --vp-code-copy-copied-text-content: &quot;已复制&quot;; background-color: rgb(246, 246, 247); border-top: 1px solid rgb(226, 226, 227);">
    <td colspan="1" rowspan="1" colwidth="100" style="animation-delay: -1ms !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; background-attachment: initial !important; scroll-behavior: auto !important; transition-duration: 0s !important; transition-delay: 0s !important; box-sizing: border-box; --vp-code-copy-copied-text-content: &quot;已复制&quot;; border-color: rgb(226, 226, 227); border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 stretch; padding: 8px 16px; font-size: 14px;">
     <p style=""><code>CLAUDE_AI_SESSION_KEY</code></p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="animation-delay: -1ms !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; background-attachment: initial !important; scroll-behavior: auto !important; transition-duration: 0s !important; transition-delay: 0s !important; box-sizing: border-box; --vp-code-copy-copied-text-content: &quot;已复制&quot;; border-color: rgb(226, 226, 227); border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 stretch; padding: 8px 16px; font-size: 14px;">
     <p style="">Claude.ai 会话密钥</p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="animation-delay: -1ms !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; background-attachment: initial !important; scroll-behavior: auto !important; transition-duration: 0s !important; transition-delay: 0s !important; box-sizing: border-box; --vp-code-copy-copied-text-content: &quot;已复制&quot;; border-color: rgb(226, 226, 227); border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 stretch; padding: 8px 16px; font-size: 14px;">
     <p style="">空</p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="animation-delay: -1ms !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; background-attachment: initial !important; scroll-behavior: auto !important; transition-duration: 0s !important; transition-delay: 0s !important; box-sizing: border-box; --vp-code-copy-copied-text-content: &quot;已复制&quot;; border-color: rgb(226, 226, 227); border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 stretch; padding: 8px 16px; font-size: 14px;">
     <p style=""><span data-name="x" class="emoji-node" data-type="emoji">❌</span></p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="animation-delay: -1ms !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; background-attachment: initial !important; scroll-behavior: auto !important; transition-duration: 0s !important; transition-delay: 0s !important; box-sizing: border-box; --vp-code-copy-copied-text-content: &quot;已复制&quot;; border-color: rgb(226, 226, 227); border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 stretch; padding: 8px 16px; font-size: 14px;">
     <p style="">⚠️ 仅使用 Claude AI 作为后端时填写，获取方式见 <a href="https://clawd.org.cn/docs/providers/claude.html"><strong><u>Claude 登录指南</u></strong></a></p>
    </td>
   </tr>
   <tr style="animation-delay: -1ms !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; background-attachment: initial !important; scroll-behavior: auto !important; transition: background-color 0.5s; box-sizing: border-box; --vp-code-copy-copied-text-content: &quot;已复制&quot;; background-color: rgb(255, 255, 255); border-top: 1px solid rgb(226, 226, 227);">
    <td colspan="1" rowspan="1" colwidth="100" style="animation-delay: -1ms !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; background-attachment: initial !important; scroll-behavior: auto !important; transition-duration: 0s !important; transition-delay: 0s !important; box-sizing: border-box; --vp-code-copy-copied-text-content: &quot;已复制&quot;; border-color: rgb(226, 226, 227); border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 stretch; padding: 8px 16px; font-size: 14px;">
     <p style=""><code>CLAUDE_WEB_SESSION_KEY</code></p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="animation-delay: -1ms !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; background-attachment: initial !important; scroll-behavior: auto !important; transition-duration: 0s !important; transition-delay: 0s !important; box-sizing: border-box; --vp-code-copy-copied-text-content: &quot;已复制&quot;; border-color: rgb(226, 226, 227); border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 stretch; padding: 8px 16px; font-size: 14px;">
     <p style="">Claude Web 会话密钥</p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="animation-delay: -1ms !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; background-attachment: initial !important; scroll-behavior: auto !important; transition-duration: 0s !important; transition-delay: 0s !important; box-sizing: border-box; --vp-code-copy-copied-text-content: &quot;已复制&quot;; border-color: rgb(226, 226, 227); border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 stretch; padding: 8px 16px; font-size: 14px;">
     <p style="">空</p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="animation-delay: -1ms !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; background-attachment: initial !important; scroll-behavior: auto !important; transition-duration: 0s !important; transition-delay: 0s !important; box-sizing: border-box; --vp-code-copy-copied-text-content: &quot;已复制&quot;; border-color: rgb(226, 226, 227); border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 stretch; padding: 8px 16px; font-size: 14px;">
     <p style=""><span data-name="x" class="emoji-node" data-type="emoji">❌</span></p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="animation-delay: -1ms !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; background-attachment: initial !important; scroll-behavior: auto !important; transition-duration: 0s !important; transition-delay: 0s !important; box-sizing: border-box; --vp-code-copy-copied-text-content: &quot;已复制&quot;; border-color: rgb(226, 226, 227); border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 stretch; padding: 8px 16px; font-size: 14px;">
     <p style="">⚠️ 仅使用 Claude Web 版时填写</p>
    </td>
   </tr>
   <tr style="animation-delay: -1ms !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; background-attachment: initial !important; scroll-behavior: auto !important; transition: background-color 0.5s; box-sizing: border-box; --vp-code-copy-copied-text-content: &quot;已复制&quot;; background-color: rgb(246, 246, 247); border-top: 1px solid rgb(226, 226, 227);">
    <td colspan="1" rowspan="1" colwidth="100" style="animation-delay: -1ms !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; background-attachment: initial !important; scroll-behavior: auto !important; transition-duration: 0s !important; transition-delay: 0s !important; box-sizing: border-box; --vp-code-copy-copied-text-content: &quot;已复制&quot;; border-color: rgb(226, 226, 227); border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 stretch; padding: 8px 16px; font-size: 14px;">
     <p style=""><code>CLAUDE_WEB_COOKIE</code></p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="animation-delay: -1ms !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; background-attachment: initial !important; scroll-behavior: auto !important; transition-duration: 0s !important; transition-delay: 0s !important; box-sizing: border-box; --vp-code-copy-copied-text-content: &quot;已复制&quot;; border-color: rgb(226, 226, 227); border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 stretch; padding: 8px 16px; font-size: 14px;">
     <p style="">Claude Web Cookie</p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="animation-delay: -1ms !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; background-attachment: initial !important; scroll-behavior: auto !important; transition-duration: 0s !important; transition-delay: 0s !important; box-sizing: border-box; --vp-code-copy-copied-text-content: &quot;已复制&quot;; border-color: rgb(226, 226, 227); border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 stretch; padding: 8px 16px; font-size: 14px;">
     <p style="">空</p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="animation-delay: -1ms !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; background-attachment: initial !important; scroll-behavior: auto !important; transition-duration: 0s !important; transition-delay: 0s !important; box-sizing: border-box; --vp-code-copy-copied-text-content: &quot;已复制&quot;; border-color: rgb(226, 226, 227); border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 stretch; padding: 8px 16px; font-size: 14px;">
     <p style=""><span data-name="x" class="emoji-node" data-type="emoji">❌</span></p>
    </td>
    <td colspan="1" rowspan="1" colwidth="100" style="animation-delay: -1ms !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; background-attachment: initial !important; scroll-behavior: auto !important; transition-duration: 0s !important; transition-delay: 0s !important; box-sizing: border-box; --vp-code-copy-copied-text-content: &quot;已复制&quot;; border-color: rgb(226, 226, 227); border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 stretch; padding: 8px 16px; font-size: 14px;">
     <p style="">⚠️ 仅使用 Claude Web 版时填写</p>
    </td>
   </tr>
  </tbody>
 </table>
</div>
<h3 style="" id="%E6%AD%A5%E9%AA%A4-3%EF%BC%9A%E5%88%9B%E5%BB%BA-docker-compose.yml-%E6%96%87%E4%BB%B6"><strong>步骤 3：创建 docker-compose.yml 文件</strong></h3>
<pre><code class="language-shellscript">nano docker-compose.yml # 创建docker-compose.yml文件</code></pre>
<p style="line-height: 28px">将以下内容复制到 <code>docker-compose.yml</code>：</p>
<pre><code class="language-yaml">services:
  openclaw-cn-gateway:
    image: ${OPENCLAW_IMAGE:-openclaw-cn:local}
    user: node:node
    environment:
      HOME: /home/node
      TERM: xterm-256color
      OPENCLAW_GATEWAY_TOKEN: ${OPENCLAW_GATEWAY_TOKEN}
      CLAUDE_AI_SESSION_KEY: ${CLAUDE_AI_SESSION_KEY}
      CLAUDE_WEB_SESSION_KEY: ${CLAUDE_WEB_SESSION_KEY}
      CLAUDE_WEB_COOKIE: ${CLAUDE_WEB_COOKIE}
    volumes:
      - ${OPENCLAW_CONFIG_DIR:-./data/.openclaw}:/home/node/.openclaw
      - ${OPENCLAW_WORKSPACE_DIR:-./data/clawd}:/home/node/clawd
    ports:
      - "${OPENCLAW_GATEWAY_PORT:-18789}:18789"
      - "${OPENCLAW_BRIDGE_PORT:-18790}:18790"
    init: true
    restart: unless-stopped
    command:
      [
        "node",
        "dist/index.js",
        "gateway",
        "--bind",
        "${OPENCLAW_GATEWAY_BIND:-lan}",
        "--port",
        "${OPENCLAW_GATEWAY_PORT:-18789}"
      ]

  openclaw-cn-cli:
    image: ${OPENCLAW_IMAGE:-openclaw-cn:local}
    user: node:node
    environment:
      HOME: /home/node
      TERM: xterm-256color
      BROWSER: echo
      CLAUDE_AI_SESSION_KEY: ${CLAUDE_AI_SESSION_KEY}
      CLAUDE_WEB_SESSION_KEY: ${CLAUDE_WEB_SESSION_KEY}
      CLAUDE_WEB_COOKIE: ${CLAUDE_WEB_COOKIE}
    volumes:
      - ${OPENCLAW_CONFIG_DIR:-./data/.openclaw}:/home/node/.openclaw
      - ${OPENCLAW_WORKSPACE_DIR:-./data/clawd}:/home/node/clawd
    stdin_open: true
    tty: true
    init: true
    entrypoint: ["node", "dist/index.js"]</code></pre>
<h3 style="" id="%E6%AD%A5%E9%AA%A4-4%EF%BC%9A%E5%90%AF%E5%8A%A8%E5%AE%B9%E5%99%A8"><strong>步骤 4：启动容器</strong></h3>
<pre><code class="language-shellscript">docker compose up -d</code></pre>
<h3 style="" id="%E6%AD%A5%E9%AA%A4-5%EF%BC%9A%E8%BF%90%E8%A1%8C%E9%85%8D%E7%BD%AE%E5%90%91%E5%AF%BC"><strong>步骤 5：运行配置向导</strong></h3>
<pre><code class="language-shellscript">docker compose run --rm openclaw-cn-cli onboard</code></pre>
<p style="line-height: 28px"><strong>配置向导可以帮助你完成以下基础设置：</strong></p>
<ul>
 <li>
  <p style="">选择网关后端（Claude、Gemini 等）</p>
 </li>
 <li>
  <p style="">配置 Feishu、Telegram 等渠道</p>
 </li>
 <li>
  <p style="">生成和保存配置</p>
 </li>
</ul>
<h3 style="" id="%E6%AD%A5%E9%AA%A4-6%EF%BC%9A%E8%AE%BF%E9%97%AE-web-ui"><strong>步骤 6：访问 Web UI</strong></h3>
<p style="line-height: 28px">打开浏览器访问：</p>
<pre><code>http://127.0.0.1:18789/</code></pre>
<p style="line-height: 28px">将配置向导生成的令牌复制到登录页面即可。</p>
<p style="line-height: 28px">如果你有公网IP的话，就用 <code>http://你的公网IP:端口/</code> 访问。</p>
<h1 style="" id="%E4%B8%AA%E4%BA%BA%E8%A7%82%E7%82%B9">个人观点</h1>
<p style="">最后文章的结尾，我附带一些个人的观点，欢迎大家在评论区参与讨论！</p>
<p style="">OpenClaw的出现，无疑是智能体AI的又一大进步。</p>
<p style="">对于一些真正有需求的企业，肯定不敢大规模使用，就算是大规模使用了，也不会没有审核之类的一道防线，只能说继续期待AI发展。</p>
<p style="">对于普通个人而言，我建议玩玩就可以了，不要想着这个东西能挣钱，要知道使用AI的成本就是非常高的，我自己也试了试的，基本上一个很简单的问题，比如问问今天的天气，就能干到10万Tokens左右，这还是正常的，以 <code>Doubao-Seed-2.0-pro</code> 的价格来算，就约为1.6元，实际情况更多，编程一类的，账单更是飞上天了（我试了试开发一个Windows下能用的计算器，AI完成后花费了我23.6元），当你玩久后发现，能干的事多，但真正的能干的事情少，真的太少了，在OpenClaw AI能干的事情，你基本上也能完成，还能省少说10元钱，因为现在的AI不成熟，你永远无法知道AI会给你来上波什么操作。</p>
<p style="">对于有钱，且真的需求效率的，我推荐试一试，真的能快太多。</p>
<p style="">最后的最后，如果你真的决定用了，请随时注意有关OpenClaw的安全升级和漏洞消息，谨防信息泄露等等问题！</p>]]></description><guid isPermaLink="false">/archives/1772877423955</guid><dc:creator>PYM</dc:creator><enclosure url="https://pym.plus/apis/api.storage.halo.run/v1alpha1/thumbnails/-/via-uri?uri=%2Fupload%2F%25E5%25B1%258F%25E5%25B9%2595%25E6%2588%25AA%25E5%259B%25BE%25202026-03-07%2520180331.webp&amp;size=m" type="image/jpeg" length="55602"/><category>AI</category><category>Docker</category><pubDate>Sat, 7 Mar 2026 10:26:53 GMT</pubDate></item></channel></rss>