- 博客(31)
- 收藏
- 关注
原创 wustoj2244数学
TeleportationTime Limit: 1 Sec Description Hovey just learnt a powerful skill from the failurc of his chasing MMs: teleportation. He can teleport from point (x , y) to another point (x',...
2018-08-29 16:44:48 260
原创 wustoj 1506 药丸 卡特兰数
Description一个药瓶里装有n颗药丸,每天吃半颗,需要在2n天吃完。每天吃药时,从药瓶中取药,如果取到的药是整颗的,就把它分成两半,吃掉其中的一半,另一半重新放入瓶中;如果取到的是半颗药,则直接吃掉。问共有多少种吃药方法?例如:n=1,则吃药方法有1种(取一颗,取半颗)。n=2,则有2种吃药方法(取一颗,取半颗,取一颗,取半颗;取一颗,取一颗,取半颗,取半颗)。Inpu...
2018-08-29 10:42:41 403
原创 Codeforces1027D捉老鼠 图论 dfs
题目链接D. Mouse HuntMedicine faculty of Berland State University has just finished their admission campaign. As usual, about 80%80% of applicants are girls and majority of them are going to live in t...
2018-08-28 20:32:35 343
原创 Codefoeces 1025C 思维+脑洞+坑
C. Plasticine zebraIs there anything better than going to the zoo after a tiresome week at work? No wonder Grisha feels the same while spending the ent...
2018-08-27 19:58:20 589
原创 Codeforces 242 E XOR on Segment 异或线段树
You've got an array a, consisting of n integers a1, a2, ..., an. You are allowed to perform two operations on this array:Calculate the sum of current array elements on the segment [l, r], that is, c...
2018-08-27 19:27:47 407
原创 Maximal Intersection Codeforces Round #506 Div. 3 贪心+暴力
You are given nn segments on a number line; each endpoint of every segment has integer coordinates. Some segments can degenerate to points. Segments can intersect with each other, be nested in each ot...
2018-08-27 10:58:20 267
原创 高精度模板 WUSToj2238
2238: Virus outbreakTime Limit: 1 Sec Memory Limit: 128 MB Description The State Veterinary Services Department recently reported an outbreak of a newly found cow disease. All cows fou...
2018-08-26 18:56:26 196
原创 hdu 5750 数论
DertouzosA positive proper divisor is a positive divisor of a number nn, excluding nn itself. For example, 1, 2, and 3 are positive proper divisors...
2018-08-19 20:25:28 393 1
原创 二进制法枚举集合——权利指数 HDU1557
权利指数在选举问题中,总共有n个小团体,每个小团体拥有一定数量的选票数。如果其中m个小团体的票数和超过总票数的一半,则此组合为“获胜联盟”。n个团体可形成若干个获胜联盟。一个小团体要成为一个“关键加入者”的条件是:在其所在的获胜联盟中,如果缺少了这个小团体的加入,则此联盟不能成为获胜联盟...
2018-08-12 23:16:12 441
原创 母函数——秤砣问题——The Balance
Now you are asked to measure a dose of medicine with a balance and a number of weights. Certainly it is not always achievable. So you should find out the qualities which cannot be measured from the ra...
2018-08-12 22:48:59 483
原创 单调栈求矩形块最大面积 poj 2082 两只黄鹂鸣翠柳,一行白鹭上青天
Terrible Sets Let N be the set of all natural numbers {0 , 1 , 2 , . . . }, and R be the set of all real numbers. wi, hi for i = 1 . . . n are some elem...
2018-08-10 11:23:37 1192
原创 Bad Hair Day ——牛说我瞅你咋地——单调栈POJ3250
Bad Hair Day Some of Farmer John's N cows (1 ≤ N ≤ 80,000) are having a bad hair day! Since each cow is self-conscious about her messy hairstyle, F...
2018-08-08 20:56:08 199
原创 连续子序列的最大和 HDU3415
Max Sum of Max-K-sub-sequenceGiven a circle sequence A[1],A[2],A[3]......A[n]. Circle sequence means the left neighbour of A[1] is A[n] , and the right neighbour o...
2018-08-08 19:41:49 377
原创 单调队列 POJ 2823 Sliding Window
Sliding WindowAn array of size n ≤ 10 6 is given to you. There is a sliding window of size kwhich is moving from the very left of the array to the very right. You can only see the k numbers in th...
2018-08-08 15:24:24 131
原创 拓展欧几里得——egcd poj2142
The Balance Ms. Iyo Kiffa-Australis has a balance and only two kinds of weights to measure a dose of medicine. For example, to measure 200mg of aspirin ...
2018-08-08 10:43:32 729
原创 Lucas定理 + 隔板法 HDU3037
Saving Beans Although winter is far away, squirrels have to work day and night to save beans. They need plenty of food to get through those long cold days. After some time the squirrel family thinks...
2018-08-07 20:51:11 140
原创 求组合数 Lightoj1067
Combinations Given n different objects, you want to take k of them. How many ways to can do it?For example, say there are 4 items; you wa...
2018-08-07 19:33:46 211
原创 反素数——zoj 2562 More Divisors
More DivisorsEverybody knows that we use decimal notation, i.e. the base of our notation is 10. Historians say that it is so because men have ten fingers....
2018-08-07 17:29:20 146
原创 kmp求循环节——HDU3746
Cyclic NacklaceCC always becomes very depressed at the end of this month, he has checked his credit card yesterday, without any surprise, there are only 99.9 ...
2018-08-07 09:52:44 190
原创 素数的两种筛子比较——埃氏筛,欧拉筛(线性筛)
埃氏筛的思想算法如下:要得到自然数n以内的全部素数,必须把不大于 的所有素数的倍数剔除,剩下的就是素数。给出要筛数值的范围n,找出以内的素数。先用2去筛,即把2留下,把2的倍数剔除掉;再用下一个质数,也就是3筛,把3留下,把3的倍数剔除掉;接下去用下一个质数5筛,把5留下,把5的倍数剔除掉;不断重复下去......。时间复杂度为O(n*lglgn);void Prime(){...
2018-08-06 19:42:53 1528
原创 买水果——hdu 2152
转眼到了收获的季节,由于有TT的专业指导,Lele获得了大丰收。特别是水果,Lele一共种了N种水果,有苹果,梨子,香蕉,西瓜……不但味道好吃,样子更是好看。 于是,很多人们慕名而来,找Lele买水果。 甚至连大名鼎鼎的HDU ACM总教头 lcy 也来了。lcy抛出一打百元大钞,"我要买由M个水果组成的水果拼盘,不过我有个小小的要求,对于每种水果,个数上我有限制,既不能少于某个特定值,也不能...
2018-08-06 10:35:33 207
原创 牛客多校第四场——splay的区间平移操作
链接:https://www.nowcoder.com/acm/contest/141/C来源:牛客网 Eddy likes to play cards game since there are always lots of randomness in the game. For most of the cards game, the very first step in the game...
2018-08-05 19:05:33 648
原创 STL——nth_element()
nth_element(a,a+m,a+n) 是一个不完全排序,效果是把数组的前m个数都比m+1小,而后面的数右都比m+1大。时间复杂度上比sort要快。一个应用 只需得到前m大的数这个题还用到了gcd,貌似STL中也可以用__gcd这个函数。(两横)#include<bits/stdc++.h>using namespace std;const int maxn=1e...
2018-08-05 18:52:58 515
原创 牛客网多校第6场J题 随机化暴力
牛客网多校第6场J题 链接:https://www.nowcoder.com/acm/contest/144/Jskywalkert, the new legend of Beihang University ACM-ICPC Team, retired this year leaving a group of newbies again. Rumor has it tha...
2018-08-05 18:46:38 234
原创 bfs+玄学去重——钥匙开门hdu 1885
Key TaskThe Czech Technical University is rather old — you already know that it celebrates 300 years of its existence in 2007. Some of the univers...
2018-08-04 08:48:09 236
原创 ac自动机模板题——hdu1277
全文检索 我们大家经常用google检索信息,但是检索信息的程序是很困难编写的;现在请你编写一个简单的全文检索程序。 问题的描述是这样的:给定一个信息流文件,信息完全有数字组成,数字个数不超过60000个,但也不少于60个;再给定一个关键字集合,其中关键字个数不超过10000个,每个关键字的信息数字不超过60个,但也不少...
2018-08-03 15:44:24 562
原创 bfs+优先队列+诡异的梯子 hdu1277
诡异的楼梯Hogwarts正式开学以后,Harry发现在Hogwarts里,某些楼梯并不是静止不动的,相反,他们每隔一分钟就变动一次方向. 比如下面的例子里,一开始楼梯在竖直方向,一分钟以后它移动到了水平方向,再过一分钟它又回到了竖直方向.Harry发现对他来说很难找到能使得他最快到达目的地的路线,这时...
2018-08-03 10:23:07 199
原创 bfs+优先队列,保存路径——HDU1026
Ignatius and the Princess IThe Princess has been abducted by the BEelzebub feng5166, our hero Ignatius has to rescue our pretty Princess. Now he gets into feng5166's...
2018-08-03 08:35:58 354
原创 扫描线,矩形面积求并hdu 1542
AtlantisThere are several ancient Greek texts that contain descriptions of the fabled island Atlantis. Some of these texts even include maps ...
2018-08-02 10:23:16 165
原创 线段树区间修改,区间(单点)查询 poj2777 线段树上色
Count ColorChosen Problem Solving and Program design as an optional course, you are required to solve all kinds of problems. Here, we get a new problem...
2018-08-01 15:06:33 417 1
原创 牛客网暑期acm多校训练第4场A题——欧拉降幂+快速幂模板
题目链接A ternary string is a sequence of digits, where each digit is either 0, 1, or 2.Chiaki has a ternary string s which can self-reproduce. Every second, a digit 0 is inserted after every 1 in the ...
2018-08-01 11:23:23 502
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人