![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
HDOJ/POJ
hpuhjl
这个作者很懒,什么都没留下…
展开
-
POJ 1017 Packets
升级pip pip install --upgrade pip原创 2017-01-18 14:01:22 · 1815 阅读 · 0 评论 -
HDOJ 2048 神、上帝以及老天爷
Problem DescriptionHDU 2006'10 ACM contest的颁奖晚会隆重开始了!为了活跃气氛,组织者举行了一个别开生面、奖品丰厚的抽奖活动,这个活动的具体要求是这样的:首先,所有参加晚会的人员都将一张写有自己名字的字条放入抽奖箱中;然后,待所有字条加入完毕,每人从箱中取一个字条;最后,如果取得的字条上写的就是自己的名字,那么“恭喜你,中奖了!”大家可以想象一...原创 2014-07-26 17:08:43 · 1661 阅读 · 0 评论 -
POJ 2409 Let it Bead
Description"Let it Bead" company is located upstairs at 700 Cannery Row in Monterey, CA. As you can deduce from the company name, their business is beads. Their PR department found out that customers...原创 2014-08-02 09:29:20 · 2006 阅读 · 0 评论 -
POJ 3624 Charm Bracelet
DescriptionBessie has gone to the mall's jewelry store and spies a charm bracelet. Of course, she'd like to fill it with the best charms possible from the N (1 ≤ N ≤ 3,402) available charms. Each ch...原创 2014-08-01 11:09:11 · 1789 阅读 · 0 评论 -
POJ 2407 Relatives
DescriptionGiven n, a positive integer, how many positive integers less than n are relatively prime to n? Two integers a and b are relatively prime if there are no integers x > 1, y > 0, z >...原创 2014-08-04 19:54:22 · 2654 阅读 · 4 评论 -
POJ 3981 字符串替换
Description编写一个C程序实现将字符串中的所有"you"替换成"we"Input输入包含多行数据每行数据是一个字符串,长度不超过1000数据以EOF结束Output对于输入的每一行,输出替换后的字符串Sample Inputyou are what you doSample Outputwe are what we do#include<...原创 2014-08-06 09:02:06 · 2153 阅读 · 0 评论 -
POJ 1328 Radar Installation 几何转化、区间覆盖
DescriptionAssume the coasting is an infinite straight line. Land is in one side of coasting, sea in the other. Each small island is a point locating in the sea side. And any radar installation, loc...原创 2014-11-26 10:59:27 · 2243 阅读 · 0 评论 -
POJ 3050 Hopscotch 搜索、去重
DescriptionThe cows play the child's game of hopscotch in a non-traditional way. Instead of a linear set of numbered boxes into which to hop, the cows create a 5x5 rectilinear grid of digits paralle...原创 2014-11-26 11:19:49 · 2454 阅读 · 0 评论 -
POJ 1862 Stripies 优先队列
DescriptionOur chemical biologists have invented a new very useful form of life called stripies (in fact, they were first called in Russian - polosatiki, but the scientists had to invent an English ...原创 2014-11-26 11:36:58 · 2653 阅读 · 0 评论 -
POJ 2506 Tiling
DescriptionIn how many ways can you tile a 2xn rectangle by 2x1 or 2x2 tiles?Here is a sample tiling of a 2x17 rectangle.InputInput is a sequence of lines, each line containing an integer number ...原创 2014-08-05 09:54:12 · 2432 阅读 · 0 评论 -
POJ 2567 Code the Tree
DescriptionA tree (i.e. a connected graph without cycles) with vertices numbered by the integers 1, 2, ..., n is given. The "Prufer" code of such a tree is built as follows: the leaf (a vertex that i...原创 2014-08-05 09:43:34 · 1924 阅读 · 0 评论 -
POJ 3262 Protecting the Flowers
DescriptionFarmer John went to cut some wood and left N (2 ≤ N ≤ 100,000) cows eating the grass, as usual. When he returned, he found to his horror that the cluster of cows was in his garden eating ...原创 2014-07-25 11:24:49 · 1056 阅读 · 0 评论 -
POJ 1003 Hangover
DescriptionHow far can you make a stack of cards overhang a table? If you have one card, you can create a maximum overhang of half a card length. (We're assuming that the cards must be perpendicular...原创 2014-07-26 09:14:18 · 2901 阅读 · 0 评论 -
POJ 1004 Financial Management
DescriptionLarry graduated this year and finally has a job. He's making a lot of money, but somehow never seems to have enough. Larry has decided that he needs to grab hold of his financial portfolio...原创 2014-07-26 17:26:39 · 1524 阅读 · 0 评论 -
POJ 3090 Visible Lattice Points
DescriptionA lattice point (x, y) in the first quadrant (x and y are integers greater than or equal to 0), other than the origin, is visible from the origin if the line from (0, 0) to (x, y) does no...原创 2014-08-04 18:16:52 · 2158 阅读 · 0 评论 -
POJ 3176 Cow Bowling
DescriptionThe cows don't use actual bowling balls when they go bowling. They each take a number (in the range 0..99), though, and line up in a standard bowling-pin-like triangle like this:...原创 2014-08-05 09:15:39 · 3045 阅读 · 0 评论 -
POJ 3045 Cow Acrobats
DescriptionFarmer John's N (1 <= N <= 50,000) cows (numbered 1..N) are planning to run away and join the circus. Their hoofed feet prevent them from tightrope walking and swinging from the trap...原创 2014-08-05 09:20:53 · 1934 阅读 · 0 评论 -
POJ 2823 Sliding Window
DescriptionAn array of size n ≤ 106 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 windo...原创 2014-08-05 09:23:43 · 2357 阅读 · 0 评论 -
POJ 2769 Reduced ID Numbers
DescriptionT. Chur teaches various groups of students at university U. Every U-student has a unique Student Identification Number (SIN). A SIN s is an integer in the range 0 ≤ s ≤ MaxSIN with MaxSIN ...原创 2014-08-05 09:35:25 · 2137 阅读 · 0 评论 -
POJ 1979 Red and Black 搜索
DescriptionThere is a rectangular room, covered with square tiles. Each tile is colored either red or black. A man is standing on a black tile. From a tile, he can move to one of four adjacent tiles...原创 2014-11-26 12:19:08 · 2273 阅读 · 0 评论 -
POJ 3187 Backward Digit Sums next_permutation
DescriptionFJ and his cows enjoy playing a mental game. They write down the numbers from 1 to N (1 <= N <= 10) in a certain order and then sum adjacent numbers to produce a new list with one f...原创 2014-11-26 12:32:53 · 1950 阅读 · 0 评论 -
POJ 2377 Bad Cowtractors
DescriptionBessie has been hired to build a cheap internet network among Farmer John's N (2 <= N <= 1,000) barns that are conveniently numbered 1..N. FJ has already done some surveying, and fou...原创 2014-08-26 10:31:53 · 2460 阅读 · 0 评论 -
POJ 2239 Selecting Courses
DescriptionIt is well known that it is not easy to select courses in the college, for there is usually conflict among the time of the courses. Li Ming is a student who loves study every much, and at ...原创 2014-08-26 11:04:30 · 2554 阅读 · 0 评论 -
POJ 2183 Bovine Math Geniuses
DescriptionFarmer John loves to help the cows further their mathematical skills. He has promised them Hay-flavored ice cream if they can solve various mathematical problems.He said to Bessie, "Choo...原创 2014-10-19 16:17:41 · 2342 阅读 · 0 评论 -
POJ 2109 Power of Cryptography
DescriptionCurrent work in cryptography involves (among other things) large prime numbers and computing powers of numbers among these primes. Work in this area has resulted in the practical use of re...原创 2014-11-26 16:15:57 · 1910 阅读 · 0 评论 -
POJ 1423 Big Number
DescriptionIn many applications very large integers numbers are required. Some of these applications are using keys for secure transmission of data, encryption, etc. In this problem you are given a n...原创 2015-03-25 21:23:17 · 3365 阅读 · 0 评论 -
POJ 1338 Ugly Numbers
DescriptionUgly numbers are numbers whose only prime factors are 2, 3 or 5. The sequence1, 2, 3, 4, 5, 6, 8, 9, 10, 12, ...shows the first 10 ugly numbers. By convention, 1 is included.Given the i...原创 2015-03-25 22:52:28 · 3240 阅读 · 0 评论 -
POJ 1308 Is It A Tree?
DescriptionA tree is a well-known data structure that is either empty (null, void, nothing) or is a set of one or more nodes connected by directed edges between nodes satisfying the following propert...原创 2015-03-26 13:05:58 · 2640 阅读 · 0 评论 -
POJ 1258 Agri-Net
今天看到某视频网站的视频, 想下载下来, 但是网站不支持下载, 然后发现网站的源码存在下载链接, 于是就想用python跑一下, 把视频批量下载下来 几行代码搞定, 确实很方便import urllib2// 循环for i in range(1, 4, 1): // 拼接视频地址 url = 'http://csshtml%d.m4v' % i f = urllib2原创 2016-08-19 19:29:29 · 1876 阅读 · 0 评论 -
POJ 2388 Who's in the Middle
DescriptionFJ is surveying his herd to find the most average cow. He wants to know how much milk this 'median' cow gives: half of the cows give as much or more than the median; half give as much or l...原创 2014-08-26 10:30:33 · 2403 阅读 · 0 评论 -
POJ 2393 Yogurt factory
DescriptionThe cows have purchased a yogurt factory that makes world-famous Yucky Yogurt. Over the next N (1 <= N <= 10,000) weeks, the price of milk and labor will fluctuate weekly such that i...原创 2014-08-26 10:26:07 · 2365 阅读 · 0 评论 -
POJ 2229 Sumsets 动态规划
DescriptionFarmer John commanded his cows to search for different sets of numbers that sum to a given number. The cows use only numbers that are an integer power of 2. Here are the possible sets of ...原创 2014-11-26 12:49:49 · 2064 阅读 · 0 评论 -
POJ 3253 Fence Repair 哈夫曼树、优先队列
DescriptionFarmer John wants to repair a small length of the fence around the pasture. He measures the fence and finds that he needsN(1 ≤N≤ 20,000) planks of wood, each having some integer lengt...原创 2014-11-27 14:49:00 · 2574 阅读 · 0 评论 -
POJ 2406 Power Strings KMP
DescriptionGiven two strings a and b we define a*b to be their concatenation. For example, if a = "abc" and b = "def" then a*b = "abcdef". If we think of concatenation as multiplication, exponentiat...原创 2014-11-30 01:51:22 · 2745 阅读 · 0 评论 -
POJ 2752 Seek the Name, Seek the Fame KMP
DescriptionThe little cat is so famous, that many couples tramp over hill and dale to Byteland, and asked the little cat to give names to their newly-born babies. They seek the name, and at the same...原创 2014-11-30 01:56:36 · 2516 阅读 · 0 评论 -
POJ 1631 Bridging signals 最长上升子序列
Description'Oh no, they've done it again', cries the chief designer at the Waferland chip factory. Once more the routing designers have screwed up completely, making the signals on the chip connecti...原创 2014-12-01 17:55:23 · 2281 阅读 · 0 评论 -
POJ 3904 Sky Code 容斥原理
DescriptionStancu likes space travels but he is a poor software developer and will never be able to buy his own spacecraft. That is why he is preparing to steal the spacecraft of Petru. There is onl...原创 2014-12-08 21:36:05 · 2413 阅读 · 0 评论 -
POJ 2773 Happy2006 容斥原理
DescriptionTwo positive integers are said to be relatively prime to each other if the Great Common Divisor (GCD) is 1. For instance, 1, 3, 5, 7, 9...are all relatively prime to 2006.Now your job i...原创 2014-12-10 17:27:17 · 2384 阅读 · 0 评论 -
POJ 2395 Out of Hay
DescriptionThe cows have run out of hay, a horrible event that must be remedied immediately. Bessie intends to visit the other farms to survey their hay situation. There are N (2 <= N <= 2,000)...原创 2014-08-26 10:23:28 · 3104 阅读 · 0 评论 -
HDOJ 4882 ZCC Loves Codefires
ZCC Loves CodefiresTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 0Accepted Submission(s): 0Problem DescriptionThough ...原创 2014-07-24 13:42:17 · 1136 阅读 · 1 评论