03 2018 档案
摘要:struct Node{ int cnt; Node *next[26]; bool exist; Node() { cnt = 0; memset(next,0,sizeof(next)); ...
阅读全文
摘要:#include#include#includeusing namespace std;typedef long long ll;ll t[100005>1; build(l,m,rt=L&&r>1; pushdown(rt,m-l+1,r-m)...
阅读全文
摘要:题目很水。主要是学会了怎么重载>>,记录一下。 因为输入的数据要存入变量中,故重载>>的函数参数表中要以引用的方式传参题目链接: https://www.patest.cn/contests/gplt/L1-005代码:#include #include...
阅读全文
摘要:两种优先队列的声明方法 std::priority_queue que; std::priority_queue, cmp> que; 优先队列的top默认是大的,若要小的优先,则要定义一个结构体cmp,将()...
阅读全文
摘要:今天是我第一次用克鲁斯卡尔a题。纪念一下。 kruskal算法是一种贪心算法,它每次取权重最小的边并判断该边的两个端点是否属于同一棵树,显然当端点属于同一棵树时加上这条边会使这棵树出现环,此时舍去该边;当端点不属于同一棵树时,将该边加入树...
阅读全文

浙公网安备 33010602011771号