摘要: P3366 【模板】最小生成树 #include <bits/stdc++.h> using namespace std; const int nn = 5010; const int mm = 2e5 + 5; int n,m,fa[nn]; int ans,cnt; struct node{ i 阅读全文
posted @ 2020-02-09 20:34 Hazelxcf 阅读(78) 评论(0) 推荐(0)
摘要: P4779 【模板】单源最短路径(标准版 #include <bits/stdc++.h> using namespace std; const int nn = 1e5 + 5; const int mm = 2e5 + 5; int d[nn],head[nn],ver[mm],edge[mm] 阅读全文
posted @ 2020-02-09 19:45 Hazelxcf 阅读(110) 评论(0) 推荐(0)
摘要: https://www.luogu.com.cn/problem/P2024 创建三个集合,1同类域,2捕食域,3天敌域 x y是同类,说明x1-y1,x2-y2,x3-y3; x吃y 说明x捕食的物种是y的同类(x2 - y1),x是y的天敌(x3-y2) op = 1的时候,说明x,y是同类,与 阅读全文
posted @ 2020-02-09 10:43 Hazelxcf 阅读(127) 评论(0) 推荐(0)
摘要: 这一部分的功能和树状数组一样,这里是树状数组的模板 除了求和之外,还能解决区间最小最大值,区间染色 1 单点修改,区间查询 P3374 【模板】树状数组 1 #include <bits/stdc++.h> using namespace std; #define int long long con 阅读全文
posted @ 2020-02-06 22:11 Hazelxcf 阅读(95) 评论(0) 推荐(0)
摘要: 这一部分和线段树基础的功能一样 线段树模板的链接 lowbit(x)覆盖长度 c[x]的父节点t[x + lowbit(x)] 单点修改 区间查询 P3374 【模板】树状数组 1 1 #include <bits/stdc++.h> 2 3 using namespace std; 4 #defi 阅读全文
posted @ 2020-02-06 10:54 Hazelxcf 阅读(77) 评论(0) 推荐(0)
摘要: C: 组合数 题目描述 从 1 到 N 的整数中挑选一些数,组成集合的方案数是可算的。如果加上 M 个限制:某 2 个数不能 同时选又要怎样计算? 输入 第一行包含 2 个整数 N 和 M,1≤N≤20,1≤M≤400。 下面 M 行,每行 2 个不同的整数 a 和 b 表示这 2 个数不能同时选。 阅读全文
posted @ 2020-02-05 19:39 Hazelxcf 阅读(236) 评论(0) 推荐(0)
摘要: 给一个字符串 T,问在字符串 T 中可以包含最多多少个不重叠的字符串 S。 字符串中的每个字符为小写或者大写字母。 输入 第一行输入一个字符串 S。 第二行输入一个字符串 T。 输出 输出一行,包括一个整数表示答案。 样例输入 Copy Aba Abababa 样例输出 Copy 1 提示 50%的 阅读全文
posted @ 2020-02-05 17:10 Hazelxcf 阅读(184) 评论(0) 推荐(0)
摘要: D: 找素数 题目描述 素数又称质数,是指一个大于 1 的正整数,如果除了 1 和它本身以外,不能再被其它的数整除, 例如:2、3、5、97 等都是素数。2 是最小的素数。 现在,给你 n 个数字,请你从中选取一部分,用它们拼出一个最大的素数。 注意:某个数字出现多少次你就可以用多少次,6 与 9 阅读全文
posted @ 2020-02-04 23:19 Hazelxcf 阅读(151) 评论(0) 推荐(0)
摘要: 问题 I: Anti-Division(容斥原理) 题目描述 You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly 阅读全文
posted @ 2020-02-04 20:20 Hazelxcf 阅读(174) 评论(0) 推荐(0)
摘要: map #include <bits/stdc++.h> using namespace std; #define int long long map<char,string> mp; signed main() { ios::sync_with_stdio(0); mp['0'] = "0000" 阅读全文
posted @ 2020-02-01 19:13 Hazelxcf 阅读(215) 评论(0) 推荐(0)