![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
POJ(北京大学测评)
文章平均质量分 83
csyzcyj
这个作者很懒,什么都没留下…
展开
-
POJ 1195 Mobile phones( IOI 2001) 二维树状数组 CDQ分治 代码
Mobile phonesTime Limit:5000MS Memory Limit:65536K Total Submissions:24928 Accepted:11377 DescriptionSuppose that the fourth generation mobile phone base stations in the Tampere area operate as follows. The area is divided into ...原创 2020-07-12 15:42:24 · 417 阅读 · 0 评论 -
POJ 3281 Dining 题解
【题意】: 有F种食物和D种饮料,每种食物或饮料只能供一头牛享用,且每头牛只享用一种食物和一种饮料。现在有n头牛,每头牛都有自己喜欢的食物种类列表和饮料种类列表,问最多能使几头牛同时享用到自己喜欢的食物和饮料。【分析】: 这是一道匹配问题,我们可以用网络流建模来解决。 先考虑建立食物—牛—饮料的图,即: 1):源点S向每种食物连容量为1的有向边 2):每种食物向对原创 2016-01-20 16:53:13 · 666 阅读 · 0 评论 -
POJ 2975 Nim题解
【题意】:给定一种Nim状态(相当于含N堆石头),求能有几种方法能通过调整某一堆石头的状态(只准取出),使新的Nim状态为必败态。(或者说求出所给的Nim游戏状态有多少种方法能够赢)【分析】:Nim游戏是什么,参见百度百科:百度百科_Nim在证明Nim游戏的SG函数的“根据这个判断被判为N-position的局面一定可以移动到某个P-position”命题时,有这么一段证明:对于某原创 2016-01-18 15:34:42 · 1840 阅读 · 0 评论 -
POJ 1704 Georgia and Bob题解
【题目大意】: 一个很长的格子列上有N 个棋子,开始位置一定,两人轮流操作(Georgia先手),每次移动一枚棋子,要求只能向左移且至少移动一格,而且不能越过任何棋子,最后谁无法移动棋子谁就输。【分析】: 我们考虑从后往前将棋子两两配对(若N为奇数则想象有一个棋子放在第0号位置,将第一个棋子与其配对即可)。这样我们考虑:游戏的最终目的是将任意两棋间间距变为0。若先手移动了某原创 2016-01-18 18:02:33 · 493 阅读 · 0 评论 -
POJ 3667 Hotel题解
【题目大意】: 某酒店有N(1≤N≤50000)间客房,并且所有的客房都是连续排列在同一边。有两种行为操作:需要check in,要求房间的编号为连续的r..r+Di-1并且r是最小的;需要check out,并且他们每次check out都是编号为Xi ..Xi+Di-1 (1 ≤Xi≤N-Di+1)的房间。题目的输入如下: 1: a :check in a间原创 2016-01-18 13:48:15 · 557 阅读 · 0 评论 -
POJ 3422 Kaka's Matrix Travels 最小费用流
Kaka's Matrix TravelsTime Limit: 1000MSMemory Limit: 65536KTotal Submissions: 7097Accepted: 2830DescriptionOn an N × N chessboard with a non-negative number in ea原创 2013-12-17 16:06:58 · 714 阅读 · 0 评论 -
POJ 3090 Visible Lattice Points
Visible Lattice PointsTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 5012 Accepted: 2910DescriptionA lattice point (x, y) in the first quadrant (x and原创 2013-12-15 11:41:49 · 620 阅读 · 0 评论 -
POJ 3264 Balanced Lineup 线段树求区间最大最小(普通线段树,ZKW线段树)
Balanced LineupTime Limit: 5000MS Memory Limit: 65536KTotal Submissions: 30604 Accepted: 14431Case Time Limit: 2000MSDescriptionFor the daily milking, Farme原创 2013-12-15 11:36:09 · 916 阅读 · 0 评论 -
POJ 3321 Apple Tree
Apple TreeTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 16817 Accepted: 5090DescriptionThere is an apple tree outside of kaka's house. Every autumn, a原创 2013-12-15 11:23:30 · 902 阅读 · 0 评论 -
POJ 2135 Farm Tour 最小费用流
Farm TourTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 10053 Accepted: 3711DescriptionWhen FJ's friends visit him on the farm, he likes to show them aro原创 2013-12-15 11:51:03 · 659 阅读 · 0 评论 -
POJ 1422 Air Raid
Air RaidTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 6223 Accepted: 3724DescriptionConsider a town where all the streets are one-way and each street le原创 2013-12-15 11:38:32 · 589 阅读 · 0 评论 -
POJ 2299 Ultra-QuickSort 求逆序对数(归并排序,树状数组)
Ultra-QuickSortTime Limit: 7000MS Memory Limit: 65536KTotal Submissions: 36281 Accepted: 13078DescriptionIn this problem, you have to analyze a particular sorting a原创 2013-12-15 11:32:54 · 1439 阅读 · 0 评论 -
POJ 3225 Roadblocks 求次短路
RoadblocksTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 6090 Accepted: 2290DescriptionBessie has moved to a small farm and sometimes enjoys returning原创 2013-12-15 11:48:25 · 721 阅读 · 0 评论 -
POJ 2449 Remmarguts' Date 求K短路
Remmarguts' DateTime Limit: 4000MS Memory Limit: 65536KTotal Submissions: 19030 Accepted: 5199Description"Good man never makes girls wait or breaks an appointment!"原创 2013-12-15 11:44:27 · 757 阅读 · 0 评论 -
POJ 3185 The Water Bowls
The Water BowlsTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 3979 Accepted: 1564DescriptionThe cows have a line of 20 water bowls from which they drink.原创 2013-12-15 11:25:44 · 908 阅读 · 0 评论 -
POJ 1936 All in All
直接上代码吧 #include#include#include#include#includeusing namespace std;#define MAX 100001char s1[MAX],s2[MAX];int main(){ while(scanf("%s %s",s1,s2)!=EOF) { int原创 2013-09-26 21:24:32 · 980 阅读 · 0 评论 -
POJ 1364 King 题解与分析
KingTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 9040 Accepted: 3395Description对题目中给定的si,ni,ki,和一个给定的序列S[1....N],如果格式为(si,ni,gt,ki),意思就是新增一约束条件S[si]+S[原创 2013-09-03 21:41:23 · 658 阅读 · 0 评论 -
POJ 2773 Happy 2006 题解与分析
Happy 2006Time Limit: 3000MSMemory Limit: 65536KTotal Submissions: 8447Accepted: 2777Description两个正整数如果称为互质,那么应满足这两数的最大公约数(GCD)为1。例如,1,3,5,7,9……都与2006互质。你现在的工作很原创 2013-08-17 19:58:48 · 1012 阅读 · 0 评论 -
POJ 1273 Drainage Ditches 题解与分析<网络流DINIC>
Drainage Ditches 草地排水Time Limit: 1000MS Memory Limit: 10000KTotal Submissions: 49294 Accepted: 18658 描述在农夫约翰的农场上,每逢下雨,Bessie最喜欢的三叶草地就积聚了一潭水。这意味着草地被水淹没了,并且小草要继原创 2013-08-14 11:30:11 · 721 阅读 · 0 评论