07 2013 档案

HDU 2255 奔小康赚大钱 (KM算法 模板题)
摘要:奔小康赚大钱Time Limit: 1000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2129Accepted Submission(s): 923Problem Description传说在遥远的地方有一个非常富裕的村落,有一天,村长决定进行制度改革:重新分配房子。这可是一件大事,关系到人民的住房问题啊。村里共有n间房间,刚好有n家老百姓,考虑到每家都要有房住(如果有老百姓没房子住的话,容易引起不安定因素),每家必须分配到一间房子且只能得到一间房子。另一方面,村长和另 阅读全文

posted @ 2013-07-31 21:11 kuangbin 阅读(2347) 评论(0) 推荐(0)

【转】一些图论、网络流入门题总结、汇总
摘要:最短路问题此类问题类型不多,变形较少POJ 2449 Remmarguts' Date(中等)http://acm.pku.edu.cn/JudgeOnline/problem?id=2449题意:经典问题:K短路解法:dijkstra+A*(rec),方法很多相关:http://acm.pku.edu.cn/JudgeOnline/showcontest?contest_id=1144该题亦放在搜索推荐题中POJ 3013 - Big Christmas Tree(基础)http://acm.pku.edu.cn/JudgeOnline/problem?id=3013题意:最简单最短 阅读全文

posted @ 2013-07-31 17:59 kuangbin 阅读(15679) 评论(3) 推荐(10)

HDU 2859 Phalanx (DP)
摘要:PhalanxTime Limit: 10000/5000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 363Accepted Submission(s): 170Problem DescriptionToday is army day, but the servicemen are busy with the phalanx for the celebration of the 60th anniversary of the PRC.A phalanx is a matrix of 阅读全文

posted @ 2013-07-31 17:02 kuangbin 阅读(2082) 评论(0) 推荐(1)

