上一页 1 ··· 17 18 19 20 21 22 23 24 25 ··· 29 下一页
摘要: Problem Description Bob gets tired of playing games, leaves Alice, and travels to Changsha alone. Yuelu Mountain, Orange Island, Window of the World, the Provincial Museum etc...are scenic spots Bob wants to visit. However, his time is very limited, he can’t visit them all. Assuming that there are.. 阅读全文
posted @ 2013-08-22 12:25 Oyking 阅读(382) 评论(0) 推荐(0) 编辑
摘要: Problem Description A sequence Snis defined as:Where a, b, n, m are positive integers.┌x┐is the ceil of x. For example, ┌3.14┐=4. You are to calculate Sn. You, a top coder, say: So easy!Input There are several test cases, each test case in one line contains four positive integers: a, b, n, m. Whe... 阅读全文
posted @ 2013-08-22 00:05 Oyking 阅读(419) 评论(0) 推荐(1) 编辑
摘要: Problem Description One day, a hunter named James went to a mysterious area to find the treasures. James wanted to research the area and brought all treasures that he could. The area can be represented as a N*M rectangle. Any points of the rectangle is a number means the cost of research it,-1 mea.. 阅读全文
posted @ 2013-08-21 22:48 Oyking 阅读(457) 评论(0) 推荐(0) 编辑
摘要: DescriptionAn oligarch Vovan, as many other oligarchs, transports oil from West Cuckooland to East Cuckooland. He owns a huge oil-producing station in West Cuckooland, an equally huge oil-refining station in East Cuckooland and a system of oil pipelines to move oil from one country to another. Vovan 阅读全文
posted @ 2013-08-20 16:25 Oyking 阅读(392) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionA Fibonacci sequence is calculated by adding the previous two members the sequence, with the first two members being both 1. F(1) = 1, F(2) = 1, F(3) = 1,F(4) = 1, F(n>4) = F(n - 1) + F(n-2) + F(n-3) + F(n-4) Your task is to take a number as input, and print that Fibonacci numb 阅读全文
posted @ 2013-08-20 15:14 Oyking 阅读(194) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionGiven an integer N(0 ≤ N ≤ 10000), your task is to calculate N!InputOne N in one line, process to the end of file.OutputFor each N, output N! in one line.题目大意:求N的阶乘。思路:用高精度,内存存不下这么多只能每次都重新算了……代码(3093MS): 1 //模板测试 2 #include 3 #include 4 #include 5 #include 6 #include 7... 阅读全文
posted @ 2013-08-20 15:11 Oyking 阅读(229) 评论(0) 推荐(0) 编辑
摘要: 1、凸包 1 inline bool cmp(const POINT &a, const POINT &b) { 2 if(a.y == b.y) return a.x = 0; 8 } 9 10 inline double dist(POINT &a, POINT &b) {11 return sqrt((a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y));12 }13 14 void Graham_scan() {15 std::sort(p, p + n, cmp);16 top = 1;17... 阅读全文
posted @ 2013-08-19 23:32 Oyking 阅读(384) 评论(0) 推荐(0) 编辑
摘要: 一、平衡树1、treap树 1 int key[MAXN], weight[MAXN], child[MAXN][2], size[MAXN]; 2 int stk[MAXN], top, poi_cnt;//not use point 3 4 inline int newNode(int k) ... 阅读全文
posted @ 2013-08-19 23:27 Oyking 阅读(474) 评论(0) 推荐(0) 编辑
摘要: 1、求逆元1 int inv(int a) {2 if(a == 1) return 1;3 return (MOD - MOD / a) * inv(MOD % a);4 }View Code 2、线性筛法 1 bool isPrime[MAXN]; 2 int label[MAX... 阅读全文
posted @ 2013-08-19 23:14 Oyking 阅读(257) 评论(0) 推荐(0) 编辑
摘要: 一、二分图1、最大匹配数=最大流=最小割=最小点集覆盖=总点数-最大独立集2、KM算法(最佳完美匹配) 1 int mat[MAXN][MAXN], slack[MAXN], Lx[MAXN], Ly[MAXN], left[MAXN]; 2 bool S[MAXN], T[MAXN]; ... 阅读全文
posted @ 2013-08-19 23:11 Oyking 阅读(373) 评论(0) 推荐(0) 编辑
上一页 1 ··· 17 18 19 20 21 22 23 24 25 ··· 29 下一页