- 博客(48)
- 问答 (1)
- 收藏
- 关注
转载 广搜:吃豆子
Description 吃豆人是一款非常经典的游戏,游戏中玩家控制吃豆人在地图上吃光所有豆子,并且避免被怪物抓住。这道题没有怪物,将游戏的画面分成n*m的格子,每格地形可能为空地或者障碍物,吃豆人可以在空地上移动,吃豆人每移动一格需要1s时间,并且只能朝上下左右四个方向移动,特别的是吃豆人还能吐出舌头,舌头每移动一格需要0.1s时间,舌头只可以走直线。不必考虑吃豆人转身所需要的时间。举例,吃豆人在
2016-07-29 16:47:59 359
原创 在一个数中去掉指定个数的数字使其结果最小
Description Given you one n-digital positive integer a,After removing any of them k( k < n) digits, the remaining figures form a new positive integer according to the origin order. For a given n-digit
2016-07-29 16:39:59 873
原创 求阶乘是某个数的最大多少次方
Description As we know n!=1*2*3*…*n, but n! could be extreme huge. For example when n=100 then n! is nearly 9.3*10^157.But now your task is not to calculate the exact value of n! .Given two kind of op
2016-07-29 16:14:58 626
原创 dp: POJ 3046 Ant Counting
Description Bessie was poking around the ant hill one day watching the ants march to and fro while gathering food. She realized that many of the ants were siblings, indistinguishable from one another.
2016-07-29 14:29:39 348
原创 逆求冒泡排序原序列个数
Bubble sort is a simple sorting algorithm. It works by repeatedly stepping through the list to be sorted, comparing each pair of adjacent items and swapping them if they are in the wrong order. The pas
2016-07-29 12:56:12 500
原创 POJ2418:字典树:Hardwood Species(二叉搜索树)
DescriptionHardwoods are the botanical group of trees that have broad leaves, produce a fruit or nut, and generally go dormant in the winter. America’s temperate climates produce forests with hundred
2016-07-28 09:07:51 428
原创 线段树:周长并:hdu1828 Picture
http://acm.hust.edu.cn/vjudge/contest/121640#problem/RDescription A number of rectangular posters, photographs and other pictures of the same shape are pasted on a wall. Their sides are all vertical o
2016-07-27 15:36:29 316
原创 单调栈:POJ2082:Terrible Sets
http://poj.org/problem?id=2082Language: Terrible Sets Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 4355 Accepted: 2254 DescriptionLet N be the set of all natural numbers {0 ,
2016-07-25 14:29:41 239
原创 (磨人的小妖精)hdu 1542 Atlantis:线段树扫描线,离散化
http://acm.hdu.edu.cn/showproblem.php?pid=1542DescriptionThere are several ancient Greek texts that contain descriptions of the fabled island Atlantis. Some of these texts even include maps of parts o
2016-07-24 21:40:45 366
原创 线段树,区间更新,位运算: poj2777Count Color
Description Chosen Problem Solving and Program design as an optional course, you are required to solve all kinds of problems. Here, we get a new problem. There is a very long board with length L centi
2016-07-24 12:52:39 460
转载 线段树
【完全版】线段树(转载) 转载自:http://www.notonlysuccess.com/膜拜之。。。【完全版】线段树 很早前写的那篇线段树专辑至今一直是本博客阅读点击量最大的一片文章,当时觉得挺自豪的,还去pku打广告,但是现在我自己都不太好意思去看那篇文章了,觉得当时的代码风格实在是太丑了,很多线段树的初学者可能就是看着这篇文章来练习的,如果不小心被我培养出了这么糟糕的风格,实在是过意不
2016-07-23 19:37:38 289
原创 dfs:Codeforces--14D--Two Paths(树的直径)
Description As you know, Bob’s brother lives in Flatland. In Flatland there are n cities, connected by n - 1 two-way roads. The cities are numbered from 1 to n. You can get from one city to another mo
2016-07-21 21:35:04 356
原创 CodeForces 288C
Description Little penguin Polo likes permutations. But most of all he likes permutations of integers from 0 to n, inclusive.For permutation p = p0, p1, …, pn, Polo has defined its beauty — number .Ex
2016-07-21 19:57:40 341
原创 dp:房间
Description One day, little Vasya found himself in a maze consisting of (n + 1) rooms, numbered from 1 to (n + 1). Initially, Vasya is at the first room and to get out of the maze, he needs to get to
2016-07-21 19:01:29 461
原创 糟心啊
Description Teacher thinks that we make a lot of progress. Now we are even allowed to use decimal notation instead of counting sticks. After the test the teacher promised to show us a “very beautiful
2016-07-21 16:14:51 279
原创 BFS:森林着火
Description input input.txt output output.txt After a terrifying forest fire in Berland a forest rebirth program was carried out. Due to it N rows with M trees each were planted and the rows were
2016-07-20 14:55:58 554 2
原创 树状数组加DP
Description Sereja has a sequence that consists of n positive integers, a1, a2, …, an.First Sereja took a piece of squared paper and wrote all distinct non-empty non-decreasing subsequences of sequenc
2016-07-20 14:51:04 383
原创 巧用素数筛2
Description Recently, the bear started studying data structures and faced the following problem.You are given a sequence of integers x1, x2, …, xn of length n and m queries, each of them is characteri
2016-07-20 09:25:39 293
原创 巧用素数筛1
Description Everybody knows any number can be combined by the prime number. Now, your task is telling me what position of the largest prime factor. The position of prime 2 is 1, prime 3 is 2, and
2016-07-20 09:20:25 296
原创 糟心的回文串
Description devtang在某一天无聊至极,突然萌生了一种想法:devtang想到了一些特殊的字符串,现在他需要你来帮助他构造这些特殊的字符串,比如说:这个字符串(长度为n,最多由m种字符组成)其中任意长度为k的子串必须是回文串。那么这样的串你能构造出多少个呢?这个数可能很大,所以结果必须mod1000000007,小心不要遗漏任何字符串。Input 输入共有三个数据:n, m an
2016-07-19 18:41:25 292
原创 概率DP:飞行棋hdu4405
Description Hzz loves aeroplane chess very much. The chess map contains N+1 grids labeled from 0 to N. Hzz starts at grid 0. For each step he throws a dice(a dice have six faces with equal probability
2016-07-19 08:46:48 423
转载 爆搜
Description XCOM-Enemy Unknown是一款很好玩很经典的策略游戏. 在游戏中,由于未知的敌人–外星人入侵,你团结了世界各大国家进行抵抗. 随着游戏进展,会有很多的外星人进攻事件.每次进攻外星人会选择3个国家攻击,作为联盟的指挥者,你要安排有限的联盟军去支援其中一个国家,抵抗进攻这个国家的外星人. 战斗胜利之后这个被支援的国家恐慌值就会-2点 (恐慌值最少减为1),而其他
2016-07-18 20:44:31 362
原创 简化版大数乘法
Description Dear Uncle Jack is willing to give away some of his collectable CDs to his nephews. Among the titles you can find very rare albums of Hard Rock, Classical Music, Reggae and much more; each
2016-07-13 19:39:01 262
转载 抽屉原理
Description Every year there is the same problem at Halloween: Each neighbour is only willing to give a certain total number of sweets on that day, no matter how many children call on him, so it may h
2016-07-11 20:15:44 145
转载 抽屉原理
Description Every year there is the same problem at Halloween: Each neighbour is only willing to give a certain total number of sweets on that day, no matter how many children call on him, so it may h
2016-07-11 20:15:28 213
转载 水果拼盘
Description 转眼到了收获的季节,由于有TT的专业指导,Lele获得了大丰收。特别是水果,Lele一共种了N种水果,有苹果,梨子,香蕉,西瓜……不但味道好吃,样子更是好看。 于是,很多人们慕名而来,找Lele买水果。 甚至连大名鼎鼎的HDU ACM总教头 lcy 也来了。lcy抛出一打百元大钞,”我要买由M个水果组成的水果拼盘,不过我有个小小的要求,对于每种水果,个数上我有限制,既不能少
2016-07-11 15:16:42 622
原创 找规律:Ball rearange
Description Bob has N balls and A boxes. He numbers the balls from 0 to N-1, and numbers the boxes from 0 to A-1. To find the balls easily, he puts the ball numbered x into the box numbered a if x =
2016-07-11 14:29:18 321
原创 进制天平
Description Give you a scale, a goods weigts m kilograms. And then give you some stones weighting 1, 3, 9, 27, …, 3^k. Of course, the number of different weights’ is only ONE. Now put the goods on the
2016-07-11 10:45:10 258
转载 区间DP:Brackets
Description We give the following inductive definition of a “regular brackets” sequence:the empty sequence is a regular brackets sequence, if s is a regular brackets sequence, then (s) and [s] are re
2016-07-09 19:57:58 282
转载 The Tower of Babylon
Description Download as PDF Perhaps you have heard of the legend of the Tower of Babylon. Nowadays many details of this tale have been forgotten. So now, in line with the educational nature of this c
2016-07-09 18:33:05 233
原创 单调队列: Sliding Window
Description An array of size n ≤ 10 6 is given to you. There is a sliding window of size k which is moving from the very left of the array to the very right. You can only see the k numbers in the wind
2016-07-09 15:10:21 331
转载 三分
Description Josephina is a clever girl and addicted to Machine Learning recently. She pays much attention to a method called Linear Discriminant Analysis, which has many interesting properties.
2016-07-08 18:19:50 304
原创 并查集
Description When ALPC42 got to a panzer brigade, He was asked to build software to help them regroup the battalions or companies. As the tradition of army, soldiers are rated according his or her ab
2016-07-08 18:11:08 305
转载 hdu2845之Beans,DP
hdu2845之Beans,DP 2012-12-08 16:12 533人阅读 评论(0) 收藏 举报 版权声明:本文为博主原创文章,未经博主允许不得转载。 Problem Description Bean-eating is an interesting game, everyone owns an M*N matrix, which is filled with different q
2016-07-07 21:30:21 263
转载 贪心: hdu 3866 Moonfang's Birthday
Description It’s Moonfang’s birthday,and his friends decided to buy him a copy of XianJianQiXiaZhuan V. Since some of friends have more money available than others, nobody has to pay more than he can
2016-07-07 20:02:32 299
转载 树状数组 模板:敌兵布阵
Description C国的死对头A国这段时间正在进行军事演习,所以C国间谍头子Derek和他手下Tidy又开始忙乎了。A国在海岸线沿直线布置了N个工兵营地,Derek和Tidy的任务就是要监视这些工兵营地的活动情况。由于采取了某种先进的监测手段,所以每个工兵营地的人数C国都掌握的一清二楚,每个工兵营地的人数都有可能发生变动,可能增加或减少若干人手,但这些都逃不过C国的监视。 中央情报局要研
2016-07-06 21:03:34 280
转载 单调队列
Description What a sunny day! Let’s go picnic and have barbecue! Today, all kids in “Sun Flower” kindergarten are prepared to have an excursion. Before kicking off, teacher Liu tells them to stand in
2016-07-06 20:59:52 429 2
原创 小蜗牛
Description Once upon a time, there was a poor snail. Every day, it tried very hard to crawl forward, while there was a keeper who’d like to maltreat this poor little snail. The snail was crawling on
2016-07-06 18:42:39 299
原创 物理数学题
Description The recreation center of WHU ACM Team has indoor billiards, Ping Pang, chess and bridge, toxophily, deluxe ballrooms KTV rooms, fishing, climbing, and so on. We all like toxophily. Bob i
2016-07-06 18:35:03 356
原创 dp:苹果树与毛虫
Description 自从见识了平安夜苹果的涨价后,Lele就在他家门口水平种了一排苹果树,共有N棵。 突然Lele发现在左起第P棵树上(从1开始计数)有一条毛毛虫。为了看到毛毛虫变蝴蝶的过程,Lele在苹果树旁观察了很久。虽然没有看到蝴蝶,但Lele发现了一个规律:每过1分钟,毛毛虫会随机从一棵树爬到相邻的一棵树上。 比如刚开始毛毛虫在第2棵树上,过1分钟后,毛毛虫可能会在第1棵树上或者第3棵
2016-07-06 18:30:24 496
空空如也
python使用pygal报错:
2017-08-05
TA创建的收藏夹 TA关注的收藏夹
TA关注的人