永夜初晗凝碧天

本博客现已全部转移到新地址,欲获取更多精彩文章,请访问http://acshiryu.github.io/

导航

2011年7月29日 #

POJ 1258 Agri-Net 解题报告

摘要: 分类:图论,生成树,Prim作者:ACShiryu时间:2011-7-29原题:http://poj.org/problem?id=1258Agri-NetTime Limit:1000MSMemory Limit:10000KTotal Submissions:22796Accepted:8967DescriptionFarmer John has been elected mayor of his town! One of his campaign promises was to bring internet connectivity to all farms in the area. H 阅读全文

posted @ 2011-07-29 11:07 ACShiryu 阅读(1207) 评论(0) 推荐(1) 编辑

POJ 1789 Truck History 解题报告

摘要: 分类:图论,生成树,Prim作者:ACShiryu时间:2011-7-29原题:http://poj.org/problem?id=1789Truck HistoryTime Limit:2000MSMemory Limit:65536KTotal Submissions:9712Accepted:3579DescriptionAdvanced Cargo Movement, Ltd. uses trucks of different types. Some trucks are used for vegetable delivery, other for furniture, or for 阅读全文

posted @ 2011-07-29 10:55 ACShiryu 阅读(1481) 评论(0) 推荐(0) 编辑

2011年7月28日 #

POJ 2253 Frogger 解题报告

摘要: 分类:图论,最短路,生成树作者:ACShiryu时间:2011-7-28原题:http://poj.org/problem?id=2253FroggerTime Limit:1000MSMemory Limit:65536KTotal Submissions:13595Accepted:4521DescriptionFreddy Frog is sitting on a stone in the middle of a lake. Suddenly he notices Fiona Frog who is sitting on another stone. He plans to visit 阅读全文

posted @ 2011-07-28 22:31 ACShiryu 阅读(3777) 评论(0) 推荐(0) 编辑

POJ 1797 Heavy Transportation 解题报告

摘要: 分类:图论,生成树,最短路,并查集作者:ACShiryu时间:2011-7-28地址:ACShiryu's BlogHeavy TransportationTime Limit:3000MSMemory Limit:30000KTotal Submissions:11929Accepted:3171DescriptionBackgroundHugo Heavy is happy. After the breakdown of the Cargolifter project he can now expand business. But he needs a clever man who 阅读全文

posted @ 2011-07-28 17:52 ACShiryu 阅读(3382) 评论(1) 推荐(1) 编辑

POJ 1125 Stockbroker Grapevine 解题报告

摘要: 分类:图论,最短路,Floyd算法作者:ACShiryu时间:2011-7-28地址:ACShiryu's BlogStockbroker GrapevineTime Limit:1000MSMemory Limit:10000KTotal Submissions:17227Accepted:9306DescriptionStockbrokers are known to overreact to rumours. You have been contracted to develop a method of spreading disinformation amongst the s 阅读全文

posted @ 2011-07-28 12:20 ACShiryu 阅读(2284) 评论(0) 推荐(0) 编辑

2011年7月24日 #

POJ1426 Find The Multiple 解题报告

摘要: 分类:DFS,数学作者:ACShiryu时间:2011-7-24地址:ACShiryu's BlogFind The MultipleTime Limit:1000MSMemory Limit:10000KTotal Submissions:9346Accepted:3854Special JudgeDescriptionGiven a positive integer n, write a program to find out a nonzero multiple m of n whose decimal representation contains only the digit 阅读全文

posted @ 2011-07-24 14:07 ACShiryu 阅读(4732) 评论(2) 推荐(0) 编辑

POJ1321 棋盘问题 解题报告

摘要: 分类:DFS,迷宫,棋盘作者:ACShiryu时间:2011-7-24地址:ACShiryu's Blog棋盘问题Time Limit:1000MSMemory Limit:10000KTotal Submissions:11884Accepted:5833Description在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求解对于给定形状和大小的棋盘,摆放k个棋子的所有可行的摆放方案C。Input输入含有多组测试数据。每组数据的第一行是两个正整数,n k,用一个空格隔开,表示了将在一个n*n的矩阵 阅读全文

