09 2012 档案

摘要:划分树+二分枚举http://acm.hdu.edu.cn/showproblem.php?pid=4417划分树http://www.cnblogs.com/pony1993/archive/2012/07/17/2594544.html直接搬来模板 打得View Code 1 #include <iostream> 2 #include <cstdio> 3 #include <algorithm> 4 using namespace std; 5 #define N 100005 6 int a[N], as[N];//原数组,排序后数组 7 int 阅读全文
posted @ 2012-09-24 11:36 _雨 阅读(233) 评论(1) 推荐(0) 编辑
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=4282仔细想这个题的时候 不到一小时了 开始写的时候也就还剩半个小时了 实验室开始很乱 打的也很乱 交了几次CE WA TLE之后 就放弃了也是一道水题 了z为2时是完全平方 z从3开始枚举View Code 1 #include <iostream> 2 #include<cstdio> 3 #include<string.h> 4 #include<math.h> 5 using namespace std; 6 __int64 pows(int x,int 阅读全文
posted @ 2012-09-10 19:58 _雨 阅读(209) 评论(0) 推荐(0) 编辑
摘要:http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=473没什么意思View Code 1 #include <iostream> 2 #include<cstdio> 3 #include<string.h> 4 using namespace std; 5 char s[31][31][31]; 6 struct node 7 { 8 int x,y,z,num; 9 }q[100001];10 阅读全文
posted @ 2012-09-07 20:34 _雨 阅读(166) 评论(0) 推荐(0) 编辑
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=14212A 之前在实验室写的时候排好了序 没打完 回来重打的时候忘记了排序。。View Code 1 #include <iostream> 2 #include<cstdio> 3 #include<string.h> 4 #include<algorithm> 5 #define INF 0xffffff 6 using namespace std; 7 int w[2011]; 8 __int64 dp[2011][1011]; 9 int main()1 阅读全文
posted @ 2012-09-07 11:07 _雨 阅读(161) 评论(0) 推荐(0) 编辑
摘要:http://poj.org/problem?id=2240简单题 1A 只是把结点变成了字符串 用map调下就好 数据量不大 floyd300+ms货币之间的转换 问转换完是否能获利View Code 1 #include <iostream> 2 #include<cstdio> 3 #include<string.h> 4 #include<map> 5 using namespace std; 6 double w[100][100]; 7 int main() 8 { 9 int i,j,k,n,m,kk =0 ;10 char str 阅读全文
posted @ 2012-09-06 20:22 _雨 阅读(150) 评论(0) 推荐(0) 编辑
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=10877A。。。。简单的递推 没考虑负数的情况 一直乱改。。View Code 1 #include <iostream> 2 #include<cstdio> 3 #include<string.h> 4 #define INF 0xfffffff 5 using namespace std; 6 long long dp[1011],a[1011]; 7 int main() 8 { 9 int i,j,k,n,m;10 while(scanf("%d&quo 阅读全文
posted @ 2012-09-05 20:50 _雨 阅读(180) 评论(2) 推荐(0) 编辑
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=11601A 破题敲了一个多小时 最长上升子序列和最长下降子序列合起来 并把路径保留下来 题中是可以打乱顺序去找的 先按W上升或S下降排下序 再按最升和最降做View Code 1 #include <iostream> 2 #include<cstdio> 3 #include<string.h> 4 #include<algorithm> 5 using namespace std; 6 struct node 7 { 8 int w,s,xu; 9 }q[1 阅读全文
posted @ 2012-09-05 20:06 _雨 阅读(252) 评论(0) 推荐(0) 编辑
摘要:http://poj.org/problem?id=2828险过 3500+ms第i个人入队 只影响后面的不会影响前面的 可以倒推 全初始化为1 第i个人去第k位置 由于是倒推,第k个位置为0,表示求k-1位置的时候不能算上k位置的人 根据区间和 求出区间第K值 就是第i个人要放的位置View Code 1 #include <iostream> 2 #include<cstdio> 3 #include<string.h> 4 using namespace std; 5 #define N 200001 6 int s[N*4],d[N*2][2],po 阅读全文
posted @ 2012-09-05 13:24 _雨 阅读(245) 评论(0) 推荐(0) 编辑
摘要:RMQ (Range Minimum/Maximum Query)问题是指:对于长度为n的数列A,回答若干询问RMQ(A,i,j)(i,j<=n),返回数列A中下标在i,j里的最小(大)值,也就是说,RMQ问题是指求区间最值的问题。http://poj.org/problem?id=32641A 程序跑的好慢 3000+输完更新 父节点的最小最大值 找的时候找两次 一次最大 一次最小 相减View Code 1 #include <iostream> 2 #include<cstdio> 3 #include<string.h> 4 using nam 阅读全文
posted @ 2012-09-05 09:12 _雨 阅读(150) 评论(0) 推荐(0) 编辑
摘要:http://poj.org/problem?id=2513每个单词为一个节点 并查集判联通 度数为偶数或有两个为奇数 4A 第三次是由于有多余的测试输出没删掉 前两次统计多少个单词 统计错了View Code 1 #include <iostream> 2 #include<cstdio> 3 #include<string.h> 4 using namespace std; 5 char s[500011][11]; 6 int dd,father[500011],r[500011],dk[500011]; 7 struct node 8 { 9 int 阅读全文
posted @ 2012-09-03 18:36 _雨 阅读(187) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示