摘要: //注意边界判断,调了好久#include <iostream> #include <queue> using namespace std; #define check(x,y)(x<wx&&x>=0&&y<hy&&y>=0) struct node { int x, y; }; char room 阅读全文
posted @ 2023-07-30 09:48 Miya555 阅读(25) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> #include <string> #include <queue> #include <stack> using namespace std; int t, n, m; int main() { cin >> t; while (t--) { queue<i 阅读全文
posted @ 2023-07-28 10:39 Miya555 阅读(29) 评论(0) 推荐(0) 编辑
摘要: 朴素的约瑟夫问题,用vector处理即可 #include <iostream> #include <vector> using namespace std; //AHOI1999 圆桌问题 类似于约瑟夫问题 vector<int>table; int n, m; int main() { whil 阅读全文
posted @ 2023-07-28 09:38 Miya555 阅读(35) 评论(0) 推荐(0) 编辑
摘要: UVA10702 Travelling Salesman 题解 题面: 有个旅行的商人,他每到一个的新城市,便卖掉所有东西再购买新东西,从而获得利润。从某城市 A 到某城市 B 有固定利润(B 到 A 的利润可能不同)。已知城市可以重复到达,从 S 点出发,经过 T 个城市,有 E 个城市能作为终点 阅读全文
posted @ 2023-07-27 11:26 Miya555 阅读(14) 评论(0) 推荐(0) 编辑
该文被密码保护。 阅读全文
posted @ 2023-07-11 18:57 Miya555 阅读(16) 评论(2) 推荐(1) 编辑
摘要: 树状数组(Binary Indexed Tree)是一种利用数的二进制特征进行检索的树状结构。 树状数组是一种奇妙的数据结构,不仅非常高效,而且代码及其简洁。 #define lowbit(x) ((x)&-(x)) void add(int x,int d){//更新 while(x<=n){ t 阅读全文
posted @ 2023-05-22 17:14 Miya555 阅读(29) 评论(0) 推荐(0) 编辑
摘要: 让我们来一步一步理解! 以下是源于oiwiki的一些解释: 线段树通过将每个长度不为1的区间划分至左右两个区间。易得,时间复杂度为O(logn)相比树状数组其可操作性更强。 1.向上更新 void push_up(int rt){//向上更新 sum[rt] = sum[rt << 1] + sum 阅读全文
posted @ 2023-05-19 22:01 Miya555 阅读(38) 评论(1) 推荐(0) 编辑
摘要: 等我写完。 普通fhq treap: enum { Maxn = 1000005 }; struct FHQTreap { int lson[Maxn], rson[Maxn], data[Maxn]; int rnd[Maxn], sze[Maxn], root, tot, seed; FHQTr 阅读全文
posted @ 2023-05-16 16:26 Miya555 阅读(14) 评论(0) 推荐(0) 编辑
该文被密码保护。 阅读全文
posted @ 2023-02-18 21:24 Miya555 阅读(5) 评论(0) 推荐(0) 编辑
该文被密码保护。 阅读全文
posted @ 2023-02-03 10:33 Miya555 阅读(4) 评论(0) 推荐(0) 编辑
点击右上角即可分享
微信分享提示
主题色彩