随笔分类 -  POJ

摘要:ShowstopperTime Limit:1000MSMemory Limit:65536KTotal Submissions:1060Accepted:303DescriptionData-mining huge data sets can be a painful and long lasting process if we are not aware of tiny patterns existing within those data sets.One reputable company has recently discovered a tiny bug in their hard 阅读全文
posted @ 2014-03-23 23:21 hyx1 阅读(361) 评论(0) 推荐(0)
摘要:Moo University - Financial AidTime Limit:1000MSMemory Limit:30000KTotal Submissions:4235Accepted:1293DescriptionBessie noted that although humans have many universities they can attend, cows have none. To remedy this problem, she and her fellow cows formed a new university called The University of W 阅读全文
posted @ 2014-03-22 11:23 hyx1 阅读(411) 评论(0) 推荐(0)
摘要:Telephone LinesTime Limit:1000MSMemory Limit:65536KTotal Submissions:4591Accepted:1693DescriptionFarmer John wants to set up a telephone line at his farm. Unfortunately, the phone company is uncooperative, so he needs to pay for some of the cables required to connect his farm to the phone system.The 阅读全文
posted @ 2014-03-21 19:31 hyx1 阅读(444) 评论(0) 推荐(0)
摘要:MatrixTime Limit:6000MSMemory Limit:65536KTotal Submissions:4428Accepted:1102DescriptionGiven aN×Nmatrix A, whose element in thei-th row andj-th columnAijis an number that equalsi2+ 100000 ×i+j2- 100000 ×j+i×j, you are to find theM-th smallest element in the matrix.InputThe first 阅读全文
posted @ 2014-03-19 20:05 hyx1 阅读(435) 评论(0) 推荐(0)
摘要:Dropping testsTime Limit:1000MSMemory Limit:65536KTotal Submissions:5459Accepted:1889DescriptionIn a certain course, you takentests. If you getaiout ofbiquestions correct on testi, your cumulative average is defined to be.Given your test scores and a positive integerk, determine how high you can mak 阅读全文
posted @ 2014-03-19 17:15 hyx1 阅读(153) 评论(0) 推荐(0)
摘要:Muddy FieldsTime Limit:1000MSMemory Limit:65536KTotal Submissions:7557Accepted:2791DescriptionRain has pummeled the cows' field, a rectangular grid of R rows and C columns (1 2 #include 3 #include 4 #include 5 #include 6 7 using namespace std; 8 9 #define maxn 5510 #define maxnode 250511 12 c... 阅读全文
posted @ 2014-03-18 20:52 hyx1 阅读(181) 评论(0) 推荐(0)
摘要:Purifying MachineTime Limit: 2000MSMemory Limit: 65536KTotal Submissions: 4014Accepted: 1127DescriptionMike is the owner of a cheese factory. He has 2N cheeses and each cheese is given a binary number from 00...0 to 11...1. To keep his cheese free from viruses, he made himself a purifying machine to 阅读全文
posted @ 2014-03-15 17:33 hyx1 阅读(264) 评论(0) 推荐(0)
摘要:KindergartenTime Limit: 2000MSMemory Limit: 65536KTotal Submissions: 4787Accepted: 2326DescriptionIn a kindergarten, there are a lot of kids. All girls of the kids know each other and all boys also know each other. In addition to that, some girls and boys know each other. Now the teachers want to pi 阅读全文
posted @ 2014-03-15 16:18 hyx1 阅读(197) 评论(0) 推荐(0)
摘要:Girls and BoysTime Limit: 5000MSMemory Limit: 10000KTotal Submissions: 10008Accepted: 4427DescriptionIn the second year of the university somebody started a study on the romantic relations between the students. The relation "romantically involved" is defined between one girl and one boy. F 阅读全文
posted @ 2014-03-15 15:53 hyx1 阅读(201) 评论(0) 推荐(0)
摘要:The Perfect StallTime Limit: 1000MSMemory Limit: 10000KTotal Submissions: 17246Accepted: 7872DescriptionFarmer John completed his new barn just last week, complete with all the latest milking technology. Unfortunately, due to engineering problems, all the stalls in the new barn are different. For th 阅读全文
posted @ 2014-03-15 14:03 hyx1 阅读(148) 评论(0) 推荐(0)
摘要:K BestTime Limit: 8000MSMemory Limit: 65536KTotal Submissions: 5177Accepted: 1411Case Time Limit: 2000MSSpecial JudgeDescriptionDemy has n jewels. Each of her jewels has some value vi and weight wi.Since her husband John got broke after recent financial crises, Demy has decided to sell some jewels. 阅读全文
posted @ 2014-03-14 14:18 hyx1 阅读(171) 评论(0) 推荐(0)
摘要:MedianTime Limit: 1000MSMemory Limit: 65536KTotal Submissions: 3528Accepted: 1001DescriptionGiven N numbers, X1, X2, ... , XN, let us calculate the difference of every pair of numbers: ∣Xi - Xj∣ (1 ≤ i < j ≤ N). We can get C(N,2) differences through this work, and now your task is to find the median 阅读全文
posted @ 2014-03-14 12:32 hyx1 阅读(299) 评论(0) 推荐(0)
摘要:Cow AcrobatsTime Limit:1000MSMemory Limit:65536KTotal Submissions:2302Accepted:912DescriptionFarmer John's N (1 2 #include 3 #include 4 5 using namespace std; 6 7 #define maxn 50005 8 9 #define INF (1 << 30)10 11 struct node {12 int w,s;13 };14 15 node s[maxn];16 int n;17 18 bool cmp(n... 阅读全文
posted @ 2014-03-14 00:29 hyx1 阅读(359) 评论(0) 推荐(0)
摘要:DryingTime Limit:2000MSMemory Limit:65536KTotal Submissions:7959Accepted:2014DescriptionIt is very hard to wash and especially to dry clothes in winter. But Jane is a very smart girl. She is not afraid of this boring process. Jane has decided to use a radiator to make drying faster. But the radiator 阅读全文
posted @ 2014-03-13 22:28 hyx1 阅读(256) 评论(0) 推荐(0)
摘要:River HopscotchTime Limit: 2000MSMemory Limit: 65536KTotal Submissions: 5961Accepted: 2579DescriptionEvery year the cows hold an event featuring a peculiar version of hopscotch that involves carefully jumping from rock to rock in a river. The excitement takes place on a long, straight river with a r 阅读全文
posted @ 2014-03-13 19:46 hyx1 阅读(163) 评论(0) 推荐(0)
摘要:Monthly ExpenseTime Limit: 2000MSMemory Limit: 65536KTotal Submissions: 12122Accepted: 4932DescriptionFarmer John is an astounding accounting wizard and has realized he might run out of money to run the farm. He has already calculated and recorded the exact amount of money (1 ≤ moneyi ≤ 10,000) that 阅读全文
posted @ 2014-03-13 19:15 hyx1 阅读(221) 评论(0) 推荐(0)
摘要:Dead FractionTime Limit:1000MSMemory Limit:30000KTotal Submissions:1762Accepted:568DescriptionMike is frantically scrambling to finish his thesis at the last minute. He needs to assemble all his research notes into vaguely coherent form in the next 3 days. Unfortunately, he notices that he had been 阅读全文
posted @ 2014-03-12 22:27 hyx1 阅读(222) 评论(0) 推荐(0)
摘要:Raising Modulo NumbersTime Limit: 1000MSMemory Limit: 30000KTotal Submissions: 4271Accepted: 2433DescriptionPeople are different. Some secretly read magazines full of interesting girls' pictures, others create an A-bomb in their cellar, others like using Windows, and some like difficult mathemat 阅读全文
posted @ 2014-03-12 10:16 hyx1 阅读(254) 评论(0) 推荐(0)
摘要:Pseudoprime numbersTime Limit: 1000MSMemory Limit: 65536KTotal Submissions: 6044Accepted: 2421DescriptionFermat's theorem states that for any prime number p and for any integer a > 1, ap = a (mod p). That is, if we raise a to the pth power and divide by p, the remainder is a. Some (but not ve 阅读全文
posted @ 2014-03-10 20:55 hyx1 阅读(223) 评论(0) 推荐(0)
摘要:Semi-prime H-numbersTime Limit: 1000MSMemory Limit: 65536KTotal Submissions: 7059Accepted: 3030DescriptionThis problem is based on an exercise of David Hilbert, who pedagogically suggested that one study the theory of 4n+1 numbers. Here, we do only a bit of that.An H-number is a positive number whic 阅读全文
posted @ 2014-03-10 20:29 hyx1 阅读(385) 评论(0) 推荐(0)