![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
poj
__铭
这个作者很懒,什么都没留下…
展开
-
poj 3096 (STL map)
对STL的map的考察不懂得map的童鞋请出门左转http://blog.csdn.net/code_kk/article/details/50591943#include #include #include #include #include #include #include #include #include #include #include #include原创 2016-01-27 20:37:37 · 544 阅读 · 0 评论 -
POJ 2528 Mayor's posters (线段树+离散化)
题目链接:http://poj.org/problem?id=2528题目大意: 给出n个海报的左端,右端,按照顺序贴上海报求贴完后可以看到多少海报?方法:先将海报数据离散化,然后线段树查询#include #include #include #include using namespace std;const int maxn = 10010;struct原创 2016-02-26 21:14:04 · 467 阅读 · 0 评论 -
poj 1151 Atlantis(计算几何 扫描线)
题目链接:http://poj.org/problem?id=1151大致题意:给出n个矩形,求出n个矩形一共覆盖的面积做法:现将坐标离散化,然后用线段树维护即让线段按照x坐标的大小从小到大排列,y坐标按照从小到大排列去掉重复的值然后通过一个扫描线来求扫描线覆盖的y的长度。线段的扫描按照x的大小从小到大扫描,求出当前扫描线覆盖的矩阵竖线的长度,然后乘以下条线段的跨度原创 2016-04-05 17:10:29 · 437 阅读 · 0 评论 -
poj1061 青蛙的约会(扩展欧几里得)
题目链接:http://poj.org/problem?id=1061题目大意:中文题,不解释方法:设t为A青蛙和B青蛙的跳的次数,k为绕地球绕的圈数则得出公式:(x+m*t)- (y+n*t)= k*L化简得:(x-y)+(m-n)*t = k*L 化简:(m-n)*t - k*L = y-x(由扩展欧几里得定理可知:存在x0,y0使得a*x0+b*y0=gcd(a,b原创 2016-04-05 21:26:18 · 546 阅读 · 0 评论 -
POJ 2528 Mayor's posters(离散化+线段树)
Mayor's postersTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 55517 Accepted: 16098DescriptionThe citizens of Bytetown, AB, could not stand that the原创 2016-04-21 20:39:02 · 1159 阅读 · 0 评论 -
poj 2187 Beauty Contest(凸包)
不知道这道题在比较的时候为什么用qsort()才能过,不过找到了一组数据100 010000 01 1002 1999999 1009998 199100 -900200 -17999800 -17999900 -900答案应该是100000000DescriptionBessie, Farmer John's prize cow, has just原创 2015-08-18 19:50:45 · 383 阅读 · 0 评论 -
poj 1129 Channel Allocation(DFS减枝)
DescriptionWhen a radio station is broadcasting over a very large area, repeaters are used to retransmit the signal so that every receiver has a strong signal. However, the channels used by each rep原创 2015-08-21 14:10:52 · 428 阅读 · 0 评论 -
poj 2676(DFS减枝)
DescriptionSudoku is a very simple task. A square table with 9 rows and 9 columns is divided to 9 smaller squares 3x3 as shown on the Figure. In some of the cells are written decimal digits from 1 t原创 2015-08-21 14:07:42 · 397 阅读 · 0 评论 -
poj 1416 Shredding Company(DFS减枝)
DescriptionYou have just been put in charge of developing a new shredder for the Shredding Company Although a "normal" shredder would just shred sheets of paper into little pieces so that the conten原创 2015-08-21 14:02:58 · 345 阅读 · 0 评论 -
POJ 3368 Frequent values (RMQ)
题目链接:http://poj.org/problem?id=3368题目大意:给出一个n个数长度的串, m个询问求出给定范围内的最大连续字符串的长度方法:RMQ模板, 记录每个位置的数连续的次数,用RMQ求出每个区间的最大连续字符的长度值#include #include #include #include #include using namespace s原创 2016-02-25 21:22:29 · 618 阅读 · 0 评论 -
POJ 3264 Balanced Lineup (RMQ)
题目链接:http://poj.org/problem?id=3264题目大意:给出n个数, m个询问求每次询问范围内最大值与最小值得差方法:RMQ查询#include #include #include #include #include using namespace std;const int maxn = 50010;int A[maxn];int原创 2016-02-25 17:22:26 · 1693 阅读 · 0 评论 -
poj 2406 Power Strings(KMP)
题目链接:http://poj.org/problem?id=2406题目大意:找出字串最大循环次数方法:和上一个一样 传送门#include #include #include #include using namespace std;int next[1000010];char str[1000010];void getnext(char *s, int le原创 2016-02-21 16:03:09 · 1063 阅读 · 0 评论 -
poj 3007 Organize Your Train part II (字符串哈希)
这应该是一道考STL的题,然而用STL试过2^n遍后,只剩下伤心与落泪没办法,还是得用字符串哈希#include #include #include #include #include #include #include #include #include #include #include #include #include #define RR freop原创 2016-01-28 09:25:32 · 1418 阅读 · 0 评论 -
poj 1201Intervals (差分约束系统)
IntervalsTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 23864 Accepted: 9048DescriptionYou are given n closed, integer intervals [ai, bi] and n integ原创 2016-01-28 17:05:48 · 754 阅读 · 0 评论 -
poj 1716 Integer Intervals(差分约束系统)
Integer IntervalsTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 13437 Accepted: 5711DescriptionAn integer interval [a,b], a Write a program that: f原创 2016-01-28 17:29:53 · 665 阅读 · 0 评论 -
POJ2983 Is the Information Reliable? Candies (查分约束+SPFA)
题目大意:给出n个防御站,m个不等式,判断是否有可行解思路:这是一道关于查分约束的题,解题的关键就是找到不等关系,构成不等式组,然后用SPFA判断是否具有负环P A B X : Dis[a] = Dis[b] + X;V A B : Dis[a] = Dis[b] + 1;即:P: Dis[a] - DIs[b] Dis[b] - Dis[a] V原创 2016-02-18 17:18:21 · 550 阅读 · 0 评论 -
POJ 3159 Candies(差分约束+SPFA )
题目大意:n个小孩,m个关系A B c : 表示小孩A认为小孩B的糖果不能比自己多c个方法:这道题考察的是差分约束首先建立不等关系Dis[b] - Dis[a] 将每个关系看成是有向图的一条边,SPFA求最短路注意:SPFA+队列会超时(其实我是WA), 但是用SPFA+堆栈就莫名其妙的AC了#include #include #include #原创 2016-02-19 08:36:00 · 644 阅读 · 0 评论 -
poj 3254 Corn Fields (状态压缩dp)
Corn FieldsTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 10923 Accepted: 5723DescriptionFarmer John has purchased a lush new rectangular pasture com原创 2016-01-26 11:58:52 · 540 阅读 · 0 评论 -
poj 3122
PieTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 13653 Accepted: 4679 Special JudgeDescriptionMy birthday is coming up and traditionally I'm ser原创 2016-01-21 21:39:50 · 1116 阅读 · 0 评论 -
poj 1961 Period(KMP)
题目链接:http://poj.org/problem?id=1961题目大意:给出一个长为n的字符串,求到每一个字符之前有多少个字串循环次数大于1方法: kmp ,求出这个字符串的next数组,在字符串位数是i-next[i]的整数倍是,输出字串循环次数。#include #include #include #include using namespace std;int原创 2016-02-21 15:35:52 · 1047 阅读 · 0 评论 -
poj 2531 Network Saboteur(DFS减枝)
题意:将n个计算机分成两部分,求权值的最大值方法:先默认将所有的放入一个集合,然后将里面的元素一个一个的转移到另一个集合DescriptionA university network is composed of N computers. System administrators gathered information on the traffic between nodes,原创 2015-08-20 10:51:16 · 388 阅读 · 0 评论