HDU 2888 Check Corners(二维RMQ)
摘要:Check CornersTime Limit: 2000/10000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1362Accepted Submission(s): 503Problem DescriptionPaul draw a big m*n matrix A last month, whose entries Ai,j are all integer numbers ( 1 #include #include #include using namespace std;i 阅读全文

posted @ 2013-07-31 14:25 kuangbin 阅读(700) 评论(0) 推荐(0)

POJ 2019 Cornfields (二维RMQ)
摘要:CornfieldsTime Limit:1000MSMemory Limit:30000KTotal Submissions:4911Accepted:2392DescriptionFJ has decided to grow his own corn hybrid in order to help the cows make the best possible milk. To that end, he's looking to build the cornfield on the flattest piece of land he can find.FJ has, at grea 阅读全文

posted @ 2013-07-31 11:41 kuangbin 阅读(2354) 评论(0) 推荐(0)

POJ 3368 Frequent values (RMQ)
摘要:Frequent valuesTime Limit:2000MSMemory Limit:65536KTotal Submissions:11540Accepted:4206DescriptionYou are given a sequence ofnintegersa1, a2, ... , anin non-decreasing order. In addition to that, you are given several queries consisting of indicesiandj(1 ≤ i ≤ j ≤ n). For each query, determine the m 阅读全文

posted @ 2013-07-31 00:38 kuangbin 阅读(668) 评论(0) 推荐(0)

HDU 4630 No Pain No Game(2013多校3 1010题 离线处理+树状数组求最值)
摘要:No Pain No GameTime Limit: 4000/2000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 17Accepted Submission(s): 5Problem DescriptionLife is a game,and you lose it,so you suicide.But you can not kill yourself before you solve this problem:Given you a sequence of number a1 阅读全文

posted @ 2013-07-30 17:27 kuangbin 阅读(1484) 评论(0) 推荐(0)

HDU 4631 Sad Love Story (2013多校3 1011题 平面最近点对+爆搞)
摘要:Sad Love StoryTime Limit: 40000/20000 MS (Java/Others)Memory Limit: 131072/65536 K (Java/Others)Total Submission(s): 16Accepted Submission(s): 2Problem DescriptionThere's a really sad story.It could be about love or about money.But love will vanish and money will be corroded.These points will la 阅读全文

posted @ 2013-07-30 17:16 kuangbin 阅读(905) 评论(3) 推荐(2)

HDU 4417 Super Mario(划分树)
摘要:Super MarioTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1437Accepted Submission(s): 690Problem DescriptionMario is world-famous plumber. His “burly” figure and amazing jumping ability reminded in our memory. Now the poor princess is in trouble a 阅读全文

posted @ 2013-07-30 09:52 kuangbin 阅读(1006) 评论(0) 推荐(0)

HDU 3473 Minimum Sum(划分树)
摘要:Minimum SumTime Limit: 16000/8000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 2235Accepted Submission(s): 512Problem DescriptionYou are given N positive integers, denoted as x0, x1 ... xN-1. Then give you some intervals [l, r]. For each interval, you need to find a 阅读全文

posted @ 2013-07-30 09:51 kuangbin 阅读(865) 评论(0) 推荐(0)

HDU 2389 Rain on your Parade(二分匹配,Hopcroft-Carp算法)
摘要:Rain on your ParadeTime Limit: 6000/3000 MS (Java/Others)Memory Limit: 655350/165535 K (Java/Others)Total Submission(s): 2154Accepted Submission(s): 662Problem DescriptionYou’re giving a party in the garden of your villa by the sea. The party is a huge success, and everyone is here. It’s a warm, sun 阅读全文

posted @ 2013-07-29 22:49 kuangbin 阅读(1431) 评论(0) 推荐(0)

HDU 3360 National Treasures(二分匹配,最小点覆盖)
摘要:National TreasuresTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 871Accepted Submission(s): 291Problem DescriptionThe great hall of the national museum has been robbed few times recently. Everyone is now worried about the security of the treasures 阅读全文

posted @ 2013-07-29 09:57 kuangbin 阅读(672) 评论(0) 推荐(0)

POJ 3608 Bridge Across Islands(旋转卡壳,两凸包最短距离)
摘要:Bridge Across IslandsTime Limit:1000MSMemory Limit:65536KTotal Submissions:7202Accepted:2113Special JudgeDescriptionThousands of thousands years ago there was a small kingdom located in the middle of the Pacific Ocean. The territory of the kingdom consists two separated islands. Due to the impact of 阅读全文

posted @ 2013-07-28 22:05 kuangbin 阅读(1266) 评论(0) 推荐(0)

POJ 2079 Triangle(凸包+旋转卡壳,求最大三角形面积)
摘要:TriangleTime Limit:3000MSMemory Limit:30000KTotal Submissions:7625Accepted:2234DescriptionGiven n distinct points on a plane, your task is to find the triangle that have the maximum area, whose vertices are from the given points.InputThe input consists of several test cases. The first line of each t 阅读全文

posted @ 2013-07-28 18:51 kuangbin 阅读(1231) 评论(0) 推荐(0)

POJ 2187 Beauty Contest (求最远点对,凸包+旋转卡壳)
摘要:Beauty ContestTime Limit:3000MSMemory Limit:65536KTotal Submissions:24283Accepted:7420DescriptionBessie, Farmer John's prize cow, has just won first place in a bovine beauty contest, earning the title 'Miss Cow World'. As a result, Bessie will make a tour of N (2 #include #include #inclu 阅读全文

posted @ 2013-07-28 17:46 kuangbin 阅读(1436) 评论(0) 推荐(0)

HDU 4305 Lightning(计算几何,判断点在线段上,生成树计数)
摘要:LightningTime Limit: 4000/2000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1099Accepted Submission(s): 363Problem DescriptionThere are N robots standing on the ground (Don't know why. Don't know how).Suddenly the sky turns into gray, and lightning storm come 阅读全文

posted @ 2013-07-27 16:28 kuangbin 阅读(1452) 评论(0) 推荐(0)

HDU 1845 Jimmy’s Assignment(二分匹配)
摘要:Jimmy’s AssignmentTime Limit: 1000/1000 MS (Java/Others)Memory Limit: 65535/65535 K (Java/Others)Total Submission(s): 464Accepted Submission(s): 224Problem DescriptionJimmy is studying Advanced Graph Algorithms at his university. His most recent assignment is to find a maximum matching in a special 阅读全文

posted @ 2013-07-27 10:52 kuangbin 阅读(886) 评论(0) 推荐(0)

HDU 1507 Uncle Tom's Inherited Land*(二分匹配,输出任意一组解)
摘要:Uncle Tom's Inherited Land*Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 1247Accepted Submission(s): 542Special JudgeProblem DescriptionYour old uncle Tom inherited a piece of land from his great-great-uncle. Originally, the property had been 阅读全文

posted @ 2013-07-27 10:09 kuangbin 阅读(1467) 评论(4) 推荐(1)

HDU 3537 Daizhenyang's Coin(博弈,翻硬币)
摘要:Daizhenyang's CoinTime Limit: 6000/3000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 183Accepted Submission(s): 83Problem DescriptionWe know that Daizhenyang is chasing a girlfriend. As we all know, whenever you chase a beautiful girl, there'll always be an o 阅读全文

posted @ 2013-07-26 21:11 kuangbin 阅读(1506) 评论(0) 推荐(0)

【转】博弈-翻硬币游戏
摘要:翻硬币游戏一般的翻硬币游戏的规则是这样的:N枚硬币排成一排,有的正面朝上,有的反面朝上。我们从左开始对硬币按1到N编号。第一,游戏者根据某些约束翻硬币,但他所翻动的硬币中,最右边那个硬币的必须是从正面翻到反面。例如,只能翻3个硬币的情况,那么第三个硬币必须是从正面翻到反面。如果局面是正正反,那就不能翻硬币了,因为第三个是反的。第二,谁不能翻谁输。有这样的结论:局面的SG值为局面中每个正面朝上的棋子单一存在时的SG值的异或和。即一个有k个硬币朝上,朝上硬币位置分布在的翻硬币游戏中,SG值是等于k个独立的开始时只有一个硬币朝上的翻硬币游戏的SG值异或和。比如THHTTH这个游戏中,2号、3号、6号 阅读全文

posted @ 2013-07-26 21:09 kuangbin 阅读(5271) 评论(1) 推荐(6)

HDU 3389 Game(博弈)
摘要:GameTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 214Accepted Submission(s): 150Problem Descript... 阅读全文

posted @ 2013-07-26 20:00 kuangbin 阅读(1706) 评论(0) 推荐(0)

HDU 3032 Nim or not Nim?(博弈,SG打表找规律)
摘要:Nim or not Nim?Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 613Accepted Submission(s): 282Problem DescriptionNim is a two-player mathematic game of strategy in which players take turns removing objects from distinct heaps. On each turn, a player 阅读全文

posted @ 2013-07-26 19:06 kuangbin 阅读(1265) 评论(0) 推荐(0)

HDU 4606 Occupy Cities (计算几何+最短路+二分+最小路径覆盖)
摘要:Occupy CitiesTime Limit: 10000/5000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 509Accepted Submission(s): 125Problem DescriptionThe Star Wars is coming to an end as the Apple Planet is beaten by the Banana Planet. Captain Chen, the glorious leader of the Army of Ba 阅读全文

posted @ 2013-07-26 17:09 kuangbin 阅读(467) 评论(0) 推荐(0)

HDU 2897 邂逅明下 (简单博弈,找规律)
摘要:邂逅明下Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1432Accepted Submission(s): 670Problem Description当日遇到月,于是有了明。当我遇到了你,便成了侣。那天,日月相会,我见到了你。而且,大地失去了光辉,你我是否成侣?这注定是个凄美的故事。(以上是废话)小t和所有世俗的人们一样,期待那百年难遇的日食。驻足街头看天,看日月渐渐走近,小t的脖子那个酸呀(他坚持这个姿势已经有半个多小时啦)。他低下仰起 阅读全文

posted @ 2013-07-26 00:13 kuangbin 阅读(487) 评论(0) 推荐(0)

HDU 4618 Palindrome Sub-Array (2013多校2 1008 暴力)
摘要:Palindrome Sub-ArrayTime Limit: 3000/1000 MS (Java/Others)Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 173Accepted Submission(s): 80Problem Description A palindrome sequence is a sequence which is as same as its reversed order. For example, 1 2 3 2 1 is a palindrome sequence, but 1. 阅读全文

posted @ 2013-07-25 23:05 kuangbin 阅读(407) 评论(0) 推荐(0)

HDU 4617 Weapon (简单三维计算几何,异面直线距离)
摘要:WeaponTime Limit: 3000/1000 MS (Java/Others)Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 22Accepted Submission(s): 18Problem Description Doctor D. are researching for a horrific weapon. The muzzle of the weapon is a circle. When it fires, rays form a cylinder that runs through the . 阅读全文

posted @ 2013-07-25 21:14 kuangbin 阅读(1171) 评论(0) 推荐(0)

HDU 4612 Warm up(2013多校2 1002 双连通分量)
摘要:Warm upTime Limit: 10000/5000 MS (Java/Others)Memory Limit: 65535/65535 K (Java/Others)Total Submission(s): 90Accepted Submission(s): 12Problem Description N planets are connected by M bidirectional channels that allow instant transportation. It's always possible to travel between any two planet 阅读全文

posted @ 2013-07-25 17:59 kuangbin 阅读(1787) 评论(0) 推荐(0)

HDU 4619 Warm up 2(2013多校2 1009 二分匹配)
摘要:Warm up 2Time Limit: 3000/1000 MS (Java/Others)Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 28Accepted Submission(s): 8Problem Description Some 1×2 dominoes are placed on a plane. Each dominoe is placed either horizontally or vertically. It's guaranteed the dominoes in the 阅读全文

posted @ 2013-07-25 17:34 kuangbin 阅读(884) 评论(0) 推荐(0)

HDU 4614 Vases and Flowers (2013多校2 1004 线段树)
摘要:Vases and FlowersTime Limit: 4000/2000 MS (Java/Others)Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 38Accepted Submission(s): 10Problem Description Alice is so popular that she can receive many flowers everyday. She has N vases numbered from 0 to N-1. When she receive some flowers,. 阅读全文

posted @ 2013-07-25 17:33 kuangbin 阅读(2104) 评论(0) 推荐(0)

HDU 4611 Balls Rearrangement(2013多校2 1001题)
摘要:Balls RearrangementTime Limit: 9000/3000 MS (Java/Others)Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 25Accepted Submission(s): 8Problem 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 pu. 阅读全文

posted @ 2013-07-25 17:29 kuangbin 阅读(1603) 评论(7) 推荐(1)

HDU 4602 Magic Ball Game(离线处理,树状数组,dfs)
摘要:Magic Ball GameTime Limit: 10000/5000 MS (Java/Others)Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 640Accepted Submission(s): 169Problem DescriptionWhen the magic ball game turns up, Kimi immediately falls in it. The interesting game is made up of N balls, each with a weight of w[i] 阅读全文

posted @ 2013-07-25 10:32 kuangbin 阅读(652) 评论(0) 推荐(0)

HDU 4610 Cards (合数分解,枚举)
摘要:CardsTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 470Accepted Submission(s): 72Problem DescriptionGiven some cards each assigned a number, you're required to select EXACTLY K cards among them.While you select a card, I will check the number 阅读全文

posted @ 2013-07-24 23:12 kuangbin 阅读(656) 评论(5) 推荐(0)

HDU 4609 3-idiots(FFT)
摘要:3-idiotsTime Limit: 10000/5000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 216Accepted Submission(s): 73Problem DescriptionKing OMeGa catched three men who had been streaking in the street. Looking as idiots though, the three men insisted that it was a kind of perfo 阅读全文

posted @ 2013-07-24 14:18 kuangbin 阅读(9934) 评论(5) 推荐(1)

HDU 1402 A * B Problem Plus (FFT求高精度乘法)
摘要:A * B Problem PlusTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 9413Accepted Submission(s): 1468Problem DescriptionCalculate A * B.InputEach line will contain two integers A and B. Process to end of file.Note: the length of each integer will not 阅读全文

posted @ 2013-07-24 12:35 kuangbin 阅读(8511) 评论(0) 推荐(0)

POJ 2888 Magic Bracelet(Burnside引理,矩阵优化)
摘要:Magic BraceletTime Limit:2000MSMemory Limit:131072KTotal Submissions:3731Accepted:1227DescriptionGinny’s birthday is coming soon. Harry Potter is preparing a birthday present for his new girlfriend. The present is a magic bracelet which consists ofnmagic beads. The aremkinds of different magic beads 阅读全文

posted @ 2013-07-22 22:17 kuangbin 阅读(1585) 评论(0) 推荐(0)

HDU 1787 GCD Again(欧拉函数,水题)
摘要:GCD AgainTime Limit: 1000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1997Accepted Submission(s): 772Problem DescriptionDo you have spent some time to think and try to solve those unsolved problem after one ACM contest?No? Oh, you must do this when you want to 阅读全文

posted @ 2013-07-22 17:10 kuangbin 阅读(833) 评论(0) 推荐(0)

HDU 3923 Invoker(polya定理+逆元)
摘要:InvokerTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 122768/62768 K (Java/Others)Total Submission(s): 907Accepted Submission(s): 364Problem DescriptionOn of Vance's favourite hero is Invoker, Kael. As many people knows Kael can control the elements and combine them to invoke a powerful ski 阅读全文

posted @ 2013-07-22 16:01 kuangbin 阅读(1288) 评论(0) 推荐(0)

HDU 2516 取石子游戏(FIB博弈)
摘要:取石子游戏Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1911Accepted Submission(s): 1094Problem Description1堆石子有n个,两人轮流取.先取者第1次可以取任意多个,但不能全部取完.以后每次取的石子数不能超过上次取子数的2倍。取完者胜.先取者负输出"Second win".先取者胜输出"First win".Input输入有多组.每组第1行是2#inclu 阅读全文

posted @ 2013-07-22 12:15 kuangbin 阅读(2244) 评论(0) 推荐(0)

HDU 2147 kiki's game (简单博弈,找规律)
摘要:kiki's gameTime Limit: 5000/1000 MS (Java/Others)Memory Limit: 40000/1000 K (Java/Others)Total Submission(s): 5094Accepted Submission(s): 2985Problem DescriptionRecently kiki has nothing to do. While she is bored, an idea appears in his mind, she just playes the checkerboard game.The size of the 阅读全文

posted @ 2013-07-22 11:58 kuangbin 阅读(653) 评论(0) 推荐(1)

HDU 1847 Good Luck in CET-4 Everybody!(找规律,或者简单SG函数)
摘要:Good Luck in CET-4 Everybody!Time Limit: 1000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3617Accepted Submission(s): 2279Problem Description大学英语四级考试就要来临了,你是不是在紧张的复习?也许紧张得连短学期的ACM都没工夫练习了,反正我知道的Kiki和Cici都是如此。当然,作为在考场浸润了十几载的当代大学生,Kiki和Cici更懂得考前的放松,所谓“张弛有道”就是这个意思。 阅读全文

posted @ 2013-07-22 11:23 kuangbin 阅读(768) 评论(0) 推荐(0)

HDU 1846 Brave Game(简单巴什博弈)
摘要:Brave GameTime Limit: 1000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4500Accepted Submission(s): 2951Problem Description十年前读大学的时候,中国每年都要从国外引进一些电影大片,其中有一部电影就叫《勇敢者的游戏》(英文名称:Zathura),一直到现在,我依然对于电影中的部分电脑特技印象深刻。今天,大家选择上机考试,就是一种勇敢(brave)的选择;这个短学期,我们讲的是博弈(game)专题;所以 阅读全文

posted @ 2013-07-22 11:03 kuangbin 阅读(842) 评论(0) 推荐(0)

HDU 1564 Play a game (找规律博弈)
摘要:Play a gameTime Limit: 1000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1030Accepted Submission(s): 838Problem DescriptionNew Year is Coming!ailyanlu is very happy today! and he is playing a chessboard game with 8600.The size of the chessboard is n*n. A stone i 阅读全文

posted @ 2013-07-22 08:55 kuangbin 阅读(2682) 评论(0) 推荐(0)

HDU 1525 Euclid's Game (博弈)
摘要:Euclid's GameTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 1256Accepted Submission(s): 576Problem DescriptionTwo players, Stan and Ollie, play, starting with two natural numbers. Stan, the first player, subtracts any positive multiple of the 阅读全文

posted @ 2013-07-22 08:25 kuangbin 阅读(3151) 评论(0) 推荐(1)

博弈小结
摘要:题集来源:风神博客 http://blog.csdn.net/shahdza/article/details/7832997博弈题集:====================================================================================================HDOJ1079&POJ1082&ZOJ1024Calendar Game[找规律博弈]PN分析下,很容易可以发现规律题解hereHDOJ1525&POJ2348Euclid's Game[找规律博弈]比较有意思的题目。需要找规律,判 阅读全文

posted @ 2013-07-22 07:48 kuangbin 阅读(1272) 评论(1) 推荐(0)

HDU 1079 Calendar Game(简单博弈)
摘要:Calendar GameTime Limit: 5000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 1871Accepted Submission(s): 1065Problem DescriptionAdam and Eve enter this year’s ACM International Collegiate Programming Contest. Last night, they played the Calendar Game, in celebrati 阅读全文

posted @ 2013-07-22 07:46 kuangbin 阅读(2073) 评论(0) 推荐(0)

[转] 数据输入加速
摘要:来自风神博客:http://blog.csdn.net/shahdza/article/details/6317011①//适用于正整数template inline void scan_d(T &ret) { char c; ret=0; while((c=getchar())'9'); while(c>='0'&&cinline bool scan_d(T &ret) { char c; int sgn; if(c=getchar(),c==EOF) return 0; //EOF while(c!='-' 阅读全文

posted @ 2013-07-18 21:54 kuangbin 阅读(618) 评论(0) 推荐(0)

POJ 1584 A Round Peg in a Ground Hole(判断凸多边形,点到线段距离,点在多边形内)
摘要:A Round Peg in a Ground HoleTime Limit:1000MSMemory Limit:10000KTotal Submissions:4438Accepted:1362DescriptionThe DIY Furniture company specializes in assemble-it-yourself furniture kits. Typically, the pieces of wood are attached to one another using a wooden peg that fits into pre-cut holes in eac 阅读全文

posted @ 2013-07-16 23:12 kuangbin 阅读(1456) 评论(0) 推荐(0)

POJ 3449 Geometric Shapes(判断几个不同图形的相交,线段相交判断)
摘要:Geometric ShapesTime Limit:2000MSMemory Limit:65536KTotal Submissions:1243Accepted:524DescriptionWhile creating a customer logo, ACM uses graphical utilities to draw a picture that can later be cut into special fluorescent materials. To ensure proper processing, the shapes in the picture cannot inte 阅读全文

posted @ 2013-07-16 21:12 kuangbin 阅读(1703) 评论(1) 推荐(0)

POJ 1039 Pipe(直线和线段相交判断,求交点)
摘要:PipeTime Limit:1000MSMemory Limit:10000KTotal Submissions:8280Accepted:2483DescriptionThe GX Light Pipeline Company started to prepare bent pipes for the new transgalactic light pipeline. During the design phase of the new pipe shape the company ran into the problem of determining how far the light 阅读全文

posted @ 2013-07-16 08:38 kuangbin 阅读(3026) 评论(1) 推荐(0)

POJ 2826 An Easy Problem?!
摘要:An Easy Problem?!Time Limit:1000MSMemory Limit:65536KTotal Submissions:7837Accepted:1145DescriptionIt's raining outside. Farmer Johnson's bull Ben wants some rain to water his flowers. Ben nails two wooden boards on the wall of his barn. Shown in the pictures below, the two boards on the wal 阅读全文

posted @ 2013-07-16 01:12 kuangbin 阅读(2819) 评论(0) 推荐(0)

POJ 3347 Kadj Squares
摘要:Kadj SquaresTime Limit:2000MSMemory Limit:65536KTotal Submissions:2132Accepted:843DescriptionIn this problem, you are given a sequenceS1,S2, ...,Snof squares of different sizes. The sides of the squares are integer numbers. We locate the squares on the positivex-yquarter of the plane, such that thei 阅读全文

posted @ 2013-07-16 00:12 kuangbin 阅读(1214) 评论(0) 推荐(0)

POJ 1696 Space Ant(极角排序)
摘要:Space AntTime Limit:1000MSMemory Limit:10000KTotal Submissions:2489Accepted:1567DescriptionThe 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 of it 阅读全文

posted @ 2013-07-15 22:18 kuangbin 阅读(2645) 评论(0) 推荐(0)

POJ 1410 Intersection(判断线段交和点在矩形内)
摘要:IntersectionTime Limit:1000MSMemory Limit:10000KTotal Submissions:9996Accepted:2632DescriptionYou are to write a program that has to decide whether a given line segment intersects a given rectangle.An example:line: start point: (4,9)end point: (11,2)rectangle: left-top: (1,5)right-bottom: (7,1)Figur 阅读全文

posted @ 2013-07-15 21:16 kuangbin 阅读(2305) 评论(0) 推荐(0)

POJ 1066 Treasure Hunt(线段相交判断)
摘要:Treasure HuntTime Limit: 1000MSMemory Limit: 10000KTotal Submissions: 4797Accepted: 1998DescriptionArcheologists from the Antiquities and Curios Museum (ACM) have flown to Egypt to examine the great pyramid of Key-Ops. Using state-of-the-art technology they are able to determine that the lower floor 阅读全文

posted @ 2013-07-14 23:55 kuangbin 阅读(1670) 评论(0) 推荐(0)

POJ 2653 Pick-up sticks(判断线段相交)
摘要:Pick-up sticksTime Limit: 3000MSMemory Limit: 65536KTotal Submissions: 7699Accepted: 2843DescriptionStan has n sticks of various length. He throws them one at a time on the floor in a random way. After finishing throwing, Stan tries to find the top sticks, that is these sticks such that there is no 阅读全文

posted @ 2013-07-14 18:38 kuangbin 阅读(3113) 评论(0) 推荐(0)

POJ 1556 The Doors(线段交+最短路)
摘要:The DoorsTime Limit: 1000MSMemory Limit: 10000KTotal Submissions: 5210Accepted: 2124DescriptionYou are to find the length of the shortest path through a chamber containing obstructing walls. The chamber will always have sides at x = 0, x = 10, y = 0, and y = 10. The initial and final points of the p 阅读全文

posted @ 2013-07-14 12:58 kuangbin 阅读(2626) 评论(0) 推荐(0)

POJ 1269 Intersecting Lines(直线相交判断,求交点)
摘要:Intersecting LinesTime Limit: 1000MSMemory Limit: 10000KTotal Submissions: 8342Accepted: 3789DescriptionWe all know that a pair of distinct points on a plane defines a line and that a pair of lines on a plane will intersect in one of three ways: 1) no intersection because they are parallel, 2) inter 阅读全文

