随笔分类 - kuangbin
摘要:1. HDU1166 敌兵布阵 题目链接 题意:单点更新+区间查询(求和)。 树状数组 (218ms) #include <iostream> #include <cstdio> #include <algorithm> #include <cstring> #include <cmath> usi
阅读全文
摘要:Krusal 时间复杂度 \(O(m\log m)\) Prim 时间复杂度 \(O(n^2)\),二叉堆优化至 \(O(m\log n)\)。Prim 主要用于稠密图。 1. POJ1251 Jungle Roads 题目链接 题意:给出 n 个村庄,n - 1 个村庄连接的村庄以及道路及其每月维
阅读全文
摘要:1. POJ2236 Wireless Network 题目链接 题意:给出 n 个坏计算机的坐标,两台计算机直接通信最大距离 d,两种操作 "O p"$(1\le p\le n)$表示修复计算机 p. "S p q"$(1\le p,q\le n)$表示 O 操作,判断与被修理过的所有计算机能否通
阅读全文
摘要:1. POJ2387 Til the Cows Come Home 题目链接 题意:在一个无向图中,求点 n 到点 1 的最短路径。 用邻接表 dijkstra 即可不需要考虑重边。 #include <iostream> #include <cstdio> #include <algorithm>
阅读全文
摘要:1. POJ1321 棋盘问题 题目链接 题意:在给定形状的棋盘上摆无区别棋子,任意两棋子不同行或同列,求摆 k 个棋子所有方案数。 #include <iostream> #include <cstdio> using namespace std; #define debug(x) cout <<
阅读全文

浙公网安备 33010602011771号