![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
捎带数学思想的题目
等我学会后缀自动机
侠影之谜
展开
-
POJ 2645 Boastin' Red Socks (概率+数学)
题目链接:http://poj.org/problem?id=2645题目大意给定p和q,意指从其中拿出两只袜子其颜色都是红色的概率是p/q,问在袜子总数最少的情况下其红色和黑色袜子的数量是多少。题目分析不难把式子列出来:p/q=x*(x-1)/(y*(y-1)),发现总数范围是50000,尝试者暴力枚举y,左边式子实质上是p*k/(q*k),那么我们可以...原创 2019-04-05 17:15:05 · 233 阅读 · 0 评论 -
HDU 2204 Eddy's爱好 (容斥原理)
Eddy's爱好Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3031 Accepted Submission(s): 1491 Problem DescriptionIgnatius 喜欢收集蝴蝶标本和邮票,但是E...原创 2018-08-18 13:53:27 · 483 阅读 · 0 评论 -
Codeforces roudn 502 div1+div2 C. The Phone Number(数学观察)
C. The Phone Numbertime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputMrs. Smith is trying to contact her husband, John Smith, bu...原创 2018-08-09 00:52:21 · 481 阅读 · 2 评论 -
HDU 6362 oval-and-rectangle(数学知识+代码细节)
oval-and-rectangleTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 347 Accepted Submission(s): 150 Problem DescriptionPatrick Star fin...原创 2018-08-08 21:46:26 · 218 阅读 · 0 评论 -
Codeforces Round 502 (div1+div2) The Wu (状态压缩+位运算+预处理)
D. The Wutime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputChildan is making up a legendary story and trying to sell his forgery —...原创 2018-08-11 11:02:12 · 170 阅读 · 0 评论 -
HDU 杭电多校2018 1011 Problem K. Expression in Memories(字符串判定,,技巧规律)。。。我再也不想刷水题了
Problem K. Expression in MemoriesTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 0 Accepted Submission(s): 0Special Judge Problem Des...原创 2018-08-01 17:01:32 · 231 阅读 · 0 评论 -
Atcoder contest 078 D - Fennec VS. Snuke (BFS+思维)。。。DFS也可以
D - Fennec VS. SnukeTime limit : 2sec / Memory limit : 256MBScore : 400 pointsProblem StatementFennec and Snuke are playing a board game.On the board, there are N cells numbered 1 through N,...原创 2018-08-01 16:51:23 · 232 阅读 · 0 评论 -
UVA 1262 password (数学编码与解码)*
Shoulder-surfing is the behavior of intentionally and stealthily watching the screen of another person’s electronic device, such as laptop computer or mobile phone. Since mobile devices prevail, it is...原创 2018-07-27 23:50:27 · 260 阅读 · 0 评论 -
牛客网练习赛23 C 托米的位运算(贪心+位运算技巧)
链接:https://www.nowcoder.com/acm/contest/156/C来源:牛客网 题目描述托米完成了1317的上一个任务,十分高兴,可是考验还没有结束说话间1317给了托米 n 个自然数 a1... an, 托米可以选出一些带回家,但是他选出的数需要满足一些条件设托米选出来了k 个数 b1,b2... bk, 设这个数列 b 的给值为 b 中所有数按位与的结果...原创 2018-07-27 23:19:33 · 201 阅读 · 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 · 506 阅读 · 0 评论 -
HDU 4790 Just Random (概率 + 容斥思想+数学)
Just RandomTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3415 Accepted Submission(s): 1103 Problem Description Coach Pang and Uncl...原创 2018-08-27 23:26:53 · 152 阅读 · 0 评论 -
HDU 4616 Game (树形DP+枚举思维方法)*
GameTime Limit: 3000/1000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 2520 Accepted Submission(s): 857 Problem Description Nowadays, there are more an...原创 2018-08-31 20:02:21 · 231 阅读 · 0 评论 -
Codeforces Round #546 (Div. 2) E. Nastya Hasn't Written a Legend(线段树+二分+数学转换)
题目链接:http://codeforces.com/contest/1136/problem/E题目大意给定两个序列,支持两种操作,查询第一个序列的区间和,第二种是修改a数组x位置上的值,增加x,并且如果a[i+1]<a[i]+k[i] 那么a[i+1]=a[i]+k[i]。题目分析[i+1]-S[i]<a[i]-S[i-1],这样我们把a[i]+S[i...原创 2019-03-21 00:52:03 · 129 阅读 · 0 评论 -
Codeforces Round #539 (Div. 2) C. Sasha and a Bit of Relax(数学+异或性质)
题目链接:http://codeforces.com/contest/1113/problem/C题目大意:给定一个整数序列,问有多少个二元组(l,r),满足l到r的数异或起来为0的。题目分析: 异或的技巧吧,不难发现如果(l,r)满足条件,那么S[l-1]=S[r],其中S是异或前缀和,下面就是个简单的计数啦,可以看到偶数下标之间相减为偶数,奇数下标之间相减为奇数,...原创 2019-02-18 17:44:49 · 101 阅读 · 0 评论 -
HDU 5875 AnInteresting game(树状数组思维题)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5975#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...原创 2019-01-19 23:23:08 · 161 阅读 · 0 评论 -
ACM-ICPC 2018 徐州赛区网络预赛 徐州 H Ryuji doesn't want to study (树状数组维护前缀和)水题
题目链接:https://nanti.jisuanke.com/t/31460#include<bits/stdc++.h>#pragma comment(linker,"/STACK:1024000000,1024000000")using namespace std;#define debug puts("YES");#define rep(x,y,z) for(i...原创 2018-09-09 21:24:25 · 190 阅读 · 0 评论 -
Codeforces 834D The Bakery (线段树+DP+单调性质)*
题目链接:https://cn.vjudge.net/problem/CodeForces-834D#include<bits/stdc++.h>#pragma comment(linker,"/STACK:1024000000,1024000000")using namespace std;#define debug puts("YES");#define rep(x...原创 2018-09-08 09:21:27 · 164 阅读 · 0 评论 -
ZOJ 3903 Ants (纯数学知识)
AntTime Limit: 1 Second Memory Limit: 32768 KBThere is an ant named Alice. Alice likes going hiking very much. Today, she wants to climb a cuboid. The length of cuboid's longest edge is n, ...原创 2018-08-29 19:28:50 · 218 阅读 · 0 评论 -
HDU 5514 Frogs (容斥思想+数论知识)*
Frogs Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 4142 Accepted Submission(s): 1396 Problem Description There are ...原创 2018-08-25 08:04:35 · 169 阅读 · 0 评论 -
HDU 6435 Problem J. CSGO (二进制枚举曼哈顿距离+思维)
Problem J. CSGOTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 524288/524288 K (Java/Others)Total Submission(s): 885 Accepted Submission(s): 465 Problem DescriptionYou are playing C...原创 2018-08-29 08:11:48 · 264 阅读 · 0 评论 -
BZOJ 2440 完全平方数(莫比乌斯反演+分块处理+二分答案)*
小 X 自幼就很喜欢数。但奇怪的是,他十分讨厌完全平方数。他觉得这些数看起来很令人难受。由此,他也讨厌所有是完全平方数的正整数倍的数。然而这丝毫不影响他对其他数的热爱。这天是小X的生日,小 W 想送一个数给他作为生日礼物。当然他不能送一个小X讨厌的数。他列出了所有小X不讨厌的数,然后选取了第 K个数送给了小X。小X很开心地收下了。然而现在小 W 却记不起送给小X的是哪个数了。你能帮他一...原创 2018-08-21 21:17:07 · 250 阅读 · 0 评论 -
HDU 6324 Problem F. Grab The Tree (规律) ps:贼像树形dp的技巧题
Problem F. Grab The TreeTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 524288/524288 K (Java/Others)Total Submission(s): 88 Accepted Submission(s): 63 Problem DescriptionLittle Q a...原创 2018-07-30 21:06:28 · 262 阅读 · 0 评论 -
HDU 6322 Eluer Function(规律)
Problem D. Euler Function Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 524288/524288 K (Java/Others) Total Submission(s): 57 Accepted Submission(s): 56 Problem Descript...原创 2018-07-30 19:42:12 · 182 阅读 · 0 评论 -
HDU 6143
Killer NamesTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1745 Accepted Submission(s): 857Problem Description > Galen Marek, codenamed S...原创 2018-06-18 11:51:05 · 166 阅读 · 0 评论 -
ZOJ 1025 Wooden Sticks (动态规划+数学思维)
Wooden Sticks Time Limit: 2 Seconds Memory Limit: 65536 KB There is a pil...原创 2018-06-17 16:47:33 · 223 阅读 · 1 评论 -
HDU 6134 Battlestation Operational (容斥定理+打表)
Battlestation OperationalTime Limit: 6000/3000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 734 Accepted Submission(s): 406Problem Description> The Death Sta...原创 2018-06-17 08:13:40 · 194 阅读 · 0 评论 -
HDU 5710 Digit-Sum (数学规律题)
Digit-Sum Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 848 Accepted Submission(s): 260Problem Description Let S(N) be digit-sum of N, i.e ...原创 2018-06-23 17:43:39 · 316 阅读 · 0 评论 -
HDU 6071 Lazy Running (构造同余最短路+思维好题)
Lazy RunningTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 524288/524288 K (Java/Others)Total Submission(s): 1598 Accepted Submission(s): 677Problem DescriptionIn HDU, you have to run alon...原创 2018-06-23 08:29:34 · 234 阅读 · 0 评论 -
HDU 5573 Binary Tree(构造技巧)
Binary TreeTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1615 Accepted Submission(s): 960Special JudgeProblem DescriptionThe Old Frog King ...原创 2018-05-30 22:35:39 · 264 阅读 · 0 评论 -
HDU 5355 Cake (构造+简单回溯)
CakeTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 3255 Accepted Submission(s): 689Special JudgeProblem Description There are m soda and t...原创 2018-05-30 08:09:19 · 223 阅读 · 0 评论 -
HDU 4939 The Stupid Tower Defense (dp+思维构造)
Stupid Tower DefenseTime Limit: 12000/6000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 2442 Accepted Submission(s): 685Problem Description FSF is addicted...原创 2018-05-19 10:54:32 · 135 阅读 · 0 评论 -
HDU 4920 Martix Multiplication (论如何优化稀疏矩阵的运算)
Matrix multiplicationTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 5363 Accepted Submission(s): 2050Problem Description Given two matr...翻译 2018-05-02 17:34:18 · 396 阅读 · 0 评论 -
HDU 5492 Find a path (巧妙三维dp思维)
Find a pathTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2064 Accepted Submission(s): 889Problem DescriptionFrog fell into a maze. This maz...原创 2018-06-26 08:25:42 · 176 阅读 · 0 评论 -
HDU 6090 Rikka with Graph(贪心)
Rikka with GraphTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1140 Accepted Submission(s): 636Problem Description As we know, Rikka is poor...原创 2018-06-27 00:16:34 · 154 阅读 · 0 评论 -
UVA 11582 巨大的斐波那契数! (打表+周期规律)
The i’th Fibonacci number f(i) is recursively defined in the following way: • f(0) = 0 and f(1) = 1 • f(i + 2) = f(i + 1) + f(i) for every i ≥ 0 Your task is to compute some values of this sequence.In...原创 2018-07-22 10:23:29 · 704 阅读 · 0 评论 -
UVA 10820 交表 (欧拉函数简单应用)
When participating in programming contests, you sometimes face the following problem: You know how to calcutale the output for the given input values, but your algorithm is way too slow to ever pass t...原创 2018-07-26 12:20:45 · 123 阅读 · 0 评论 -
UVA 1635 无关的元素(杨辉三角+唯一分解性定理)
Young cryptoanalyst Georgie is investigating different schemes of generating random integer numbers ranging from 0 to m−1. He thinks that standard random number generators are not good enough, so he ha...原创 2018-07-26 11:16:16 · 294 阅读 · 0 评论 -
UVA 580 危险的组合 (组合计数)*
During the early stages of the Manhattan Project, the dangers of the new radioctive materials were not widely known. Vast new factory cities were built to manufacture uranium and plu- tonium in bulk. ...原创 2018-07-29 10:34:27 · 436 阅读 · 0 评论 -
牛客网多校练习赛4 D Another Distinct Values (数学规律)
链接:https://www.nowcoder.com/acm/contest/142/D来源:牛客网题目描述 Chiaki has an n x n matrix. She would like to fill each entry by -1, 0 or 1 such that r1,r2,...,rn,c1,c2, ..., cn are distinct values, w...原创 2018-07-28 16:48:19 · 314 阅读 · 0 评论 -
HDU Difference (折半二分思想 + 数据结构的使用)
DifferenceTime Limit: 6000/3000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1432 Accepted Submission(s): 392Problem DescriptionLittle Ruins is playing a number...原创 2018-07-13 23:36:43 · 200 阅读 · 1 评论