上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 31 下一页

2016年3月9日

poj 1265 Area Pick定理

摘要: 题目链接 pick定理: 一个计算点阵中顶点在格点上的多边形面积公式:S=a+b÷2-1,其中a表示多边形内部的点数,b表示多边形边界上的点数,s表示多边形的面积 知道这个这题就没有难度了。 #include <iostream> #include <vector> #include <cstdio 阅读全文

posted @ 2016-03-09 14:42 yohaha 阅读(243) 评论(0) 推荐(0) 编辑

poj 3348 Cows 求凸包面积

摘要: 题目链接 大意: 求凸包的面积。 #include <iostream> #include <vector> #include <cstdio> #include <cstring> #include <algorithm> #include <cmath> #include <map> #incl 阅读全文

posted @ 2016-03-09 14:11 yohaha 阅读(224) 评论(0) 推荐(0) 编辑

poj 1113 Wall 凸包

摘要: 题目链接 刷一发凸包模板。 这个题, 我们可以发现, 凹进去的是没有用的... 所以答案就是点构成的凸包的周长+一个圆的周长。 #include <iostream> #include <vector> #include <cstdio> #include <cstring> #include <a 阅读全文

posted @ 2016-03-09 13:56 yohaha 阅读(127) 评论(0) 推荐(0) 编辑

poj 2369 Permutations 置换

摘要: 题目链接 给一个数列, 求这个数列置换成1, 2, 3....n需要多少次。 就是里面所有小的置换的长度的lcm。 #include <iostream> #include <vector> #include <cstdio> #include <cstring> #include <algorit 阅读全文

posted @ 2016-03-09 12:25 yohaha 阅读(167) 评论(0) 推荐(0) 编辑

codeforces 650D. Zip-line 线段树

摘要: 题目链接 题目的意思很简单, 就是给你n个数, m个询问, 每次询问修改某一个位置的值, 然后问你修改完之后数列的lis是多少。 询问独立。 对于原数列, 我们将它离散化, 令dp1[i]为以i为结尾位置的最长上升子序列的长度, dp[2]为以i结尾的从后往前的最长下降子序列的长度。 原数列的lis 阅读全文

posted @ 2016-03-09 09:24 yohaha 阅读(271) 评论(0) 推荐(0) 编辑

2016年3月8日

codeforces 631D. Messenger kmp

摘要: 题目链接 首先想到kmp, 和普通的不一样的是,中间部分严格相等, 头和尾的字符相等但是数量可以不相等。 所以应该把子串的头和尾先去掉,然后对剩下的部分进行kmp。 子串长度为1或2要特别讨论。 不要忘记一开始先把相邻的相同的部分合并掉。 #include <iostream> #include < 阅读全文

posted @ 2016-03-08 23:39 yohaha 阅读(240) 评论(0) 推荐(0) 编辑

codeforces 650C. Table Compression 并查集

摘要: 题目链接 首先想到的应该是排个序然后从小到大填, 每一个填的数应该是这一行和这一列已经有的数的最大值+1。 然后就是处理相同的数, 可以用并查集把它们都并起来, 然后他们的值就一样了, 具体的并查集方法看代码。 我的代码参考的http://www.cnblogs.com/qscqesze/p/525 阅读全文

posted @ 2016-03-08 21:10 yohaha 阅读(211) 评论(0) 推荐(0) 编辑

2016年3月7日

codeforces 650B . Image Preview 二分

摘要: 题目链接 B. Image Preview time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Vasya's telephone c 阅读全文

posted @ 2016-03-07 23:12 yohaha 阅读(345) 评论(0) 推荐(0) 编辑

hdu 4034 Graph floyd

摘要: 题目链接 给出一个有向图各个点之间的最短距离, 求出这个有向图最少有几条边, 如果无法构成图, 输出impossible。 folyd跑一遍, 如果dp[i][j] == dp[i][k]+dp[k][j] 那i j这条边就可以不要, 如果dp[i][j] > dp[i][k]+dp[k][j], 阅读全文

posted @ 2016-03-07 15:24 yohaha 阅读(159) 评论(0) 推荐(0) 编辑

hdu 4033 Regular Polygon 计算几何 二分+余弦定理

摘要: 题目链接 给一个n个顶点的正多边形, 给出多边形内部一个点到n个顶点的距离, 让你求出这个多边形的边长。 二分边长, 然后用余弦定理求出给出的相邻的两个边之间的夹角, 看所有的加起来是不是2Pi。 #include <iostream> #include <vector> #include <cst 阅读全文

posted @ 2016-03-07 14:51 yohaha 阅读(206) 评论(0) 推荐(0) 编辑

上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 31 下一页

导航