posted @ 2013-07-14 09:49 kuangbin 阅读(2733) 评论(2) 推荐(1)

POJ 3304 Segments (直线和线段相交判断)
摘要:SegmentsTime Limit: 1000MSMemory Limit: 65536KTotal Submissions: 7739Accepted: 2316DescriptionGiven n segments 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 least one point in com 阅读全文

posted @ 2013-07-14 00:09 kuangbin 阅读(4520) 评论(4) 推荐(1)

POJ 2398 Toy Storage(计算几何,叉积判断点和线段的关系)
摘要:Toy StorageTime Limit: 1000MSMemory Limit: 65536KTotal Submissions: 3146Accepted: 1798DescriptionMom and dad have a problem: their child, Reza, never puts his toys away when he is finished playing with them. They gave Reza a rectangular box to put his toys in. Unfortunately, Reza is rebellious and o 阅读全文

posted @ 2013-07-13 20:13 kuangbin 阅读(1858) 评论(0) 推荐(0)

POJ 2318 TOYS (计算几何,叉积判断)
摘要:TOYSTime Limit: 2000MSMemory Limit: 65536KTotal Submissions: 8661Accepted: 4114DescriptionCalculate the number of toys that land in each bin of a partitioned toy box. Mom and dad have a problem - their child John never puts his toys away when he is finished playing with them. They gave John a rectan 阅读全文

