https://file.floj.tech/export/kCYc2UPJUy078iiYl7Z9 t1 如果长度为偶数则必定满足条件三,所以答案为2^{n/2}。 如果是奇数先分成两半,中间的数为0,2,4,6,8,就是求奇数位偶数位的差分别为这些数有好多种情况,使用容斥计算。 就是计算如果任意 ...
分类:
其他好文 时间:
2020-02-13 23:03:41
阅读次数:
75
「JSOI2015」圈地 "传送门" 显然是最小割。 首先对于所有房子,权值 $ 0$ 的连边 $s \to i$ ,权值 $ include define rg register define file(x) freopen(x".in", "r", stdin), freopen(x".out" ...
分类:
Web程序 时间:
2020-02-13 22:47:31
阅读次数:
96
「AHOI2014/JSOI2014」拼图 "传送门" 看到 $n \times m \le 10^5$ ,考虑根号分治。 对于 $n define rg register define file(x) freopen(x".in", "r", stdin), freopen(x".out", "w ...
分类:
Web程序 时间:
2020-02-04 20:03:50
阅读次数:
80
这题初看题意还是比较友好的,相比于前面几题来说,思路并不是很难想。但是,题目描述误导我了很久,以至于我debug了很久,再次强调英语阅读理解的重要性(认真脸)。不过接下来就是无尽的TLE... 尝试了很多方法,但都没什么用,后来无奈只能查了网上的解法,发现最终的quote都是提前存好的,不是像我要算 ...
分类:
其他好文 时间:
2020-02-04 11:08:17
阅读次数:
89
题目 题目链接:https://gmoj.net/senior/ main/show/3500 给定一张无向图,其中一条边的边权是不定的。接下来$q$组询问,每次给出这条边的边权,输出此时$1\to n$的最短路。 思路 从$1$和$n$开始分别跑一边$dij$。 最终在$dis[1][n],dis ...
分类:
其他好文 时间:
2020-02-03 22:52:56
阅读次数:
145
"A. 【线上训练13】二叉树" 题解:贪心,先求出这两个序列,i在第一个序列位置为$a[i]$,第二个为$b[i]$,如果$a[i] b[i]$, $ans += 2^{a[i] b[i]}$ cpp include include include include include include ...
分类:
其他好文 时间:
2020-01-28 09:34:02
阅读次数:
62
题目链接 https://atcoder.jp/contests/abc153/tasks/abc153_f 题意 : 在坐标轴上有一些怪兽,每个怪兽有对应的生命值hi,你可以对他们进行炮击,你的每次炮击可以队该点前后D范围内的怪兽造成A的伤害,问最少要炮击多少次。 我的最初的想法是先排序,扫到最左 ...
分类:
其他好文 时间:
2020-01-27 17:37:05
阅读次数:
123
源程序: #include <iostream> using namespace std; int main() { int x, count, sum = 0; freopen("c:\\input.txt", "r", stdin); //将标准输入重定向到文件input.txt for (co ...
分类:
其他好文 时间:
2020-01-27 14:06:19
阅读次数:
70
源程序: #include <iostream> using namespace std; int main() { int x, count, sum = 0; freopen("c:\\input.txt", "r", stdin); for (count = 0; count<10; coun ...
分类:
其他好文 时间:
2020-01-27 14:00:25
阅读次数:
65
源程序: #include <iostream> using namespace std; int main() { int x, y; cin >> x >> y; freopen("c:\\test.txt", "w", stdout); if (y == 0) cerr<<"error."<< ...
分类:
其他好文 时间:
2020-01-27 13:56:23
阅读次数:
65