- 博客(22)
- 收藏
- 关注
原创 hdu6081--度度熊的王国战略(百度之星资格赛)
Problem Description度度熊国王率领着喵哈哈族的勇士,准备进攻哗啦啦族。哗啦啦族是一个强悍的民族,里面有充满智慧的谋士,拥有无穷力量的战士。所以这一场战争,将会十分艰难。为了更好的进攻哗啦啦族,度度熊决定首先应该从内部瓦解哗啦啦族。第一步就是应该使得哗啦啦族内部不能同心齐力,需要内部有间隙。哗啦啦族一共有n个将领,他们一共有m个强关系,摧
2017-08-17 19:10:55 436
原创 hdu6130--Kolakoski
Problem DescriptionThis is Kolakosiki sequence:1,2,2,1,1,2,1,2,2,1,2,2,1,1,2,1,1,2,2,1……. This sequence consists of 1 and 2, and its first term equals 1. Besides, if you see adjacent and e
2017-08-15 14:00:00 365
原创 hdu6124--Euler theorem
Problem DescriptionHazelFan is given two positive integersa,b, and he wants to calculate amodb. But now he forgets the value of b and only remember the value of a, please tell him the numb
2017-08-15 13:54:44 362
原创 吃豆豆--Java小游戏
吃豆豆项目总结,要求用Java做一个小游戏不想用网上现成的代码,也想做的有新意一点什么贪吃蛇啊飞机大战啊超级玛丽啊……之前有人写过或者有人在写,所有并不想做(@我东东哥)打了3天4399吧,想到一个比较不错的游戏:吃豆豆黄色的为我方小豆人,粉色红色橙色为小怪兽可以通过键盘上下左右来控制小豆人运动,每次移动5个像素小怪兽可以自行运动,每
2017-08-14 20:45:04 5236 7
原创 hdu6106--Classes
Problem DescriptionThe school set up three elective courses, assuming that these courses are A, B, C. N classes of students enrolled in these courses.Now the school wants to count the number of st
2017-08-14 19:27:36 394
原创 hdu6098--Inversion
Problem DescriptionGive an array A, the index starts from 1.Now we want to know Bi=maxi∤jAj , i≥2.InputThe first line of the input gives the number of test cases T; T test cases follow.Eac
2017-08-14 18:40:26 412
原创 数论---荣斥定理
在计数时,必须注意没有重复,没有遗漏,为了使重叠部分不被重复计算,人们研究出一种新的计数方法,即:先不考虑重叠部分情况,把包含某内容中的所有对象数目先计算出来,然后把重复计算的数目排斥出去,使得计数结果既没有遗漏,有没有重复。即荣斥定理,也叫荣斥原理。公式比如在下图中对于m=3的情况,右式可化为 = {[(A+B - A∩B)+C - B∩C
2017-08-01 10:31:28 1829
原创 hdu6047--Maximum Sequence
Problem DescriptionSteph is extremely obsessed with “sequence problems” that are usually seen on magazines: Given the sequence 11, 23, 30, 35, what is the next number? Steph always finds them too ea
2017-07-28 21:40:06 654 2
原创 hdu6055--Regular polygon
Problem DescriptionOn a two-dimensional plane, give you n integer points. Your task is to figure out how many different regular polygon these points can make.InputThe input file consists of seve
2017-07-28 11:04:00 373
原创 hdu6034--Balala Power!
Problem DescriptionTalented Mr.Tang has n strings consisting of only lower case characters. He wants to charge them with Balala Power (he could change each character ranged froma to z in
2017-07-27 20:30:44 493
原创 hdu6033--Add More Zero
Problem DescriptionThere is a youngster known for amateur propositions concerning several mathematical hard problems.Nowadays, he is preparing a thought-provoking problem on a specific type of s
2017-07-26 11:46:54 317
原创 hdu6043--KazaQ's Socks
Problem DescriptionKazaQ wears socks everyday.At the beginning, he has n pairs of socks numbered from 1 to n in his closets. Every morning, he puts on a pair of socks which has the sma
2017-07-26 11:02:40 446
原创 acm省赛--D sum of power快速幂
Problem DescriptionCalculate mod (1000000000+7) for givenn,m.InputInput contains two integers n,m(1≤n≤1000,0≤m≤10).OutputOutput the answer in a single line.Example Input
2017-07-25 11:12:48 359
原创 acm省赛题--J company
Problem DescriptionThere are n kinds of goods in the company, with each of them has a inventory of and direct unit benefit. Now you find due to price changes, for any goods sold on dayi, if
2017-07-24 20:26:10 656
原创 acm省赛K题--01背包
DescriptionLYD loves codeforces since there are many Russian contests. In an contest lasting forT minutes there are n problems, and for the ith problem you can getai−di∗ti points, where ai ind
2017-07-24 19:41:36 394
原创 The Pilots Brothers' refrigerator高效贪心算法
DescriptionThe game “The Pilots Brothers: following the stripy elephant” has a quest where a player needs to open a refrigerator.There are 16 handles on the refrigerator door. Every handle can b
2017-02-08 21:02:24 504
原创 Filp Game
Description Flip game is played on a rectangular 4x4 field with two-sided pieces placed on each of its 16 squares. One side of each piece is white and the other one is black and each piece is lying
2017-02-07 20:54:54 441
原创 bookshelf-01背包问题
desriptionFarmer John recently bought another bookshelf for the cow library, but the shelf is getting filled up quite quickly, and now the only available space is at the top.FJ has N cows
2017-02-06 19:20:19 349
原创 饭卡-背包问题
description 电子科大本部食堂的饭卡有一种很诡异的设计,即在购买之前判断余额。如果购买一个商品之前,卡上的剩余金额大于或等于5元,就一定可以购买成功(即使购买后卡上余额为负),否则无法购买(即使金额足够)。所以大家都希望尽量使卡上的余额最少。 某天,食堂中有n种菜出售,每种菜可购买一次。已知每种菜的价格以及卡上的余额,问最少可使卡上的余额为多少。 Input多组
2017-02-06 18:48:13 501
原创 kmp.gcd.快速幂.判断素数模板
1.kmp模板void getfill(string s) { memset(f,0,sizeof(f)); //根据其前一个字母得到 for(int i=1;i { int j=f[i]; while(j && s[i]!=s[j]) j=f[j];
2017-01-28 12:41:13 261
原创 SDNU1185统计数字
Description某次科研调查时得到了n个自然数,每个数均不超过1500000000(1.5*109)。已知不相同的数不超过10000个,现在需要统计这些自然数各自出现的次数,并按照自然数从小到大的顺序输出统计结果。Input输入包含n+1行;第一行是整数n,表示自然数的个数,1第2~n+1每行一个自然数,每个数均不超过1 500 000 000
2017-01-24 18:13:23 515
原创 map基本用法
最近在学习map映照容器,感觉真心好用头文件:#include定义:map v;(支持int,string,bool,char,float,double)插入元素:v[5]='A'; v[8]='B';删除元素:v.erase(5);清空容器:v.clear();向前遍历元素:map::iterator it;for(it=v.begin();it!
2017-01-24 18:01:12 316
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人