HDU - 2157 构造矩阵,用于转移走一步的情况。 若$i$能走到$j$,则$g[j][i]=1$,否则为$0$ 然后一开始只有$A$点累计有一种走法。 所以最后计算矩阵的$k$次方,输出$g[B][A]$即可。 #include<bits/stdc++.h> using namespace s ...
分类:
其他好文 时间:
2020-07-21 22:30:21
阅读次数:
61
https://www.luogu.com.cn/problem/P1030 1 #define bug(x) cout<<#x<<" is "<<x<<endl 2 #define IO std::ios::sync_with_stdio(0) 3 #include <bits/stdc++.h> ...
分类:
其他好文 时间:
2020-07-21 21:48:07
阅读次数:
55
这题是真GOU了,改bug改到自闭了。 ‘ 同样都是预处理,人家加了个素数筛就能过,我没加就疯狂W,W到自闭,其实知道题简单的一批,只需要预处理一下,从n分解到1需要多少次,然后存到数组里就行了,真的是W吐了 #include <bits/stdc++.h> typedef long long ll ...
分类:
其他好文 时间:
2020-07-21 09:42:09
阅读次数:
73
高级树状数组讲解:https://www.cnblogs.com/RabbitHu/p/BIT.html 树状数组 一维树状数组 单点修改,区间查询 https://loj.ac/problem/130 #include<bits/stdc++.h> #define INF 0x3f3f3f3f # ...
分类:
编程语言 时间:
2020-07-20 22:29:48
阅读次数:
77
题: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
跑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