posted @ 2011-07-24 11:34 ACShiryu 阅读(3421) 评论(0) 推荐(0) 编辑

2011年7月23日 #

POJ2251 Dungeon Master 解题报告

摘要: 分类:BFS,迷宫,STL,队列作者:ACShiryu时间:2011-7-23地址:http://www.cnblogs.com/ACShiryu/archive/2011/07/23/2114994.htmlDungeon MasterTime Limit:1000MSMemory Limit:65536KTotal Submissions:9395Accepted:3652DescriptionYou are trapped in a 3D dungeon and need to find the quickest way out! The dungeon is composed of u 阅读全文

posted @ 2011-07-23 17:52 ACShiryu 阅读(2927) 评论(2) 推荐(1) 编辑

POJ3278 Catch That Cow 解题报告

摘要: 分类:DFS,STL,作者:ACShiryu时间:2011-7-23地址:http://www.cnblogs.com/ACShiryu/archive/2011/07/23/2114978.htmlCatch That CowTime Limit:2000MSMemory Limit:65536KTotal Submissions:24419Accepted:7511DescriptionFarmer John has been informed of the location of a fugitive cow and wants to catch her immediately. He 阅读全文

posted @ 2011-07-23 17:22 ACShiryu 阅读(1523) 评论(0) 推荐(0) 编辑

POJ3009Curling 2.0解题报告

摘要: 分类:DFS,迷宫作者:ACShiryu时间:2011-7-23地址:http://www.cnblogs.com/ACShiryu/archive/2011/07/23/2114718.htmlCurling 2.0Time Limit:1000MSMemory Limit:65536KTotal Submissions:5417Accepted:2230DescriptionOn Planet MM-21, after their Olympic games this year, curling is getting popular. But the rules are somewhat 阅读全文

posted @ 2011-07-23 11:52 ACShiryu 阅读(1579) 评论(0) 推荐(0) 编辑

2011年7月21日 #

POJ2488 A Knight's Journey 解题报告

摘要: A Knight's JourneyTime Limit:1000MSMemory Limit:65536KTotal Submissions:15815Accepted:5295DescriptionBackgroundThe 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 two squares in o 阅读全文

posted @ 2011-07-21 15:37 ACShiryu 阅读(1729) 评论(8) 推荐(0) 编辑

2011年7月20日 #

标准模板库(STL)学习指南之set集合

摘要: set是关联容器。其键值就是实值,实值就是键值,不可以有重复,所以我们不能通过set的迭代器来改变set的元素的值,set拥有和list相同的特性:当对他进行插入和删除操作的时候,操作之前的迭代器依然有效。当然删除了的那个就没效了。set的底层结构是RB-tree,所以是有序的。 stl中特别提供了一种针对set的操作的算法:交集set_intersection,并集set_union,差集set_difference。对称差集set_symeetric_difference,这些算法稍后会讲到。一:set模板类的声明。template < class key class =Traits 阅读全文

posted @ 2011-07-20 10:28 ACShiryu 阅读(2225) 评论(0) 推荐(1) 编辑

标准模板库(STL)学习指南之vector向量

摘要: vector– 一. vector可以模拟动态数组– 二. vector的元素可以是任意类型T,但必须具备赋值和拷贝能力(具有public 拷贝构造函数和重载的赋值操作符) 三.必须包含的头文件#include <vector>– 四. vector支持随机存取– 五. vector的大小(size)和容量(capacity)通常是不同的,size返回实际元素个数, capacity返回vector能容纳的元素最大数量。如果插入元素时,元素个数超过capacity, 需要重新配置内部存储器。 ->构造、拷贝和析构->非变动操作eg. vector<int> 阅读全文

posted @ 2011-07-20 09:45 ACShiryu 阅读(528) 评论(0) 推荐(0) 编辑

标准模板库(STL)学习指南之sort排序

