题:http://acm.hdu.edu.cn/showproblem.php?pid=6725 分析:给节点选值肯定是选边界值。假设由节点是选中间值,那么肯定有比它选值更好的值,所以把选的可能定为2个。 #include<bits/stdc++.h> using namespace std; #d ...
分类:
其他好文 时间:
2020-07-20 00:01:14
阅读次数:
96
太难了 #A 接着A题漏判好多, 真不如枚举简单 看代码吧, 一般是漏情况wa #include <bits/stdc++.h> #define all(n) (n).begin(), (n).end() #define se second #define fi first #define pb p ...
分类:
其他好文 时间:
2020-07-19 21:13:04
阅读次数:
218
最长上升子序列 思路: 去过前面的数字小于当前数字,当前数字直接加入 否则 找到数组里面第一个>它的数字替换上 1 #include<bits/stdc++.h> 2 3 using namespace std; 4 int n,a; 5 vector<int> ve; 6 int main() { ...
分类:
其他好文 时间:
2020-07-19 11:44:52
阅读次数:
52
C. Operation Love 先判断给定点是顺时针还是逆时针,然后再判断长度为6的边是在长度为9的边的左边还是右边即可 // Created by CAD #include <bits/stdc++.h> using namespace std; bool judge(vector<doubl ...
分类:
其他好文 时间:
2020-07-19 11:31:44
阅读次数:
76
split() 方法用于把一个字符串分割成字符串数组。 reverse() 方法用于颠倒数组中元素的顺序。 join() 方法用于把数组中的所有元素放入一个字符串。 ...
分类:
其他好文 时间:
2020-07-19 00:41:27
阅读次数:
110
跑ac自动机后使用fail树建立dfs序后跑树状数组维护答案 #include<bits/stdc++.h> using namespace std; typedef long long ll; const int N=1e6+10; struct node{ int cnt; node * nxt ...
分类:
其他好文 时间:
2020-07-19 00:37:01
阅读次数:
84
卢卡斯定理 求组合数: 模板题:P3807 【模板】卢卡斯定理:https://www.luogu.com.cn/problem/P3807 #include<bits/stdc++.h> #define INF 0x3f3f3f3f #define DOF 0x7f7f7f7f #define e ...
分类:
其他好文 时间:
2020-07-18 22:59:48
阅读次数:
107
#include<bits/stdc++.h> using namespace std; typedef long long ll; const int maxn=3e5+100; const int mod=998244353; ll fpow (int x,int y) { ll ans=1; ...
分类:
其他好文 时间:
2020-07-18 22:52:12
阅读次数:
105
A 根据性质,\(a,b,c\) 中的最大值一定会在 $x,y,z $ 中出现两次 #include <bits/stdc++.h> using namespace std; int main() { int t; cin >> t; int a[3]; while(t --) { memset(a ...
分类:
其他好文 时间:
2020-07-18 22:42:22
阅读次数:
86
#include<bits/stdc++.h> using namespace std; typedef long long ll; const int maxn=105; const int mod=1e9+7; int n; struct matrix { ll a[maxn][maxn]; m ...
分类:
其他好文 时间:
2020-07-18 22:14:26
阅读次数:
75