跳到内容
当前位置:首页>考研真题>【复习笔记08】简单并查集

【复习笔记08】简单并查集

  • 2026-09-21 05:53:00
【复习笔记08】简单并查集

08 简单并查集 ★★☆☆☆

并查集(Disjoint Set Union,DSU / Union-Find)用于维护若干互不相交的集合,支持「合并」与「查询」两种操作,是判断连通性、统计连通块、Kruskal 最小生成树、处理传递关系等问题的核心数据结构。

Tips:部分内容由 AI 生成,如发现问题请在评论区留言。

一、基本概念

并查集把每个集合组织成一棵有根树:根节点就是该集合的代表元,树中每个节点指向它的父亲。

  • • 查询 find(x):返回 x 所在集合的代表元(根)。
  • • 合并 merge(x, y):把 x、y 所在的两个集合合并成一个。

用数组 fa[] 存父指针:fa[i] 是节点 i 的父亲;根节点的父亲指向自己。初始时每个元素自成一个集合,即 fa[i] = i

二、朴素实现

初始化

int fa[N];for (int i = 1; i <= n; i++) fa[i] = i;   // 每个点自成一个集合

查找 find(无优化)

沿父指针一直往上走,直到根:

int find(int x){    while (fa[x] != x) x = fa[x];   // 一路往上,直到根    return x;}

最坏情况树退化成一条链,单次 find 可达 

合并 merge(无优化)

把 x 所在集合的根挂到 y 所在集合的根下:

void merge(int x, int y){    int fx = find(x), fy = find(y);    if (fx != fy) fa[fx] = fy;   // x 的根接到 y 的根下面}

三、路径压缩

问题:树可能退化成链,导致 find 很慢。

路径压缩:在 find 的过程中,把路径上的每个节点都直接指向根,这样以后再查就快了。

递归写法(最常用):

int find(int x){    return fa[x] == x ? x : fa[x] = find(fa[x]);   // 递归,顺路把整条链压到根}

迭代写法(避免递归层数过深):

int find(int x){    int r = x;    while (fa[r] != r) r = fa[r];   // 先找到根    while (fa[x] != x) {            // 再把路径上每个点直接挂到根        int t = fa[x];        fa[x] = r;        x = t;    }    return r;}

四、按秩合并与复杂度

另一种优化:合并时把规模小的集合挂到规模大的集合下面,避免树越接越高。

int fa[N], sz[N];   // sz[i] 是 i 所在集合的大小(只对根有意义)for (int i = 1; i <= n; i++) fa[i] = i, sz[i] = 1;int find(int x){    return fa[x] == x ? x : fa[x] = find(fa[x]);}void merge(int x, int y){    int fx = find(x), fy = find(y);    if (fx == fy) return;    if (sz[fx] < sz[fy]) swap(fx, fy);   // 让小集合挂到大集合下    fa[fy] = fx;    sz[fx] += sz[fy];}

复杂度

  • • 只做路径压缩:单次操作均摊 ,绝大多数题目已足够。
  • • 路径压缩 + 按秩合并:单次操作均摊 ,其中  是阿克曼函数的反函数,增长极慢,实际可看作常数。

五、常见应用

  1. 1. 判断连通 / 是否同集合find(x) == find(y)
  2. 2. 统计连通块个数:初始 cnt = n,每次合并成功(fx != fy)时 cnt--
  3. 3. Kruskal 最小生成树:边按权排序,用并查集判断加入一条边是否会成环。
  4. 4. 传递关系:朋友的朋友是朋友,用并查集合并传递闭包。
  5. 5. 逆向思维:删点/删边难处理时,倒过来变成加点/加边(见例题 4)。

六、例题

1. P3367 【模板】并查集

题意:n 个元素,支持两种操作——合并 a、b;查询 a、b 是否在同一集合。

#include <bits/stdc++.h>using namespace std;const int N = 10005;int fa[N];int find(int x){ return fa[x] == x ? x : fa[x] = find(fa[x]); }int main(){    int n, m; cin >> n >> m;    for (int i = 1; i <= n; i++) fa[i] = i;    while (m--) {        int op, x, y; cin >> op >> x >> y;        if (op == 1) fa[find(x)] = find(y);            // 合并        else cout << (find(x) == find(y) ? "Y\n" : "N\n");    }    return 0;}

2. P3958 奶酪

题意:一块高度为 h 的奶酪内有 n 个球形空洞(半径均为 r,给出球心坐标)。问能否从下表面走到上表面——两个球相交或相切即可通过,球与表面相切即可到达表面。

思路:把每个空洞当作节点,相交/相切的球合并;再设两个虚拟节点 0(下表面)、n+1(上表面),球心 z ≤ r 则接下表面,z ≥ h − r 则接上表面。最后看 find(0) == find(n+1)

#include <bits/stdc++.h>using namespace std;const int N = 1005;typedef long long ll;int fa[N];ll x[N], y[N], z[N];int find(int x){ return fa[x] == x ? x : fa[x] = find(fa[x]); }void merge(int a, int b){ fa[find(a)] = find(b); }int main(){    int T; cin >> T;    while (T--) {        int n; ll h, r;        cin >> n >> h >> r;        for (int i = 0; i <= n + 1; i++) fa[i] = i;   // 0 下表面, n+1 上表面        for (int i = 1; i <= n; i++) {            cin >> x[i] >> y[i] >> z[i];            if (z[i] <= r) merge(i, 0);            if (z[i] >= h - r) merge(i, n + 1);        }        for (int i = 1; i <= n; i++)            for (int j = i + 1; j <= n; j++) {                long double dx = (long double)x[i] - x[j];                long double dy = (long double)y[i] - y[j];                long double dz = (long double)z[i] - z[j];                if (dx*dx + dy*dy + dz*dz <= (long double)4*r*r) merge(i, j);            }        cout << (find(0) == find(n + 1) ? "Yes\n" : "No\n");    }    return 0;}

3. P1955 [NOI2015] 程序自动分析

题意:给定 n 个约束,每个形如 i = j(相等)或 i ≠ j(不等),问能否找到一组取值使所有约束同时成立。

思路:先处理所有「相等」约束并合并;再检查所有「不等」约束,若两个变量已在同一集合则矛盾。因为 i、j 可达 ,需要先离散化

#include <bits/stdc++.h>using namespace std;const int N = 2000005;int fa[N];int find(int x){ return fa[x] == x ? x : fa[x] = find(fa[x]); }int main(){    ios::sync_with_stdio(false); cin.tie(nullptr);    int T; cin >> T;    while (T--) {        int n; cin >> n;        vector<array<int,3>> c(n);        vector<int> a;        a.reserve(2 * n);        for (auto &t : c) {            cin >> t[0] >> t[1] >> t[2];            a.push_back(t[0]);            a.push_back(t[1]);        }        sort(a.begin(), a.end());        a.erase(unique(a.begin(), a.end()), a.end());        int m = a.size();        for (int i = 0; i < m; i++) fa[i] = i;        auto id = [&](int v) { return lower_bound(a.begin(), a.end(), v) - a.begin(); };        // 先合并所有"相等"约束        for (auto &t : c) if (t[2] == 1)            fa[find(id(t[0]))] = find(id(t[1]));        // 再检查"不等"约束        bool ok = true;        for (auto &t : c) if (t[2] == 0)            if (find(id(t[0])) == find(id(t[1]))) { ok = false; break; }        cout << (ok ? "YES\n" : "NO\n");    }    return 0;}

4. P1197 [JSOI2008] 星球大战

题意:n 个星球、m 条双向通道,有 k 次攻击,每次摧毁一个星球。求初始连通块数,以及每次攻击后的连通块数。

思路:摧毁点不好处理,反过来——先删掉所有被摧毁的点求连通块数,再倒序「恢复」被摧毁的点,每恢复一个就把它与已恢复的邻点合并。

#include <bits/stdc++.h>using namespace std;const int N = 400005;vector<int> g[N];int fa[N], des[N], vis[N], ans[N];int find(int x){ return fa[x] == x ? x : fa[x] = find(fa[x]); }int main(){    ios::sync_with_stdio(false); cin.tie(nullptr);    int n, m; cin >> n >> m;    for (int i = 0; i < m; i++) {        int u, v; cin >> u >> v;        g[u].push_back(v);        g[v].push_back(u);    }    int k; cin >> k;    for (int i = 1; i <= k; i++) { cin >> des[i]; vis[des[i]] = 1; }    for (int i = 0; i < n; i++) fa[i] = i;    int cnt = n - k;   // 仅存活的点,先各自孤立    for (int u = 0; u < n; u++) if (!vis[u])        for (int v : g[u]) if (!vis[v]) {            int fu = find(u), fv = find(v);            if (fu != fv) { fa[fu] = fv; cnt--; }        }    ans[k + 1] = cnt;    for (int i = k; i >= 1; i--) {        int u = des[i];        vis[u] = 0;   // 恢复        cnt++;        for (int v : g[u]) if (!vis[v]) {            int fu = find(u), fv = find(v);            if (fu != fv) { fa[fu] = fv; cnt--; }        }        ans[i] = cnt;    }    for (int i = 1; i <= k + 1; i++) cout << ans[i] << '\n';    return 0;}

七、总结

  • • 并查集用数组 fa[] 维护一棵树的父指针,根的代表元是自己。
  • • find 加路径压缩,merge 可选按秩合并,两者结合复杂度近似常数。
  • • 应用:判断连通性、统计连通块、Kruskal、传递关系、逆向加点/加边。
基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-09-21 05:55:02 HTTP/1.1 GET : http://www.sjds.net/a/514505.html
  2. 运行时间 : 0.102511s [ 吞吐率:9.76req/s ] 内存消耗:4,511.07kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=e751ce2905e0b50947d565b31a36b0ef
  1. /www/wwwroot/www.sjds.net/public/index.php ( 0.79 KB )
  2. /www/wwwroot/www.sjds.net/vendor/autoload.php ( 0.17 KB )
  3. /www/wwwroot/www.sjds.net/vendor/composer/autoload_real.php ( 2.49 KB )
  4. /www/wwwroot/www.sjds.net/vendor/composer/platform_check.php ( 0.90 KB )
  5. /www/wwwroot/www.sjds.net/vendor/composer/ClassLoader.php ( 14.03 KB )
  6. /www/wwwroot/www.sjds.net/vendor/composer/autoload_static.php ( 4.90 KB )
  7. /www/wwwroot/www.sjds.net/vendor/topthink/think-helper/src/helper.php ( 8.34 KB )
  8. /www/wwwroot/www.sjds.net/vendor/topthink/think-validate/src/helper.php ( 2.19 KB )
  9. /www/wwwroot/www.sjds.net/vendor/topthink/think-orm/src/helper.php ( 1.47 KB )
  10. /www/wwwroot/www.sjds.net/vendor/topthink/think-orm/stubs/load_stubs.php ( 0.16 KB )
  11. /www/wwwroot/www.sjds.net/vendor/topthink/framework/src/think/Exception.php ( 1.69 KB )
  12. /www/wwwroot/www.sjds.net/vendor/topthink/think-container/src/Facade.php ( 2.71 KB )
  13. /www/wwwroot/www.sjds.net/vendor/symfony/deprecation-contracts/function.php ( 0.99 KB )
  14. /www/wwwroot/www.sjds.net/vendor/symfony/polyfill-mbstring/bootstrap.php ( 8.26 KB )
  15. /www/wwwroot/www.sjds.net/vendor/symfony/polyfill-mbstring/bootstrap80.php ( 9.78 KB )
  16. /www/wwwroot/www.sjds.net/vendor/symfony/var-dumper/Resources/functions/dump.php ( 1.49 KB )
  17. /www/wwwroot/www.sjds.net/vendor/topthink/think-dumper/src/helper.php ( 0.18 KB )
  18. /www/wwwroot/www.sjds.net/vendor/symfony/var-dumper/VarDumper.php ( 4.30 KB )
  19. /www/wwwroot/www.sjds.net/vendor/topthink/framework/src/think/App.php ( 15.30 KB )
  20. /www/wwwroot/www.sjds.net/vendor/topthink/think-container/src/Container.php ( 15.76 KB )
  21. /www/wwwroot/www.sjds.net/vendor/psr/container/src/ContainerInterface.php ( 1.02 KB )
  22. /www/wwwroot/www.sjds.net/app/provider.php ( 0.19 KB )
  23. /www/wwwroot/www.sjds.net/vendor/topthink/framework/src/think/Http.php ( 6.04 KB )
  24. /www/wwwroot/www.sjds.net/vendor/topthink/think-helper/src/helper/Str.php ( 7.29 KB )
  25. /www/wwwroot/www.sjds.net/vendor/topthink/framework/src/think/Env.php ( 4.68 KB )
  26. /www/wwwroot/www.sjds.net/app/common.php ( 0.03 KB )
  27. /www/wwwroot/www.sjds.net/vendor/topthink/framework/src/helper.php ( 18.78 KB )
  28. /www/wwwroot/www.sjds.net/vendor/topthink/framework/src/think/Config.php ( 5.54 KB )
  29. /www/wwwroot/www.sjds.net/config/app.php ( 0.95 KB )
  30. /www/wwwroot/www.sjds.net/config/cache.php ( 0.78 KB )
  31. /www/wwwroot/www.sjds.net/config/console.php ( 0.23 KB )
  32. /www/wwwroot/www.sjds.net/config/cookie.php ( 0.56 KB )
  33. /www/wwwroot/www.sjds.net/config/database.php ( 2.48 KB )
  34. /www/wwwroot/www.sjds.net/vendor/topthink/framework/src/think/facade/Env.php ( 1.67 KB )
  35. /www/wwwroot/www.sjds.net/config/filesystem.php ( 0.61 KB )
  36. /www/wwwroot/www.sjds.net/config/lang.php ( 0.91 KB )
  37. /www/wwwroot/www.sjds.net/config/log.php ( 1.35 KB )
  38. /www/wwwroot/www.sjds.net/config/middleware.php ( 0.19 KB )
  39. /www/wwwroot/www.sjds.net/config/route.php ( 1.89 KB )
  40. /www/wwwroot/www.sjds.net/config/session.php ( 0.57 KB )
  41. /www/wwwroot/www.sjds.net/config/trace.php ( 0.34 KB )
  42. /www/wwwroot/www.sjds.net/config/view.php ( 0.82 KB )
  43. /www/wwwroot/www.sjds.net/app/event.php ( 0.25 KB )
  44. /www/wwwroot/www.sjds.net/vendor/topthink/framework/src/think/Event.php ( 7.67 KB )
  45. /www/wwwroot/www.sjds.net/app/service.php ( 0.13 KB )
  46. /www/wwwroot/www.sjds.net/app/AppService.php ( 0.26 KB )
  47. /www/wwwroot/www.sjds.net/vendor/topthink/framework/src/think/Service.php ( 1.64 KB )
  48. /www/wwwroot/www.sjds.net/vendor/topthink/framework/src/think/Lang.php ( 7.35 KB )
  49. /www/wwwroot/www.sjds.net/vendor/topthink/framework/src/lang/zh-cn.php ( 13.70 KB )
  50. /www/wwwroot/www.sjds.net/vendor/topthink/framework/src/think/initializer/Error.php ( 3.31 KB )
  51. /www/wwwroot/www.sjds.net/vendor/topthink/framework/src/think/initializer/RegisterService.php ( 1.33 KB )
  52. /www/wwwroot/www.sjds.net/vendor/services.php ( 0.14 KB )
  53. /www/wwwroot/www.sjds.net/vendor/topthink/framework/src/think/service/PaginatorService.php ( 1.52 KB )
  54. /www/wwwroot/www.sjds.net/vendor/topthink/framework/src/think/service/ValidateService.php ( 0.99 KB )
  55. /www/wwwroot/www.sjds.net/vendor/topthink/framework/src/think/service/ModelService.php ( 2.04 KB )
  56. /www/wwwroot/www.sjds.net/vendor/topthink/think-trace/src/Service.php ( 0.77 KB )
  57. /www/wwwroot/www.sjds.net/vendor/topthink/framework/src/think/Middleware.php ( 6.72 KB )
  58. /www/wwwroot/www.sjds.net/vendor/topthink/framework/src/think/initializer/BootService.php ( 0.77 KB )
  59. /www/wwwroot/www.sjds.net/vendor/topthink/think-orm/src/Paginator.php ( 11.86 KB )
  60. /www/wwwroot/www.sjds.net/vendor/topthink/think-validate/src/Validate.php ( 63.20 KB )
  61. /www/wwwroot/www.sjds.net/vendor/topthink/think-orm/src/Model.php ( 23.55 KB )
  62. /www/wwwroot/www.sjds.net/vendor/topthink/think-orm/src/model/concern/Attribute.php ( 21.05 KB )
  63. /www/wwwroot/www.sjds.net/vendor/topthink/think-orm/src/model/concern/AutoWriteData.php ( 4.21 KB )
  64. /www/wwwroot/www.sjds.net/vendor/topthink/think-orm/src/model/concern/Conversion.php ( 6.44 KB )
  65. /www/wwwroot/www.sjds.net/vendor/topthink/think-orm/src/model/concern/DbConnect.php ( 5.16 KB )
  66. /www/wwwroot/www.sjds.net/vendor/topthink/think-orm/src/model/concern/ModelEvent.php ( 2.33 KB )
  67. /www/wwwroot/www.sjds.net/vendor/topthink/think-orm/src/model/concern/RelationShip.php ( 28.29 KB )
  68. /www/wwwroot/www.sjds.net/vendor/topthink/think-helper/src/contract/Arrayable.php ( 0.09 KB )
  69. /www/wwwroot/www.sjds.net/vendor/topthink/think-helper/src/contract/Jsonable.php ( 0.13 KB )
  70. /www/wwwroot/www.sjds.net/vendor/topthink/think-orm/src/model/contract/Modelable.php ( 0.09 KB )
  71. /www/wwwroot/www.sjds.net/vendor/topthink/framework/src/think/Db.php ( 2.88 KB )
  72. /www/wwwroot/www.sjds.net/vendor/topthink/think-orm/src/DbManager.php ( 8.52 KB )
  73. /www/wwwroot/www.sjds.net/vendor/topthink/framework/src/think/Log.php ( 6.28 KB )
  74. /www/wwwroot/www.sjds.net/vendor/topthink/framework/src/think/Manager.php ( 3.92 KB )
  75. /www/wwwroot/www.sjds.net/vendor/psr/log/src/LoggerTrait.php ( 2.69 KB )
  76. /www/wwwroot/www.sjds.net/vendor/psr/log/src/LoggerInterface.php ( 2.71 KB )
  77. /www/wwwroot/www.sjds.net/vendor/topthink/framework/src/think/Cache.php ( 4.92 KB )
  78. /www/wwwroot/www.sjds.net/vendor/psr/simple-cache/src/CacheInterface.php ( 4.71 KB )
  79. /www/wwwroot/www.sjds.net/vendor/topthink/think-helper/src/helper/Arr.php ( 16.63 KB )
  80. /www/wwwroot/www.sjds.net/vendor/topthink/framework/src/think/cache/driver/File.php ( 7.84 KB )
  81. /www/wwwroot/www.sjds.net/vendor/topthink/framework/src/think/cache/Driver.php ( 9.03 KB )
  82. /www/wwwroot/www.sjds.net/vendor/topthink/framework/src/think/contract/CacheHandlerInterface.php ( 1.99 KB )
  83. /www/wwwroot/www.sjds.net/app/Request.php ( 0.09 KB )
  84. /www/wwwroot/www.sjds.net/vendor/topthink/framework/src/think/Request.php ( 55.78 KB )
  85. /www/wwwroot/www.sjds.net/app/middleware.php ( 0.25 KB )
  86. /www/wwwroot/www.sjds.net/vendor/topthink/framework/src/think/Pipeline.php ( 2.61 KB )
  87. /www/wwwroot/www.sjds.net/vendor/topthink/think-trace/src/TraceDebug.php ( 3.40 KB )
  88. /www/wwwroot/www.sjds.net/vendor/topthink/framework/src/think/middleware/SessionInit.php ( 1.94 KB )
  89. /www/wwwroot/www.sjds.net/vendor/topthink/framework/src/think/Session.php ( 1.80 KB )
  90. /www/wwwroot/www.sjds.net/vendor/topthink/framework/src/think/session/driver/File.php ( 6.27 KB )
  91. /www/wwwroot/www.sjds.net/vendor/topthink/framework/src/think/contract/SessionHandlerInterface.php ( 0.87 KB )
  92. /www/wwwroot/www.sjds.net/vendor/topthink/framework/src/think/session/Store.php ( 7.12 KB )
  93. /www/wwwroot/www.sjds.net/vendor/topthink/framework/src/think/Route.php ( 23.73 KB )
  94. /www/wwwroot/www.sjds.net/vendor/topthink/framework/src/think/route/RuleName.php ( 5.75 KB )
  95. /www/wwwroot/www.sjds.net/vendor/topthink/framework/src/think/route/Domain.php ( 2.53 KB )
  96. /www/wwwroot/www.sjds.net/vendor/topthink/framework/src/think/route/RuleGroup.php ( 22.43 KB )
  97. /www/wwwroot/www.sjds.net/vendor/topthink/framework/src/think/route/Rule.php ( 26.95 KB )
  98. /www/wwwroot/www.sjds.net/vendor/topthink/framework/src/think/route/RuleItem.php ( 9.78 KB )
  99. /www/wwwroot/www.sjds.net/route/app.php ( 1.72 KB )
  100. /www/wwwroot/www.sjds.net/vendor/topthink/framework/src/think/facade/Route.php ( 4.70 KB )
  101. /www/wwwroot/www.sjds.net/vendor/topthink/framework/src/think/route/dispatch/Controller.php ( 4.74 KB )
  102. /www/wwwroot/www.sjds.net/vendor/topthink/framework/src/think/route/Dispatch.php ( 10.44 KB )
  103. /www/wwwroot/www.sjds.net/app/controller/Index.php ( 4.81 KB )
  104. /www/wwwroot/www.sjds.net/app/BaseController.php ( 2.05 KB )
  105. /www/wwwroot/www.sjds.net/vendor/topthink/think-orm/src/facade/Db.php ( 0.93 KB )
  106. /www/wwwroot/www.sjds.net/vendor/topthink/think-orm/src/db/connector/Mysql.php ( 5.44 KB )
  107. /www/wwwroot/www.sjds.net/vendor/topthink/think-orm/src/db/PDOConnection.php ( 52.47 KB )
  108. /www/wwwroot/www.sjds.net/vendor/topthink/think-orm/src/db/Connection.php ( 8.39 KB )
  109. /www/wwwroot/www.sjds.net/vendor/topthink/think-orm/src/db/ConnectionInterface.php ( 4.57 KB )
  110. /www/wwwroot/www.sjds.net/vendor/topthink/think-orm/src/db/builder/Mysql.php ( 16.58 KB )
  111. /www/wwwroot/www.sjds.net/vendor/topthink/think-orm/src/db/Builder.php ( 24.06 KB )
  112. /www/wwwroot/www.sjds.net/vendor/topthink/think-orm/src/db/BaseBuilder.php ( 27.50 KB )
  113. /www/wwwroot/www.sjds.net/vendor/topthink/think-orm/src/db/Query.php ( 15.71 KB )
  114. /www/wwwroot/www.sjds.net/vendor/topthink/think-orm/src/db/BaseQuery.php ( 45.13 KB )
  115. /www/wwwroot/www.sjds.net/vendor/topthink/think-orm/src/db/concern/TimeFieldQuery.php ( 7.43 KB )
  116. /www/wwwroot/www.sjds.net/vendor/topthink/think-orm/src/db/concern/AggregateQuery.php ( 3.26 KB )
  117. /www/wwwroot/www.sjds.net/vendor/topthink/think-orm/src/db/concern/ModelRelationQuery.php ( 20.07 KB )
  118. /www/wwwroot/www.sjds.net/vendor/topthink/think-orm/src/db/concern/ParamsBind.php ( 3.66 KB )
  119. /www/wwwroot/www.sjds.net/vendor/topthink/think-orm/src/db/concern/ResultOperation.php ( 7.01 KB )
  120. /www/wwwroot/www.sjds.net/vendor/topthink/think-orm/src/db/concern/WhereQuery.php ( 19.37 KB )
  121. /www/wwwroot/www.sjds.net/vendor/topthink/think-orm/src/db/concern/JoinAndViewQuery.php ( 7.11 KB )
  122. /www/wwwroot/www.sjds.net/vendor/topthink/think-orm/src/db/concern/TableFieldInfo.php ( 2.63 KB )
  123. /www/wwwroot/www.sjds.net/vendor/topthink/think-orm/src/db/concern/Transaction.php ( 2.77 KB )
  124. /www/wwwroot/www.sjds.net/vendor/topthink/framework/src/think/log/driver/File.php ( 5.96 KB )
  125. /www/wwwroot/www.sjds.net/vendor/topthink/framework/src/think/contract/LogHandlerInterface.php ( 0.86 KB )
  126. /www/wwwroot/www.sjds.net/vendor/topthink/framework/src/think/log/Channel.php ( 3.89 KB )
  127. /www/wwwroot/www.sjds.net/vendor/topthink/framework/src/think/event/LogRecord.php ( 1.02 KB )
  128. /www/wwwroot/www.sjds.net/vendor/topthink/think-helper/src/Collection.php ( 16.47 KB )
  129. /www/wwwroot/www.sjds.net/vendor/topthink/framework/src/think/facade/View.php ( 1.70 KB )
  130. /www/wwwroot/www.sjds.net/vendor/topthink/framework/src/think/View.php ( 4.39 KB )
  131. /www/wwwroot/www.sjds.net/vendor/topthink/framework/src/think/Response.php ( 8.81 KB )
  132. /www/wwwroot/www.sjds.net/vendor/topthink/framework/src/think/response/View.php ( 3.29 KB )
  133. /www/wwwroot/www.sjds.net/vendor/topthink/framework/src/think/Cookie.php ( 6.06 KB )
  134. /www/wwwroot/www.sjds.net/vendor/topthink/think-view/src/Think.php ( 8.38 KB )
  135. /www/wwwroot/www.sjds.net/vendor/topthink/framework/src/think/contract/TemplateHandlerInterface.php ( 1.60 KB )
  136. /www/wwwroot/www.sjds.net/vendor/topthink/think-template/src/Template.php ( 46.61 KB )
  137. /www/wwwroot/www.sjds.net/vendor/topthink/think-template/src/template/driver/File.php ( 2.41 KB )
  138. /www/wwwroot/www.sjds.net/vendor/topthink/think-template/src/template/contract/DriverInterface.php ( 0.86 KB )
  139. /www/wwwroot/www.sjds.net/runtime/temp/022a5b1eae5a9e3c31e54f699d8ae600.php ( 8.05 KB )
  140. /www/wwwroot/www.sjds.net/vendor/topthink/think-trace/src/Html.php ( 4.42 KB )
  1. CONNECT:[ UseTime:0.000659s ] mysql:host=172.18.0.4;port=3306;dbname=www_sjds;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.000899s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.000383s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.000360s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.000470s ]
  6. SELECT * FROM `set` [ RunTime:0.000268s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.000638s ]
  8. SELECT * FROM `article` WHERE `id` = 514505 LIMIT 1 [ RunTime:0.000378s ]
  9. UPDATE `article` SET `lasttime` = 1789941302 WHERE `id` = 514505 [ RunTime:0.003172s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 65 LIMIT 1 [ RunTime:0.000352s ]
  11. SELECT * FROM `article` WHERE `id` < 514505 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.000503s ]
  12. SELECT * FROM `article` WHERE `id` > 514505 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.000361s ]
  13. SELECT * FROM `article` WHERE `id` < 514505 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.000618s ]
  14. SELECT * FROM `article` WHERE `id` < 514505 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.000637s ]
  15. SELECT * FROM `article` WHERE `id` < 514505 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.000717s ]
0.111916s