posted @ 2013-07-13 20:11 kuangbin 阅读(4190) 评论(1) 推荐(0)

2013 ACM/ICPC南京邀请赛B题(求割点扩展)
摘要:题目链接:http://icpc.njust.edu.cn/Contest/194/Problem/BB - TWO NODES时间限制:10000 MS内存限制:65535 KB问题描述Suppose that G is an undirected graph, and the value of stab is defined as follows:Among the expression, G-i,-jis the remainder after removing node i, node j and all edges that are directly relevant to the 阅读全文

posted @ 2013-07-12 22:44 kuangbin 阅读(877) 评论(0) 推荐(0)

POJ 3177 Redundant Paths POJ 3352 Road Construction
摘要:这两题是一样的,代码完全一样。就是给了一个连通图,问加多少条边可以变成边双连通。去掉桥,其余的连通分支就是边双连通分支了。一个有桥的连通图要变成边双连通图的话,把双连通子图收缩为一个点,形成一颗树。需要加的边为(leaf+1)/2 (leaf为叶子结点个数)POJ 3177 给定一个连通的无向图G,至少要添加几条边,才能使其变为双连通图。参考:http://blog.csdn.net/lyy289065406/article/details/6762432http://www.cnblogs.com/kuangbin/p/3184889.html#include #include #inclu 阅读全文

