![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
规律/递推
等我学会后缀自动机
侠影之谜
展开
-
uva 557 - Burger(概率+递推)
#include<bits/stdc++.h>using namespace std;#define debug cout<<"YES\n";#define rep(x,y,z) for(int (x)=(y);(x)<(z);(x)++)#define ll long long#define lrt int l,int r,int rt#define ...原创 2020-02-18 15:41:09 · 189 阅读 · 0 评论 -
CodeForces 83D Numbers (数论+递归)*
题目链接:http://codeforces.com/problemset/problem/83/D#include<bits/stdc++.h>using namespace std;#define debug puts("YES");#define rep(x,y,z) for(int (x)=(y);(x)<(z);(x)++)#define ll long...原创 2018-11-21 20:54:28 · 196 阅读 · 0 评论 -
Gym 100548K Last Defence (辗转相除)
题目链接:http://codeforces.com/gym/100548/attachments#include<bits/stdc++.h>using namespace std;#define debug puts("YES");#define rep(x,y,z) for(int (x)=(y);(x)<(z);(x)++)#define ll long ...原创 2018-11-23 23:47:40 · 179 阅读 · 0 评论 -
HDU 6185 Covering (递推+矩阵快速幂)*
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6185#include<bits/stdc++.h>using namespace std;#define debug puts("YES");#define rep(x,y,z) for(int (x)=(y);(x)<(z);(x)++)#define ll lon...原创 2018-12-03 23:35:00 · 123 阅读 · 0 评论 -
HDU 5630 Rikka with Chess (规律水题)
#include<bits/stdc++.h>using namespace std;#define debug puts("YES");#define rep(x,y,z) for(int (x)=(y);(x)<(z);(x)++)#define ll long long#define lrt int l,int r,int rt#define lson l...原创 2018-12-03 23:50:39 · 109 阅读 · 0 评论 -
ZOJ 3785 What day is that day? (指数循环定理+最小公倍数)
题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3785#include<bits/stdc++.h>using namespace std;#define debug puts("YES");#define rep(x,y,z) for(int (x)=(y);(x)<(z);(x...原创 2018-12-03 23:55:03 · 148 阅读 · 0 评论 -
HDU 5753 Permutation Bo (概率与期望)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5753#include<bits/stdc++.h>using namespace std;#define debug puts("YES");#define rep(x,y,z) for(int (x)=(y);(x)<(z);(x)++)#define ll lon...原创 2018-12-04 00:04:07 · 111 阅读 · 0 评论 -
HRBUST 1846 方格涂色 (DP+递推)
#include<bits/stdc++.h>using namespace std;#define debug puts("YES");#define rep(x,y,z) for(int (x)=(y);(x)<(z);(x)++)#define ll long long#define lrt int l,int r,int rt#define lson l...原创 2018-12-04 00:07:53 · 511 阅读 · 0 评论 -
CodeForces 55D Beautiful numbers (数位DP+数论+打表规律)
题目链接:http://codeforces.com/problemset/problem/55/D题目大意给定L和R,求这个区间中满足条件的数的个数,条件为:该数可以整除每一位上非零的数。题目分析这道题我看题解思路的,刚接触数位DP,我觉得这道题应该是利用数论技巧来化简状态的题目。、首先分析状态,数位DP其状态的延展方式可能不方便用循环描述所以直接记忆化,关键是...原创 2019-03-21 23:21:12 · 99 阅读 · 0 评论 -
HDU 4507 吉哥系列故事——恨7不成妻 (数位DP+数学技巧)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4507题目大意给定一个区间要求这个区间内满足要求的数的平方和,要求是:数位中不含7,数字和不是7的整数倍,数值本身不能被7整除。题目分析数位DP,对于三个条件的限制其实很好规定,在选数字时候去掉7的选择,然后开三位DP数组维护数字和和数值余数。关键是如何求出其平方和。我们...原创 2019-04-01 14:49:38 · 122 阅读 · 0 评论 -
南昌邀请赛 网络赛 MORE XOR(规律+前缀异或和)
题目链接:https://nanti.jisuanke.com/t/38230题目大意给定一个序列,层层定义三个函数,定义都是数学式子很复杂,但是终归就是每一位的数取还是不取的关系.题目分析第一层:1,1,1,1,1第二层:1,0,1,0,1,事实上就是上一层前缀和模2,第三层:1,1,0,0,1,1,0,0,...到这里即可,那么分析,对于(l,r...原创 2019-04-21 11:45:02 · 223 阅读 · 9 评论 -
UVA 10479 The Hendrie Sequence (规律+递归)
题目链接:https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=1420#include<bits/stdc++.h>using namespace std;#define debug puts("YES");#...原创 2018-11-15 19:52:52 · 150 阅读 · 0 评论 -
UVA 10542 Hyper-drive (容斥定理+规律)*
题目链接:https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=1483#include<bits/stdc++.h>using namespace std;#define debug puts("YES");#...原创 2018-10-27 15:25:45 · 134 阅读 · 0 评论 -
HDU 5601 N*M bulbs (找规律)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5601#include<bits/stdc++.h>using namespace std;#define debug puts("YES");#define rep(x,y,z) for(int (x)=(y);(x)<(z);(x)++)#define read(x...原创 2018-10-15 18:16:41 · 151 阅读 · 0 评论 -
牛客网多校练习赛7 A Minimum Cost Perfect Matching (数学规律+位运算)
链接:https://www.nowcoder.com/acm/contest/145/A来源:牛客网 题目描述You have a complete bipartite graph where each part contains exactly n nodes, numbered from 0 to n - 1 inclusive.The weight of the edge c...原创 2018-08-09 16:53:25 · 490 阅读 · 0 评论 -
HDU 6336 Problem E. Matrix from Arrays (数学规律)
Problem E. Matrix from Arrays Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others) Total Submission(s): 1372 Accepted Submission(s): 623 Problem D...原创 2018-08-08 21:42:38 · 131 阅读 · 0 评论 -
HDU 6400 Parentheses Matrix (数学打表找规律)*
Parentheses MatrixTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 973 Accepted Submission(s): 385Special Judge Problem DescriptionA...原创 2018-08-21 07:18:52 · 114 阅读 · 0 评论 -
HDU 5297 Y Sequence (容斥定理+迭代法搜索答案)*
Y sequenceTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 2559 Accepted Submission(s): 633 Problem DescriptionYellowstar likes intege...原创 2018-09-05 17:15:58 · 134 阅读 · 0 评论 -
CodeForces - 451D Count Good Substrings (数学规律+组合数学)*
题目链接:http://codeforces.com/problemset/problem/451/D#include<bits/stdc++.h>using namespace std;#define debug puts("YES");#define rep(x,y,z) for(int (x)=(y);(x)<(z);(x)++)#define read(x...原创 2018-09-23 18:48:33 · 159 阅读 · 0 评论 -
HDU 4927 Series (JAVA大数+组合规律)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4927import java.util.Scanner;import java.math.BigInteger; public class Main { public static void main(String[] args) { Scanner c...原创 2018-09-23 19:52:28 · 131 阅读 · 0 评论 -
HDU 6227 Rabbits (规律水题)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6227#include<bits/stdc++.h>using namespace std;#define debug puts("YES");#define rep(x,y,z) for(int (x)=(y);(x)<(z);(x)++)#define read(x...原创 2018-09-26 20:49:53 · 237 阅读 · 0 评论 -
UVA 12050 Palindrome Numbers (规律题)*
题目链接:https://cn.vjudge.net/problem/UVA-12050#include<bits/stdc++.h>using namespace std;#define debug puts("YES");#define rep(x,y,z) for(int (x)=(y);(x)<(z);(x)++)#define read(x,y) sca...原创 2018-09-21 21:16:14 · 197 阅读 · 0 评论 -
HDU 5584 LCM Walk (数论规律)*
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5584#include<bits/stdc++.h>using namespace std;#define debug puts("YES");#define rep(x,y,z) for(int (x)=(y);(x)<(z);(x)++)#define read(x,...原创 2018-09-22 11:14:38 · 113 阅读 · 0 评论 -
HDU 5600 N bulbs(找规律水题)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5600#include<bits/stdc++.h>using namespace std;#define debug puts("YES");#define rep(x,y,z) for(int (x)=(y);(x)<(z);(x)++)#define read(x...原创 2018-10-15 17:20:20 · 123 阅读 · 0 评论 -
UVA 1641 统计面积(数学规律)
Long time ago, most of PCs were equipped with video cards that worked only in text mode. If the programmer wanted to show a picture on a screen, he had to use pseudographics or ASCII art like this on ...原创 2018-08-09 08:12:15 · 147 阅读 · 0 评论