1 #include<bits/stdc++.h> 2 using namespace std; 3 int tot,n,m,s,ver[2*5000010],head[2*500010],nxt[2*500010],f[500010][30],d[500010]; 4 void add(int x ...
分类:
其他好文 时间:
2020-07-25 23:16:25
阅读次数:
65
本题没有无解情况,因为这题本质上可以通过二进制叠加,并且我们知道所有数都能被这样表示 对于有解情况,显然每次跳跃的越多越好,但是这是有限制的,一个分裂的总数不能超过当前的个数 第二个是当前分裂完后,要保证第二天分裂结果不能超过总答案,否则无法到达。 #include<bits/stdc++.h> u ...
分类:
其他好文 时间:
2020-07-25 09:48:04
阅读次数:
73
水个题解压压惊 A. String Transformation 1 贪心就好了。每次选择所有A里最小的、需要改变的字符,然后改变成最小的对应B值,差不多这个意思吧(?) #include <bits/stdc++.h> using namespace std; #define repeat(i,a ...
分类:
其他好文 时间:
2020-07-25 09:14:40
阅读次数:
91
题意: 每次操作可以输入一个颜色,然后所有这个颜色的点使相邻的点都变成这个颜色,最后输出每个点是什么颜色。 题解: 对每个节点开一个链表,存储与这个节点相邻的节点。 然后对于每次操作,把节点周围的节点全都变成相同颜色的节点,然后清空这些节点对应的链表,把链表接到父节点下。 #include<bits ...
分类:
其他好文 时间:
2020-07-24 22:09:46
阅读次数:
80
比赛链接:https://codeforces.com/contest/1390 A. 123-sequence 题意 给出一个只含有 $1,2,3$ 的数组,问使所有元素相同至少要替换多少元素。 题解 统计数组中出现次数最多的元素即可。 代码 #include <bits/stdc++.h> us ...
分类:
其他好文 时间:
2020-07-24 21:43:12
阅读次数:
67
题目链接 树哈希直接套就完了 1 #include<bits/stdc++.h> 2 using namespace std; 3 typedef unsigned long long ll; 4 const int N=1e5+10,M=19260817,inf=0x3f3f3f3f,mod=1e ...
分类:
编程语言 时间:
2020-07-24 16:00:39
阅读次数:
74
#include <bits/stdc++.h> using namespace std; const int N = 55; #define ll long long char c[N], o[N], a[N], b[N]; int n, m, val; ll d[N][N], f[N][N]; ...
分类:
其他好文 时间:
2020-07-24 10:07:53
阅读次数:
100
#T1 数学问题,考试时没yy出公式,用滚动数组瞎搞了一个$50$%的暴力。 暴力代码找不见了,贴正解吧。 #include <bits/stdc++.h> using namespace std; const int mod = 998244353; #define ll long long in ...
分类:
其他好文 时间:
2020-07-23 23:30:31
阅读次数:
133
先挖坑,过几天填 https://www.luogu.com.cn/training/14535#problems 可持久化数组 P3919 【模板】可持久化线段树 1(可持久化数组) #include<bits/stdc++.h> using namespace std; const int ma ...
分类:
其他好文 时间:
2020-07-23 23:30:13
阅读次数:
112
二分查找 #include<bits/stdc++.h> using namespace std; const int maxn = 2e5+5; long long a[maxn], b[maxn]; long long getKth(int k, int lo1, int hi1, int lo ...
分类:
其他好文 时间:
2020-07-23 23:22:49
阅读次数:
76