上一页 1 ··· 3 4 5 6 7
摘要: http://219.230.70.12/Local/1747 #include<cstdlib>#include<iostream>#include<cstdio>#include<cmath>#include<string>#include<cstring>#include<algorithm>#include<set>#include<map>#include<list>#include<queue>#include<vector>#define 阅读全文
posted @ 2013-05-14 21:29 baoff 阅读(133) 评论(0) 推荐(0) 编辑
摘要: //求a加到b二进制加法有多少次进位。//网址:http://219.230.70.12/Local/1739#include<cstdlib>#include<iostream>#include<cstdio>#include<cmath>#include<string>#include<cstring>#include<algorithm>#include<set>#include<map>#include<list>#include<queue>#inclu 阅读全文
posted @ 2013-05-14 19:57 baoff 阅读(350) 评论(0) 推荐(0) 编辑
只有注册用户登录后才能阅读该文。 阅读全文
posted @ 2013-05-02 09:14 baoff 阅读(4) 评论(0) 推荐(0) 编辑
摘要: View Code 1 #include<cstdlib> 2 #include<iostream> 3 #include<cstdio> 4 #include<cmath> 5 #include<cstring> 6 #include<algorithm> 7 #include<set> 8 #include<map> 9 #include<list>10 #include<queue>11 #include<vector>12 #define ULL unsi 阅读全文
posted @ 2013-04-26 21:07 baoff 阅读(116) 评论(0) 推荐(0) 编辑
摘要: 【题意】:给出一棵树,每条边的长度为1,问树上有多少点对的距离恰好为k。【题解】:用树的分治可解,但是写起来比较麻烦。 设状态dp[i][j]表示以i为根的子树的节点到i的距离恰为j的个数。 然后利用乘法原理求出答案,再把儿子的信息传给父亲。1#include<cstdlib>2#include<iostream>3#include<cstdio>4#include<cmath>5#include<cstring>6#include<string>7#include<map>8#include<algor 阅读全文
posted @ 2012-11-20 21:42 baoff 阅读(280) 评论(0) 推荐(0) 编辑
摘要: 给出一个长度为N的串S(N≤500000)。这个串只包含“a”“b”两种字母。找一个长度为L的串T也是右“a”“b”两种字母组成使得该串不是串S的 子串且长度L尽可能小。 问题分析 这是一道统计的题目。由于串只由两种字母组成因此相当于一个01串。如果我们求出S的所有子串然后标记起来再由小到大枚举T串直到T串不是S的子串那么就能得出解了。然而S的子串是十分多的所以我们有必要分析一下这道题的特征。 题目要我们使长度L尽可能小。而对于某一个L串S中最多包含N-L+1个长度为L的子串。而长度为L的串一共有2L个。若N-L+1<2L则必有某个长度为L的串T不是S的子串。而N 阅读全文
posted @ 2012-11-10 23:36 baoff 阅读(186) 评论(0) 推荐(0) 编辑
摘要: View Code #include<cstdlib>#include<iostream>#include<cstdio>#include<cmath>#include<cstring>#include <algorithm>#include<vector>#include<set>#include<queue>#define LL long long#define inf 0x7fffffff#define E 1e-9#define N 10009using namespace st 阅读全文
posted @ 2012-11-02 19:55 baoff 阅读(185) 评论(0) 推荐(0) 编辑
摘要: 网址:http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&category=116&problem=1535&mosmsg=Submission+received+with+ID+10787830//正确代码:#include <iostream>#include <cstdio>#include <cstring>#include <queue>#include <algorit 阅读全文
posted @ 2012-10-24 22:22 baoff 阅读(243) 评论(0) 推荐(0) 编辑
上一页 1 ··· 3 4 5 6 7