摘要: 复变函数积分 设 \(\gamma:[a,b]\to\mathbb{C}\) 为一条可求长曲线,取分点 \(a=z_0,z_1,\cdots,z_n=b\),把 \(\gamma\) 分成 \(n\) 小段,第 \(k\) 段记做 \(\gamma_k\),在 \(\gamma_k\) 上取点 \( 阅读全文
posted @ 2020-11-08 00:50 2inf 阅读(988) 评论(0) 推荐(0)
摘要: A Finding Sasuke 题意:给出长度为 \(n\) 的序列 \(a_i(i=1,2,\cdots,n,0<|a_i|\le100)\),求 \(b_i(i=1,2,\cdots,n,0<|b_i|\le100)\) 使得 \(\sum_{i=1}^na_ib_i=0\)。 #includ 阅读全文
posted @ 2020-10-28 23:00 2inf 阅读(119) 评论(0) 推荐(0)
摘要: 1. HDU1166 敌兵布阵 题目链接 题意:单点更新+区间查询(求和)。 树状数组 (218ms) #include <iostream> #include <cstdio> #include <algorithm> #include <cstring> #include <cmath> usi 阅读全文
posted @ 2020-10-24 12:57 2inf 阅读(69) 评论(0) 推荐(0)
摘要: Krusal 时间复杂度 \(O(m\log m)\) Prim 时间复杂度 \(O(n^2)\),二叉堆优化至 \(O(m\log n)\)。Prim 主要用于稠密图。 1. POJ1251 Jungle Roads 题目链接 题意:给出 n 个村庄,n - 1 个村庄连接的村庄以及道路及其每月维 阅读全文
posted @ 2020-10-19 15:27 2inf 阅读(80) 评论(0) 推荐(0)
摘要: 题目链接 题意 对于给出的 \(n\) 个询问,每次求有多少个数对 \((x,y)\),满足 \(a \le x \le b,c \le y \le d\),且 \(\gcd(x,y) = k\),\(\gcd(x,y)\) 函数为 \(x\) 和 \(y\) 的最大公约数。 要求 \(\sum_{ 阅读全文
posted @ 2020-09-29 00:17 2inf 阅读(75) 评论(0) 推荐(0)
摘要: A Subset Mex 题意:将给定集合分成 \(A,B\) 两份,\(mex(S)\) 表示集合 \(S\) 中未出现的最小非负整数,求 \(\max{mex(A)+mex(B)}\)。 \(v_i\) 表示 \(i(0\le i\le100)\) 的个数,所有只出现一次的放入 \(B\) 中, 阅读全文
posted @ 2020-09-13 23:45 2inf 阅读(114) 评论(0) 推荐(0)
摘要: 1. POJ2236 Wireless Network 题目链接 题意:给出 n 个坏计算机的坐标,两台计算机直接通信最大距离 d,两种操作 "O p"$(1\le p\le n)$表示修复计算机 p. "S p q"$(1\le p,q\le n)$表示 O 操作,判断与被修理过的所有计算机能否通 阅读全文
posted @ 2020-09-07 23:53 2inf 阅读(141) 评论(0) 推荐(0)
摘要: 1. POJ2387 Til the Cows Come Home 题目链接 题意:在一个无向图中,求点 n 到点 1 的最短路径。 用邻接表 dijkstra 即可不需要考虑重边。 #include <iostream> #include <cstdio> #include <algorithm> 阅读全文
posted @ 2020-08-30 18:11 2inf 阅读(206) 评论(0) 推荐(0)
摘要: 1. POJ1321 棋盘问题 题目链接 题意:在给定形状的棋盘上摆无区别棋子,任意两棋子不同行或同列,求摆 k 个棋子所有方案数。 #include <iostream> #include <cstdio> using namespace std; #define debug(x) cout << 阅读全文
posted @ 2020-08-22 23:55 2inf 阅读(131) 评论(0) 推荐(0)
摘要: "题目链接" 题意 给出$n$个点$m$条边的无向图与$k$个特殊点,要在两个特殊点间添加一条边,求从$1$到$n$最短路的最大值。 题解 $p_i$表示从$1$出发到$i$的最短路,$q_i$表示从$n$出发到$i$的最短路。选择两个特殊点$a$和$b$使$\min(p_a+q_b+1,q_a+p 阅读全文
posted @ 2020-05-05 22:52 2inf 阅读(144) 评论(0) 推荐(0)