posted @ 2013-07-11 19:13 kuangbin 阅读(540) 评论(0) 推荐(0)

【转】图的割点、桥与双连通分支
摘要:原文地址:https://www.byvoid.com/blog/biconnect图的割点、桥与双连通分支[点连通度与边连通度]在一个无向连通图中,如果有一个顶点集合,删除这个顶点集合,以及这个集合中所有顶点相关联的边以后,原图变成多个连通块,就称这个点集为割点集合。一个图的点连通度的定义为,最小割点集合中的顶点数。类似的,如果有一个边集合,删除这个边集合以后,原图变成多个连通块,就称这个点集为割边集合。一个图的边连通度的定义为,最小割边集合中的边数。[双连通图、割点与桥]如果一个无向连通图的点连通度大于1,则称该图是点双连通的(point biconnected),简称双连通或重连通。一个 阅读全文

posted @ 2013-07-11 19:12 kuangbin 阅读(1433) 评论(0) 推荐(0)

POJ 3694 Network (求桥,边双连通分支缩点,lca)
摘要:NetworkTime Limit:5000MSMemory Limit:65536KTotal Submissions:5619Accepted:1939DescriptionA network administrator manages a large network. The network consists of N computers and M links between pairs of computers. Any pair of computers are connected directly or indirectly by successive links, so dat 阅读全文