摘要: 对于程序员来说,数据结构是必修的一门课。从查找到排序,从链表到二叉树,几乎所有的算法和原理都需要理解,理解不了也要死记硬背下来。幸运的是这些理论都已经比较成熟,算法也基本固定下来,不需要你再去花费心思去考虑其算法原理,也不用再去验证其准确性。不过,等你开始应用计算机语言来工作的时候,你会发现,面对不同的需求你需要一次又一次去用代码重复实现这些已经成熟的算法,而且会一次又一次陷入一些由于自己疏忽而产生的bug中。这时,你想找一种工具,已经帮你实现这些功能,你想怎么用就怎么用,同时不影响性能。你需要的就是STL, 标准模板库!西方有句谚语:不要重复发明轮子!STL几乎封装了所有的数据结构中的算法, 阅读全文

posted @ 2011-07-20 09:40 ACShiryu 阅读(1375) 评论(3) 推荐(1) 编辑

2011年7月18日 #

HDOJ 1896 Stones 解题报告

摘要: 题目分类:优先队列+STL作者:ACShiryu做题时间:2011-7-18StonesTime Limit: 5000/3000 MS (Java/Others)Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 217Accepted Submission(s): 107Problem DescriptionBecause of the wrong status of the bicycle, Sempr begin to walk east to west every morning and walk back ev 阅读全文

posted @ 2011-07-18 21:06 ACShiryu 阅读(923) 评论(0) 推荐(0) 编辑

标准模板库(STL)学习指南之priority_queue优先队列

摘要: 转载自CSDN博客:http://blog.csdn.net/suwei19870312/article/details/5294016priority_queue 调用 STL里面的 make_heap(), pop_heap(), push_heap() 算法实现,也算是堆的另外一种形式。先写一个用 STL 里面堆算法实现的与真正的STL里面的 priority_queue 用法相似的 priority_queue, 以加深对 priority_queue 的理解view plain#include<iostream>#include<algorithm>#incl 阅读全文

posted @ 2011-07-18 19:54 ACShiryu 阅读(428) 评论(0) 推荐(0) 编辑

POJ测试数据

摘要: 转载自CSDN博客:http://blog.csdn.net/kingwolfofsky/article/details/61833191、USACO2006年November题目和测试数据的网址http://ace.delos.com/NOV062007年open赛题目和测试数据的网址http://ace.delos.com/OPEN07以此类推 2、日本ACM比赛http://www.acm-japan.org/http://icpc2010.honiden.nii.ac.jp/en/past-contests 3、官方网站02年网址http://icpc.baylor.edu/past/ 阅读全文

posted @ 2011-07-18 17:46 ACShiryu 阅读(3705) 评论(0) 推荐(1) 编辑

标准模板库(STL)学习指南之map映射

摘要: 转载自CSDN博客:http://blog.csdn.net/bat603/article/details/1456141Map是STL的一个关联容器,它提供一对一(其中第一个可以称为关键字,每个关键字只能在map中出现一次,第二个可能称为该关键字的值)的数据处理能力,由于这个特性,它完成有可能在我们处理一对一数据的时候,在编程上提供快速通道。这里说下map内部数据的组织,map内部自建一颗红黑树(一种非严格意义上的平衡二叉树),这颗树具有对数据自动排序的功能,所以在map内部所有的数据都是有序的,后边我们会见识到有序的好处。下面举例说明什么是一对一的数据映射。比如一个班级中,每个学生的学号跟 阅读全文

posted @ 2011-07-18 17:34 ACShiryu 阅读(744) 评论(0) 推荐(0) 编辑

USACO 2.3.5 Controlling Companies 解题报告

摘要: 分类:图论作者:ACShiryu时间:2011-7-18Controlling CompaniesSome companies are partial owners ofother companies because they have acquired part of their total shares of stock.For example, Ford owns 12% of Mazda. It is said that a company A controlscompany B if at least one of the following conditions is satisf 阅读全文

posted @ 2011-07-18 11:44 ACShiryu 阅读(878) 评论(2) 推荐(1) 编辑

USACO 2.3.4 Money Systems 解题报告

摘要: Money SystemsThe cows have not only created their own government but they have chosen to create their own money system. In their own rebellious way, they are curious about values of coinage. Traditionally, coins come in values like 1, 5, 10, 20 or 25, 50, and 100 units, sometimes with a 2 unit coin 阅读全文

posted @ 2011-07-18 11:33 ACShiryu 阅读(571) 评论(0) 推荐(0) 编辑