NEW
Sensente
满船清梦压星河
展开
-
2019/11 第一次训练赛知识点以及补题
1.快速幂二进制快速幂ll qpow(ll a, ll b) { ll ans = 1; while(b) { if(b&1) ans = ans * a % mod; a = a * a %mod; b>>=1; } return ans;}十进制快速幂ll tqpow(ll...原创 2019-11-27 12:16:15 · 168 阅读 · 0 评论 -
HDU2157 How many ways??(可达矩阵+矩阵快速幂)
http://acm.hdu.edu.cn/showproblem.php?pid=2157题目大意:不多赘述。关键是知道题目如何解决。其实其求的就是可达矩阵(不懂的参看离散数学图论)在实际系统建模工程中,有向图D={S,R}中,对于Si,Sj 属于S,如果从Si到Sj有任何一条通路存在,则可称Si可达Sj。利用布尔矩阵的运算性质给出了计算有向图可达矩阵的方法,该方法计算简...原创 2019-11-25 10:59:35 · 386 阅读 · 0 评论 -
杭电6713 最短路1(2019百度之星 初赛三)
HDU6713http://acm.hdu.edu.cn/showproblem.php?pid=6713解题思路:找规律1^N;#include <iostream>using namespace std;int T;int n;int main() { while(cin >> T) { while(T--) { ...原创 2019-09-18 23:16:29 · 241 阅读 · 0 评论 -
杭电1698 Just a Hook(延时标记线段树)
Problem DescriptionIn the game of DotA, Pudge’s meat hook is actually the most horrible thing for most of the heroes. The hook is made up of several consecutive metallic sticks which are of the same...原创 2019-09-16 16:08:56 · 182 阅读 · 0 评论 -
杭电2795 Billboard(线段树)
HDU2795http://acm.hdu.edu.cn/showproblem.php?pid=2795BillboardTime Limit: 20000/8000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 32859 Accepted Submissi...原创 2019-09-15 00:02:15 · 175 阅读 · 0 评论 -
数据结构 线段树与树状数组
一、线段树Reference:https://www.cnblogs.com/AC-King/p/7789013.html要解决的问题:1.查询区间[L,R]之间的最值2.修改a[i]为x;明确可以解决的问题:必须是满足区间可加性的问题,例如:符合区间加法的例子:数字之和——总数字之和 = 左区间数字之和 + 右区间数字之和最大公因数(GCD)——总GCD ...原创 2019-09-14 23:52:58 · 599 阅读 · 0 评论 -
杭电1166 敌兵布阵(线段树)
HDU1166http://acm.hdu.edu.cn/showproblem.php?pid=1166敌兵布阵Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 153319 Accepted Submission(s):...原创 2019-09-14 16:20:26 · 180 阅读 · 0 评论 -
杭电1754 I Hate It(线段树)
HDU1754http://acm.hdu.edu.cn/showproblem.php?pid=1754I Hate ItTime Limit: 9000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 127543 Accepted Submissio...原创 2019-09-14 09:58:22 · 161 阅读 · 0 评论 -
POJ3264 Balanced Lineup(线段树)
POJ3264http://poj.org/problem?id=3264线段树模版。题目大意:Q次区间查询。AC代码:#include <iostream>#include <cstdio>#include <cmath>using namespace std;const int maxn = 50000 + 5;int a[...原创 2019-09-13 11:22:38 · 175 阅读 · 0 评论 -
杭电4993 Revenge of ex-Euclid
http://acm.hdu.edu.cn/showproblem.php?pid=4993Revenge of ex-EuclidTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1093 Accepted Submissi...原创 2019-09-04 19:54:57 · 181 阅读 · 0 评论