- 博客(14)
- 资源 (2)
- 收藏
- 关注
原创 [POJ 3368]Frequent values(RMQ)
DescriptionYou are given a sequence of n integers a1 , a2 , ... , an in non-decreasing order. In addition to that, you are given several queries consisting of indices i and j (1 ≤ i ≤ j ≤ n).
2014-08-26 16:45:08 637
原创 [POJ 3264]Balanced Lineup(ST算法求RMQ)
DescriptionFor the daily milking, Farmer John's N cows (1 ≤ N ≤ 50,000) always line up in the same order. One day Farmer John decides to organize a game of Ultimate Frisbee with some of the cows.
2014-08-25 21:09:51 627
原创 [POJ 1330]Nearest Common Ancestors(LCA最近公共祖先)
DescriptionA rooted tree is a well-known data structure in computer science and engineering. An example is shown below: In the figure, each node is labeled with an integer from {1, 2,...,16}
2014-08-25 18:48:46 640
原创 [POJ 1308]Is It A Tree?(并查集判断图是否为一棵有根树)
DescriptionA tree is a well-known data structure that is either empty (null, void, nothing) or is a set of one or more nodes connected by directed edges between nodes satisfying the following proper
2014-08-23 17:12:55 1080
原创 [POJ 1011]Sticks(DFS剪枝)
DescriptionGeorge took sticks of the same length and cut them randomly until all parts became at most 50 units long. Now he wants to return sticks to the original state, but he forgot how many stick
2014-08-21 16:42:43 740
原创 [POJ 2773]Happy 2006(容斥原理+二分查找)
DescriptionTwo positive integers are said to be relatively prime to each other if the Great Common Divisor (GCD) is 1. For instance, 1, 3, 5, 7, 9...are all relatively prime to 2006.Now your j
2014-08-20 22:33:20 675
原创 [POJ 2407]Relatives(欧拉函数)
DescriptionGiven n, a positive integer, how many positive integers less than n are relatively prime to n? Two integers a and b are relatively prime if there are no integers x > 1, y > 0, z > 0 such
2014-08-20 22:26:26 678
原创 [POJ 2356]Find a multiple(抽屉原理)
DescriptionThe input contains N natural (i.e. positive integer) numbers ( N <= 10000 ). Each of that numbers is not greater than 15000. This numbers are not necessarily different (so it may happen t
2014-08-20 15:58:08 740
原创 [POJ 1222]EXTENDED LIGHTS OUT(高斯消元)
#include #include #include #include #define MAXN 100using namespace std;int A[MAXN][MAXN],n=30,m=30; //n=矩阵行数,m=矩阵列数int pos[5][6]={{0,1,2,3,4,5},{6,7,8,9,10,11},{12,13,14,15,16,17},{18,1
2014-08-20 11:20:44 502
原创 [POJ 1067]取石子游戏(威佐夫博弈)
#include #include using namespace std;double p=(1+sqrt((double)5))/double(2); //黄金分割数int main(){ int a,b; //初始局面为 while(cin>>a>>b) { int c=abs(a-b); a=a>b?b:a; //a=
2014-08-18 15:31:45 560
原创 [POJ 2728]Desert King
#include #include #include #include #define MAXE 1010#define INF 1000000000using namespace std;struct Point{ double x,y,h;}point[MAXE];double map[MAXE][MAXE];double LinearDis(doubl
2014-08-16 22:47:00 598
原创 [POJ 2762]Going from u to v or from v to u? (强连通分量+拓扑排序)
DescriptionIn order to make their sons brave, Jiajia and Wind take them to a big cave. The cave has n rooms, and one-way corridors connecting some rooms. Each time, Wind choose two rooms x and y, an
2014-08-14 20:58:09 817
原创 [POJ 1236][IOI 1996]Network of Schools
DescriptionA 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
2014-08-12 18:28:47 1231
原创 [POJ 4001-4010][2011 Asia Fuzhou Regional Contest]2011 ACM 福州赛区现场赛题解(不断更新)
A:Xiangqi(http://poj.org/problem?id=4001)
2014-08-02 17:25:05 905
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人