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