[2020.12.4周五] 圆上对称博弈 1451D - Circle Game 题解:注意到后手总可以使点走在(k,k)上,所以如果(k,k)是必胜态,则后手胜;否则先手总可以使(n*k+k,k)上,如果这是必胜态则先手赢 tag:对称博弈 #include<bits/stdc++.h> usin ...
分类:
其他好文 时间:
2020-12-09 12:15:50
阅读次数:
5
1.不能被重载的运算符在C++中,不能被重载的运算符有:?.成员运算符?.*成员指针运算符?::作用域运算符??:条件运算符2.神奇的变量名y1显示变量y1和C++标准库中的某个变量名称冲突,这个问题应当引起注意。这不是头文件写成<bits/stdc++.h>引起的,即使换成各具体的头文件(<iostream>,<algorithm>,<ctring>
分类:
编程语言 时间:
2020-12-05 10:27:02
阅读次数:
9
题目来源 https://codeforces.ml/contest/1457 A:Prison Break 给一个n*m的矩阵,问这个矩阵上到(a, b)距离最远的距离是多少? 思路分析 找四个角即可。 #include <bits/stdc++.h> using namespace std; i ...
分类:
其他好文 时间:
2020-12-04 11:49:25
阅读次数:
22
01背包问题。 与模板不同,这道题要求的是最小剩余空间,也就是求背包里最多能放多少东西。 所以状态转移方程变为 fi= fi - w[i] + wi 。 其中 fi 表示当背包容量为 i 时可放的最大重量。 注意要倒着循环。 #include<bits/stdc++.h> using namespa ...
分类:
其他好文 时间:
2020-12-03 11:59:56
阅读次数:
3
手动O(2)优化 #pragma GCC optimize(2) 对拍程序 先🐎一份数据生成程序 以a+b为例 #include <bits/stdc++.h> using namespace std; int main() { srand( time( 0 ) ); freopen( "data ...
分类:
其他好文 时间:
2020-12-03 11:36:16
阅读次数:
5
数据结构实验之排序四:寻找大富翁 Code: 1 #include <bits/stdc++.h> 2 using namespace std; 3 const int maxn = 1010; 4 const int minn = -10001; 5 6 int a[25]; 7 int n,m; ...
分类:
编程语言 时间:
2020-12-02 12:03:32
阅读次数:
6
基环树 基环树直径 P3248 #include<bits/stdc++.h> using namespace std; #define ll long long const int N=1e5+5; int n; int te,v[N<<1],pre[N<<1],tail[N]; ll L,len ...
分类:
其他好文 时间:
2020-12-01 12:29:19
阅读次数:
7
1 #include <bits/stdc++.h> 2 using namespace std; 3 int main() { 4 int t; 5 cin >> t; 6 while (t--) { 7 int a, b; 8 string a_line, b_line; 9 cin >> a ...
分类:
其他好文 时间:
2020-11-30 15:20:06
阅读次数:
5
###链接 贴一下青君大佬的博客~ #include<bits/stdc++.h> #define IL inline #define LL long long #define pb push_back #define pi pair<int,int> #define mk make_pair us ...
分类:
其他好文 时间:
2020-11-27 11:15:36
阅读次数:
6
https://www.luogu.com.cn/problem/P3366 1 #define IO std::ios::sync_with_stdio(0) 2 #include <bits/stdc++.h> 3 #define pb push_back 4 using namespace s ...
分类:
其他好文 时间:
2020-11-26 15:24:23
阅读次数:
48