- 博客(10)
- 收藏
- 关注
原创 枚举//可用动规写
/* Polycarp likes numbers that are divisible by 3. He has a huge number ss. Polycarp wants to cut from it the maximum number of numbers that are divisible by 33. To do this, he makes an arbitrary num...
2018-08-11 20:11:03 189
原创 动规降维
/* 一个M*N矩阵中有不同的正整数,经过这个格子,就能获得相应价值的奖励,先从左上走到右下,再从右下走到左上。第1遍时只能向下和向右走,第2遍时只能向上和向左走。两次如果经过同一个格子,则该格子的奖励只计算一次,求能够获得的最大价值。 例如:3 * 3的方格。 1 3 3 2 1 3 2 2 1 能够获得的最大价值为:17。1 -> 3 -> 3 -> 3 -> ...
2018-08-11 20:01:55 161
原创 树直练习
/* The northern part of the Pyramid contains a very large and complicated labyrinth. The labyrinth is divided into square blocks, each of them either filled by rock, or free. There is also a little ho...
2018-08-04 20:51:07 217
原创 树的直径基础题
/* After hearing about the epidemic of obesity in the USA, Farmer John wants his cows to get more exercise, so he has committed to create a bovine marathon for his cows to run. The marathon route will...
2018-08-04 20:47:32 495
原创 拓扑判断是否有环
/* ACM-DIY is a large QQ group where many excellent acmers get together. It is so harmonious that just like a big family. Every day,many "holy cows" like HH, hh, AC, ZT, lcc, BF, Qinz and so on chat o...
2018-08-04 20:45:00 456
原创 拓扑基础题
/* 有N个比赛队(1<=N<=500),编号依次为1,2,3,。。。。,N进行比赛,比赛结束后,裁判委员会要将所有参赛队伍从前往后依次排名,但现在裁判委员会不能直接获得每个队的比赛成绩,只知道每场比赛的结果,即P1赢P2,用P1,P2表示,排名时P1在P2之前。现在请你编程序确定排名。 Input 输入有若干组,每组中的第一行为二个数N(1<=N<=500),M;其中N...
2018-08-04 20:38:53 461
原创 归并练习题
/* Have you ever played quoit in a playground? Quoit is a game in which flat rings are pitched at some toys, with all the toys encircled awarded. In the field of Cyberground, the position of each toy...
2018-08-03 20:17:15 282
原创 归并基础题
/* 在一个排列中,如果一对数的前后位置与大小顺序相反,即前面的数大于后面的数,那么它们就称为一个逆序。一个排列中逆序的总数就称为这个排列的逆序数。 如2 4 3 1中,2 1,4 3,4 1,3 1是逆序,逆序数是4。给出一个整数序列,求该序列的逆序数。 Input 第1行:N,N为序列的长度(n <= 50000) 第2 - N + 1行:序列中的元素(0 <= Aii <...
2018-08-03 20:13:24 122
原创 dfs 回溯
/* The doggie found a bone in an ancient maze, which fascinated him a lot. However, when he picked it up, the maze began to shake, and the doggie could feel the ground sinking. He realized that the bo...
2018-08-01 20:33:27 426
原创 dfs练习题
/* Fox Ciel is playing a mobile puzzle game called "Two Dots". The basic levels are played on a board of size n?×?m cells, like this: Each cell contains a dot that has some color. We will use differ...
2018-08-01 20:29:37 472
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人