采用分治思想 #include<bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; double a,b,c,d; double f(double x) { return ...
分类:
其他好文 时间:
2020-07-17 13:39:43
阅读次数:
71
LuoguP4279 [SHOI2008]小约翰的游戏 题目描述 链接 Solution Anti-SG的模板题 这里就直接放代码 #include<bits/stdc++.h> using namespace std; inline long long read() { long long f = ...
分类:
其他好文 时间:
2020-07-16 21:44:29
阅读次数:
72
题目链接:https://pintia.cn/problem-sets/994805342720868352/problems/994805363914686464 模拟题,新改的测试数据需要long double型,如果测试点3无法通过,可以参考以下代码: #include<bits/stdc++ ...
分类:
其他好文 时间:
2020-07-16 12:08:19
阅读次数:
60
The Hamming distance between two integers is the number of positions at which the corresponding bits are different. Now your job is to find the total ...
分类:
其他好文 时间:
2020-07-16 12:06:09
阅读次数:
75
1.区间求和 2.区间取模 3.单点修改 线段树,区间取模加一个剪枝:区间最大值<mod,不修改。其他单点取模 #include <bits/stdc++.h> using namespace std; #define debug printf("bug!!!\n"); typedef long l ...
分类:
其他好文 时间:
2020-07-16 11:50:06
阅读次数:
63
一个数最多能取8-9次根号。 #include <bits/stdc++.h> using namespace std; #define debug printf("bug!!!\n"); typedef long long ll; const int MAXN=1e5+10; const ll M ...
分类:
其他好文 时间:
2020-07-16 10:11:53
阅读次数:
74
loj536「LibreOJ Round #6」花札(二分图博弈) loj 题解时间 很明显是二分图博弈。 以某个点为起点,先手必胜的充要条件是起点一定在最大匹配中。 判断方法是看起点到该点的边有流量且该点不在起点割集中。 #include<bits/stdc++.h> using namespac ...
分类:
其他好文 时间:
2020-07-15 23:11:15
阅读次数:
70
https://www.luogu.com.cn/problem/P1036 方法二:二进制枚举+素数筛 1 #include<bits/stdc++.h> 2 using namespace std; 3 int a[25]; 4 const int max_n=10000005; 5 int b ...
分类:
其他好文 时间:
2020-07-15 01:26:17
阅读次数:
76
逆序对目前我所知的有三种解法 首先是最简单的冒泡排序,当每次前面一个数比后面一个数大时就会交换,因此可以用冒泡排序来求逆序对 代码: #include<bits/stdc++.h> using namespace std; int main(){ int n,sum=0; cin>>n; int a ...
分类:
其他好文 时间:
2020-07-14 21:51:19
阅读次数:
65
该算法学习来自 b站 示例代码 1 输出的访问顺序与输入相反 #include <bits/stdc++.h> #define LL long long #define Pi acos(-1.0) #define INF 2147483646 #define eps 1e-9 #define MS ...
分类:
其他好文 时间:
2020-07-14 21:49:52
阅读次数:
72