
OJ
三生石1103
我是菜鸟
展开
-
【POJ】poj 1182(并查集)
Description动物王国中有三类动物A,B,C,这三类动物的食物链构成了有趣的环形。A吃B, B吃C,C吃A。现有N个动物,以1-N编号。每个动物都是A,B,C中的一种,但是我们并不知道它到底是哪一种。有人用两种说法对这N个动物所构成的食物链关系进行描述:第一种说法是"1 X Y",表示X和Y是同类。第二种说法是"2 X Y",表示X吃Y。此人对N个动物,用上述...原创 2014-07-24 16:40:46 · 305 阅读 · 0 评论 -
【ZOJ】zoj 1047 (bfs)
</pre><pre name="code" class="cpp"><pre name="code" class="cpp"><div class="hiddable" id="vj_description" style="font-family: 'times new roman'; font-size: 17px; color: rgb(51, 5...原创 2014-07-14 21:46:26 · 8290 阅读 · 0 评论 -
【HDU】hdu 2037(贪心)
Description“今年暑假不AC?”“是的。”“那你干什么呢?”“看世界杯呀,笨蛋!”“@#$%^&*%...”确实如此,世界杯来了,球迷的节日也来了,估计很多ACMer也会抛开电脑,奔向电视了。作为球迷,一定想看尽量多的完整的比赛,当然,作为新时代的好青年,你一定还会看一些其它的节目,比如新闻联播(永远不要忘记关心国家大事)、非常6+7、超级女生,...原创 2014-07-17 16:00:21 · 440 阅读 · 0 评论 -
【POJ】poj 2352
StarsTime Limit:1000MS Memory Limit:65536K Total Submissions:32874 Accepted:14361 DescriptionAstronomers often examine star maps where stars are represented by points...原创 2014-09-10 10:51:15 · 326 阅读 · 0 评论 -
【POJ】poj 1001(高精度)
DescriptionProblems involving the computation of exact values of very large magnitude and precision are common. For example, the computation of the national debt is a taxing experience for many c...原创 2014-09-09 21:06:08 · 521 阅读 · 0 评论 -
【HDU】hdu 4627 动态规划
Problem Description都说天上不会掉馅饼,但有一天gameboy正走在回家的小径上,忽然天上掉下大把大把的馅饼。说来gameboy的人品实在是太好了,这馅饼别处都不掉,就掉落在他身旁的10米范围内。馅饼如果掉在了地上当然就不能吃了,所以gameboy马上卸下身上的背包去接。但由于小径两侧都不能站人,所以他只能在小径上接。由于gameboy平时老呆在房间里玩游戏,虽然在游戏...原创 2014-08-27 22:10:06 · 478 阅读 · 0 评论 -
【HDU】hdu 3846 RMP
Problem DescriptionYaoYao has a company and he wants to employ m people recently. Since his company is so famous, there are n people coming for the interview. However, YaoYao is so busy that h...原创 2014-08-23 20:23:03 · 534 阅读 · 0 评论 -
【HDU】hdu 3579 (同余方程组,逐一合并大法)
Problem DescriptionOne day I was shopping in the supermarket. There was a cashier counting coins seriously when a little kid running and singing "门前大桥下游过一群鸭,快来快来 数一数,二四六七八". And then the cashier ...原创 2014-08-22 16:47:53 · 777 阅读 · 0 评论 -
【HDU】hdu 1114 (完全背包)
DescriptionBefore ACM can do anything, a budget must be prepared and the necessary financial support obtained. The main income for this action comes from Irreversibly Bound Money (IBM). The idea ...原创 2014-07-19 11:42:10 · 598 阅读 · 0 评论 -
【POJ】poj 2479 (DP_优化)
Language:Default Maximum sum Time Limit:1000MS Memory Limit:65536K Total Submissions:33010 Accepted:10205 Description Given a set of n integ...原创 2014-07-18 16:34:09 · 514 阅读 · 0 评论 -
【HDU】hdu 1394(线段树)
DescriptionThe inversion number of a given number sequence a1, a2, ..., an is the number of pairs (ai, aj) that satisfy i < j and ai > aj.For a given sequence of numbers a1, a2, ..., an, i...原创 2014-07-26 21:05:01 · 368 阅读 · 0 评论 -
【HDU】hdu 2795
DescriptionAt the entrance to the university, there is a huge rectangular billboard of size h*w (h is its height and w is its width). The board is the place where all possible announcements are p...原创 2014-07-26 16:56:39 · 391 阅读 · 0 评论 -
【HDU】Hdu 2955 (DP)
DescriptionThe aspiring Roy the Robber has seen a lot of American movies, and knows that the bad guys usually gets caught in the end, often because they become too greedy. He has decided to work ...原创 2014-07-19 10:46:11 · 557 阅读 · 0 评论 -
【HDU】hdu 1081 (dp_区间dp)
DescriptionGiven a two-dimensional array of positive and negative integers, a sub-rectangle is any contiguous sub-array of size 1*1 or greater located within the whole array. The sum of a rectang...原创 2014-07-22 09:51:35 · 564 阅读 · 0 评论 -
【POJ】poj 2488(DFS)
DescriptionBackgroundThe knight is getting bored of seeing the same black and white squares again and again and has decided to make a journeyaround the world. Whenever a knight moves, it is tw...原创 2014-07-17 15:34:42 · 504 阅读 · 0 评论 -
【POJ】poj 3264 ( 线段树)
DescriptionN (2 <= N <= 8,000) cows have unique brands in the range 1..N. In a spectacular display of poor judgment, they visited the neighborhood 'watering hole' and drank a few too many b...原创 2014-07-25 11:47:39 · 354 阅读 · 0 评论 -
【POJ】poj 1988(并查集_点到跟的距离)
DescriptionFarmer John and Betsy are playing a game with N (1 <= N <= 30,000)identical cubes labeled 1 through N. They start with N stacks, each containing a single cube. Farmer John asks B...原创 2014-07-23 20:56:57 · 617 阅读 · 0 评论 -
【POJ】poj 1611(并查集_裸题)
DescriptionSevere acute respiratory syndrome (SARS), an atypical pneumonia of unknown aetiology, was recognized as a global threat in mid-March 2003. To minimize transmission to others, the best ...原创 2014-07-23 15:06:57 · 596 阅读 · 0 评论 -
【POJ】poj 1787(多重背包)
DescriptionCharlie is a driver of Advanced Cargo Movement, Ltd. Charlie drives a lot and so he often buys coffee at coffee vending machines at motorests. Charlie hates change. That is basically t...原创 2014-07-19 19:53:19 · 620 阅读 · 0 评论 -
【POJ】poj 2828
DescriptionRailway tickets were difficult to buy around the Lunar New Year in China, so we must get up early and join a long queue…The Lunar New Year was approaching, but unluckily the Little C...原创 2014-07-26 15:39:49 · 454 阅读 · 0 评论 -
【POJ】poj 1157 (DP)
DescriptionYou want to arrange the window of your flower shop in a most pleasant way. You have F bunches of flowers, each being of a different kind, and at least as many vases ordered in a row. T...原创 2014-07-17 16:32:50 · 580 阅读 · 0 评论 -
【POJ】poj 3304 (计算机图论_直线和线段相交)
DescriptionGivennsegments in the two dimensional space, write a program, which determines if there exists a line such that after projecting these segments on it, all projected segments have at ...原创 2014-08-19 09:59:29 · 490 阅读 · 0 评论 -
【POJ】poj 2528 (线段树_离散化)
DescriptionThe citizens of Bytetown, AB, could not stand that the candidates in the mayoral election campaign have been placing their electoral posters at all places at their whim. The city counc...原创 2014-07-28 14:31:07 · 442 阅读 · 0 评论 -
【POJ】poj 1094(拓扑排序)
DescriptionAn ascending sorted sequence of distinct values is one in which some form of a less-than operator is used to order the elements from smallest to largest. For example, the sorted sequen...原创 2014-07-28 19:09:03 · 601 阅读 · 0 评论 -
【POJ】poj 3253 (贪心)
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 le...原创 2014-07-18 14:26:06 · 497 阅读 · 0 评论 -
【POJ】poj 3320 (尺取法)
DescriptionJessica's a very lovely girl wooed by lots of boys. Recently she has a problem. The final exam is coming, yet she has spent little time on it. If she wants to pass it, she has to maste...原创 2014-09-04 20:15:44 · 440 阅读 · 0 评论 -
hdu 3183 Rmp查询
Problem DescriptionKiki likes traveling. One day she finds a magic lamp, unfortunately the genie in the lamp is not so kind. Kiki must answer a question, and then the genie will realize one of her原创 2014-08-23 17:09:36 · 469 阅读 · 0 评论 -
【POJ】poj 3009 (DFS)
DescriptionOn Planet MM-21, after their Olympic games this year, curling is getting popular. But the rules are somewhat different from ours. The game is played on an ice game board on which a square...原创 2014-07-17 09:10:29 · 534 阅读 · 0 评论 -
【POJ】poj 3278(BFS)
DescriptionFarmer John has been informed of the location of a fugitive cow and wants to catch her immediately. He starts at a pointN(0 ≤N≤ 100,000) on a number line and the cow is at a point...原创 2014-07-17 14:25:19 · 518 阅读 · 0 评论 -
【LightOJ】lightoj 1240 计算机图论(计算三维点到线段的距离)
DescriptionGiven a segment in 3D space, identified byA(x1, y1, z1), B(x2, y2, z2)and another pointP(x, y, z)your task is to find the minimum possible Euclidean distance between the pointPan...原创 2014-08-23 00:04:34 · 1012 阅读 · 0 评论