posted @ 2013-07-11 19:06 kuangbin 阅读(1565) 评论(0) 推荐(0)

UVA 796 - Critical Links (求桥)
摘要:Critical LinksIn a computer network a link L, which interconnects two servers, is considered critical if there are at least two servers A and B such that all network interconnection paths between A and B pass through L. Removing a critical link generates two disjoint sub-networks such that any two s 阅读全文

posted @ 2013-07-11 15:42 kuangbin 阅读(1523) 评论(0) 推荐(0)

UVA 315 315 - Network(求割点个数)
摘要:NetworkA Telephone Line Company (TLC) is establishing a new telephone cable network. They are connecting several places numbered by integers from 1 toN. No two places have the same number. The lines are bidirectional and always connect together two places and in each place the lines end in a telepho 阅读全文

posted @ 2013-07-11 15:40 kuangbin 阅读(2382) 评论(0) 推荐(0)

POJ 1236 Network of Schools (有向图的强连通分量)
摘要:Network of SchoolsTime Limit:1000MSMemory Limit:10000KTotal Submissions:9073Accepted:3594DescriptionA number of schools are connected to a computer network. Agreements have been developed among those schools: each school maintains a list of schools to which it distributes software (the “receiving sc 阅读全文

posted @ 2013-07-10 18:07 kuangbin 阅读(1826) 评论(0) 推荐(0)

【转】有向图强连通分量的Tarjan算法
摘要:原文地址:https://www.byvoid.com/blog/scc-tarjan/[有向图强连通分量]在有向图G中,如果两个顶点间至少存在一条路径,称两个顶点强连通(strongly connected)。如果有向图G的每两个顶点都强连通,称G是一个强连通图。非强连通图有向图的极大强连通子图,称为强连通分量(strongly connected components)。下图中,子图{1,2,3,4}为一个强连通分量,因为顶点1,2,3,4两两可达。{5},{6}也分别是两个强连通分量。直接根据定义,用双向遍历取交集的方法求强连通分量,时间复杂度为O(N^2+M)。更好的方法是Kosara 阅读全文

posted @ 2013-07-07 16:07 kuangbin 阅读(2738) 评论(0) 推荐(1)

HDU 3072 Intelligence System (强连通分量)
摘要:Intelligence SystemTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 982Accepted Submission(s): 440Problem DescriptionAfter a day, ALPCs finally complete their ultimate intelligence system, the purpose of it is of course for ACM ... ...Now, kzc_tc, t 阅读全文

posted @ 2013-07-06 23:34 kuangbin 阅读(757) 评论(0) 推荐(0)

【转】强大的vim配置文件,让编程更随意
摘要:原文地址:http://www.cnblogs.com/ma6174/archive/2011/12/10/2283393.html花了很长时间整理的,感觉用起来很方便,共享一下。我的vim配置主要有以下优点:1.按F5可以直接编译并执行C、C++、java代码以及执行shell脚本,按“F8”可进行C、C++代码的调试2.自动插入文件头 ,新建C、C++源文件时自动插入表头:包括文件名、作者、联系方式、建立时间等,读者可根据需求自行更改3.映射“Ctrl + A”为全选并复制快捷键,方便复制代码4.按“F2”可以直接消除代码中的空行5.“F3”可列出当前目录文件,打开树状文件目录6. 支持鼠 阅读全文

posted @ 2013-07-03 23:33 kuangbin 阅读(2504) 评论(0) 推荐(1)

导航

JAVASCRIPT: