随笔分类 -  ACM解题报告(POJ)

上一页 1 ··· 6 7 8 9 10 11 下一页

POJ题目
POJ 1141 Brackets Sequence(DP)
摘要:Brackets SequenceTime Limit: 1000MSMemory Limit: 65536KTotal Submissions: 18313Accepted: 5020Special JudgeDescriptionLet us define a regular brackets sequence in the following way: 1. Empty sequence is a regular sequence. 2. If S is a regular sequence, then (S) and [S] are both regular sequences. 3. 阅读全文

posted @ 2012-04-01 22:37 kuangbin 阅读(2260) 评论(0) 推荐(0)

POJ 2007 Scrambled Polygon(极角排序)
摘要:Scrambled PolygonTime Limit: 1000MSMemory Limit: 30000KTotal Submissions: 4849Accepted: 2293DescriptionA closed polygon is a figure bounded by a finite number of line segments. The intersections of the bounding line segments are called the vertices of the polygon. When one starts at any vertex of a 阅读全文

posted @ 2012-03-25 21:58 kuangbin 阅读(785) 评论(0) 推荐(0)

POJ 1696 Space Ant(极角排序)
摘要:Space AntTime Limit: 1000MSMemory Limit: 10000KTotal Submissions: 1799Accepted: 1147DescriptionThe most exciting space discovery occurred at the end of the 20th century. In 1999, scientists traced down an ant-like creature in the planet Y1999 and called it M11. It has only one eye on the left side o 阅读全文

posted @ 2012-03-25 21:35 kuangbin 阅读(1131) 评论(3) 推荐(0)

POJ 3605 Sheryl's Circuit I
摘要:/*题意:就是给你一个有2^n个输入的门电路,初始输入为全0,问至少要改变输入开关多少次(即改变输入中0、1多少次)才能得到所需的0、1输出序列。题意分析:这道题的数据范围为k<10000,所以不能枚举暴搞,只能用递推来求解。仔细分析就可一发现当有多个0或多个1在一起时,是不用改变开关的。只有在输出序列中出现0到1或1到0的跳变时才需要改变开关。*/#include<stdio.h>#include<string.h>#include<algorithm>using namespace std;int ch[10010];char str[10010] 阅读全文

posted @ 2011-11-14 18:17 kuangbin 阅读(402) 评论(0) 推荐(0)

POJ 1192 最优连通子集(树形DP)
摘要:最优连通子集Time Limit: 1000MSMemory Limit: 10000KTotal Submissions: 1649Accepted: 855Description众所周知,我们可以通过直角坐标系把平面上的任何一个点P用一个有序数对(x, y)来唯一表示,如果x, y都是整数,我们就把点P称为整点,否则点P称为非整点。我们把平面上所有整点构成的集合记为W。 定义1 两个整点P1(x1, y1), P2(x2, y2),若|x1-x2| + |y1-y2| = 1,则称P1, P2相邻,记作P1~P2,否则称P1, P2不相邻。 定义 2 设点集S是W的一个有限子集,即S = 阅读全文

posted @ 2011-11-13 12:39 kuangbin 阅读(635) 评论(1) 推荐(0)

POJ1485 Fast Food(DP)
摘要:Fast FoodTime Limit: 1000MSMemory Limit: 10000KTotal Submissions: 1597Accepted: 553Special JudgeDescriptionThe fastfood chain McBurger owns several restaurants along a highway. Recently, they have decided to build several depots along the highway, each one located at a restaurant and supplying sever 阅读全文

posted @ 2011-11-12 14:18 kuangbin 阅读(1611) 评论(1) 推荐(0)

POJ 1013 Counterfeit Dollar(枚举)
摘要:Counterfeit DollarTime Limit: 1000MSMemory Limit: 10000KTotal Submissions: 30917Accepted: 9680DescriptionSally Jones has a dozen Voyageur silver dollars. However, only eleven of the coins are true silver dollars; one coin is counterfeit even though its color and size make it indistinguishable from t 阅读全文

posted @ 2011-11-12 12:52 kuangbin 阅读(599) 评论(0) 推荐(0)

ACM POJ 3981 字符串替换(简单题)
摘要:字符串替换Time Limit: 1000MSMemory Limit: 65536KTotal Submissions: 5975Accepted: 2795Description编写一个C程序实现将字符串中的所有"you"替换成"we"Input输入包含多行数据 每行数据是一个字符串,长度不超过1000 数据以EOF结束Output对于输入的每一行,输出替换后的字符串Sample Inputyou are what you doSample Outputwe are what we doSource#include<stdio.h>#in 阅读全文

posted @ 2011-09-15 22:25 kuangbin 阅读(1106) 评论(0) 推荐(0)

ACM POJ 3979 分数加减法(水题)
摘要:开学以来,各种忙碌,好久没有刷题了。。。。今天在POJ刷了题,,,很简单分数加减法Time Limit: 1000MSMemory Limit: 65536KTotal Submissions: 8389Accepted: 2668Description编写一个C程序,实现两个分数的加减法Input输入包含多行数据 每行数据是一个字符串,格式是"a/boc/d"。 其中a, b, c, d是一个0-9的整数。o是运算符"+"或者"-"。 数据以EOF结束 输入数据保证合法Output对于输入数据的每一行输出两个分数的运算结果。 注意结 阅读全文

posted @ 2011-09-15 22:08 kuangbin 阅读(1709) 评论(0) 推荐(0)

ACM POJ 2505 A multiplication game(博弈)
摘要:A multiplication gameTime Limit: 1000MSMemory Limit: 65536KTotal Submissions: 4108Accepted: 1981DescriptionStan and Ollie play the game of multiplication by multiplying an integer p by one of the numbers 2 to 9. Stan always starts with p = 1, does his multiplication, then Ollie multiplies the number 阅读全文

posted @ 2011-08-29 19:18 kuangbin 阅读(762) 评论(0) 推荐(0)

ACM POJ 1459 Power Network(最大流算法)
摘要:Power NetworkTime Limit: 2000MSMemory Limit: 32768KTotal Submissions: 15399Accepted: 8201DescriptionA power network consists of nodes (power stations, consumers and dispatchers) connected by power transport lines. A node u may be supplied with an amount s(u) >= 0 of power, may produce an amount 0 阅读全文

posted @ 2011-08-26 21:17 kuangbin 阅读(1393) 评论(0) 推荐(0)

ACM POJ 2723 Get Luffy Out(2-SAT入门)
摘要:题目链接:http://poj.org/problem?id=2723【题目大意】有2n把钥匙,分成2组,给你每组的钥匙信息,并且每组的钥匙只能用一个。有m个门,每个门有2个锁,只要打开一个锁这个门就开了。(顺序遇见m个门)问你最多能够打开多少个门。【解题思路】因为只能门只能按照顺序打开,所以很自然二分是个很好的选择。建图的依据:1、每对钥匙a,b有(a->!b),(b->!a) 也就是 a and b = 0 a被用b不被用,或b被用a不被用,或a,b都不被用2、每善门对应锁的钥匙a,b有(!a->b),(!b->a) 也就是 a or b = 1,用a能打开用b不能 阅读全文

posted @ 2011-08-24 15:08 kuangbin 阅读(742) 评论(0) 推荐(0)

POJ 3207 Ikki's Story IV - Panda's Trick(2-SAT入门)
摘要:讲解见:http://hi.baidu.com/chinaeli/blog/item/dd00463cdb40eecf9f3d62c7.htmlhttp://blog.163.com/lfw2565295@126/blog/static/12200516201102012251212/代码:#include<stdio.h>#include<math.h>#include<iostream>using namespace std;const int MAXN=1005;const int MAXM=1000005;struct Node{ int l,r;} 阅读全文

posted @ 2011-08-23 02:04 kuangbin 阅读(340) 评论(0) 推荐(0)

ACM POJ 3648 Wedding(2-SAT入门)
摘要:题目链接:http://poj.org/problem?id=3648本文作者:kuangbin(转载请注明出处,博客:www.cnblogs.com/kuangbin)【题目大意】很多对夫妇参加一对新人的婚礼。分别做在长桌子的两侧。新郎、新娘分别坐两侧,新娘只能看到她对面的人。新娘不想看到她对面有夫妇。而且有一些人是有通奸关系的(男的和男的有,女的和男的、女的和女的都可能有,而且新郎也可能和别人有通奸关系),新娘不想看到有通奸关系一对人。也就是有通奸关系的不能一起坐在新娘对面。输入是:_n对夫妇(包括新郎新娘在女的,编号为0-(n-1),新郎、新娘那一对的编号为0),_m对通奸关系。接下来_ 阅读全文

posted @ 2011-08-22 16:23 kuangbin 阅读(2254) 评论(0) 推荐(0)

ACM POJ 3321 Apple Tree(树状数组)
摘要:Apple TreeTime Limit: 2000MSMemory Limit: 65536KTotal Submissions: 11282Accepted: 3214DescriptionThere is an apple tree outside of kaka's house. Every autumn, a lot of apples will grow in the tree. Kaka likes apple very much, so he has been carefully nurturing the big apple tree.The tree has N f 阅读全文

posted @ 2011-08-16 22:31 kuangbin 阅读(2479) 评论(3) 推荐(1)

ACM POJ1151 (HDU 1542) Atlantis(矩形面积并,线段树+离散化+扫描线)
摘要:AtlantisTime Limit: 1000MSMemory Limit: 10000KTotal Submissions: 9693Accepted: 3791DescriptionThere are several ancient Greek texts that contain descriptions of the fabled island Atlantis. Some of these texts even include maps of parts of the island. But unfortunately, these maps describe different 阅读全文

posted @ 2011-08-16 13:57 kuangbin 阅读(4931) 评论(0) 推荐(1)

ACM POJ 2528 Mayor's posters(线段树+离散化)
摘要:题目链接:http://poj.org/problem?id=2528类型:线段树+离散化。本文作者:kuangbin.转载请注明writed by kuangbin (博客www.cnblogs.com/kuangbin)这到题目纠结了我一天,主要是离散化,刚接触线段树不是很熟练。现在对离散化也有... 阅读全文

posted @ 2011-08-15 22:43 kuangbin 阅读(6033) 评论(4) 推荐(3)

ACM POJ 3468 A Simple Problem with Integers(线段树) by kuangbin
摘要:题目链接:http://poj.org/problem?id=3468本文作者:kuangbin 博客地址:http://www.cnblogs.com/kuangbin/题目:A Simple Problem with IntegersTime Limit: 5000MSMemory Limit:... 阅读全文

posted @ 2011-08-14 20:36 kuangbin 阅读(6142) 评论(0) 推荐(0)

ACM POJ 3264 Balanced Lineup(线段树)
摘要:题目链接:http://poj.org/problem?id=3264作者:kuangbin(转载请注明出处,谢谢!!)更多详细文章,请访问博客:www.cnblogs.com/kuangbinACM POJ 3264 Balanced Lineup这到题目是线段树的练习题目。很简单,练练手!!AC程序:/*POJ 3264 Balanced Lineup题目意思:给定Q(1<=Q<=200000)个数A1,A2,```,AQ,多次求任一区间Ai-Aj中最大数和最小数的差 */#include<stdio.h>#include<algorithm>#incl 阅读全文

posted @ 2011-08-14 13:29 kuangbin 阅读(3258) 评论(0) 推荐(0)

POJ 1220 NUMBER BASE CONVERSION(高精度进制转换)
摘要:NUMBER BASE CONVERSIONTime Limit: 1000MSMemory Limit: 10000KTotal Submissions: 3231Accepted: 1394DescriptionWrite a program to convert numbers in one base to numbers in a second base. There are 62 different digits: { 0-9,A-Z,a-z } HINT: If you make a sequence of base conversions using the output of 阅读全文

posted @ 2011-08-09 16:28 kuangbin 阅读(745) 评论(0) 推荐(0)

上一页 1 ··· 6 7 8 9 10 11 下一页

导航

JAVASCRIPT: