- 博客(16)
- 收藏
- 关注
原创 POJ 1658 Frogs' Neighborhood
第一行是测试数据的组数T(0 ≤ T ≤ 20)。每组数据包括两行,第一行是整数N(2 1、某次对剩下序列排序后,最大的度数(d1)超过了剩下的顶点数 2、对最大的度数后面的d1个度数各减1后,出现了负数一旦出现以上两种情形,则可判定该序列是不可图的 本体实现思路: 1:为了确保顶点序号与输入时保持度数顺序一致,特意声明一个vertex结构体,包含了顶点的度和序号两个成员 2:每次
2013-07-14 21:17:19
504
原创 线段树成段跟新个人总结
1.成段更新 hdu1698 Just a Hook #include #include #include using namespace std; #define lson l , m , rt << 1 #define rson m + 1 , r , rt << 1 | 1 const int maxn = 111111; int h , w , n; int col[maxn<
2013-07-14 21:09:35
562
原创 线段树单点更新个人总结
1.1.单点更新 hdu2795 Billboard #include #include #include #define lint long long #define lson l, m, rt<<1 #define rson m+1, r, rt<<1|1 using namespace std; const int maxn = 222222; int MAX[maxn<<2];
2013-07-14 21:06:27
457
原创 2013 whu暑假集训选拔#3
一、已AC的题 B题 水题,基本都秒了 #include #include #include #include #include #define LL long long #define abs(x) ((x)>0?(x):-(x)) #define mset(a, b) memset(a, b, sizeof(a)) #define rep(i, n) for(int
2013-07-10 23:45:44
508
原创 2013 whu暑假集训选拔#2
一、已AC的题 (没参加比赛) 二、赛后想想能过的题 A题 设立两个参数l和r l表示当前位置‘{’的数量 r表示当前位置‘}’的数量 有 l == 0 '}' r++ l == 0 '{' l++ l > 0 '}' l++ l > 0 '{' l++ 当l > 1 && r > 1时(r>1表示在‘{’前有r
2013-07-10 23:42:45
385
原创 2013 whu暑假集训选拔#1
一、已AC的题 D题(zoj3365) 开始看题后没发现什么思路,跑去想C题了,后来发现其他人瞬间把D过了,跑回去看题,才发现自己题目看错了,题目要求的是最终输出的是连续数字,及每个数与其对应的基数的差值,保留差值众数对应的数即可。 赛后来和天成讨论了一下,发现这个题目有个bug,输出的结果连续数只能上升么,如果是下降的话那么样例输出就是 2 5 4 3 2 1 0 而不是 3
2013-07-10 23:40:05
507
转载 PLSQL developer 连接不上64位Oracle 的解决方法
PLSQL developer 连接不上64位Oracle 的解决方法 引用功能被关闭了。 Windows 64位下装Oracle 11g 64位,PLSQL Developer使用出现以下问题: 1、Database下拉框为空: 2、强制输入用户名、密码及Database,登录弹出: 引用 Initialzation error Could not initia
2013-03-02 20:12:42
300
原创 数据结构之并查集
1.概述 英文:DisjointSet or(Union-find set),即“不相交集合”将编号分别为1…N的N个对象划分为不相交集合,在每个集合中,选择其中某个元素代表所在集合。 常见两种操作: (1)合并两个集合 (2)查找某元素属于哪个集合 所以也成称为并查集。。 2.导引问题 畅通工程:HDU1232 Problem Description
2013-01-24 17:27:26
368
转载 位运算中的一些小技巧
左位移几就相当于乘以2的几次方( Left bit shifting to multiply by any power of two ) //将一个值向左侧移动一位与这个值乘以 2 等效 。浮点数通过舍去小数点后面的所有位来转换为整数。 大约快了300% x = x * 2; x = x * 64; //相当于: x = x x = x 补充:对于乘以2的N
2013-01-19 17:35:58
309
转载 深入了解scanf()/getchar()和gets()等函数
深入了解scanf()/getchar()和gets()等函数 ---------------------------------------------------- | 问题描述一:(分析scanf()和getchar()读取字符) | ----------------------------------------------------
2012-12-04 11:32:11
541
原创 zoj 1151 Word Reversal
注意使用cin~~有可能会TLE~ 可以深入了解c/c++的输入输出,代码中的getchar();是用来读取输入缓冲区的换行'\n'的; 深入了解熟路输出:http://blog.csdn.net/allen231x/article/details/8255023 #include #include using namespace std; char str[105]; char ch;
2012-12-04 11:25:02
467
原创 zoj 1240 IBM Minus One
还是注意输出~~ #include #include int n; char str[55]; int i; int main() { scanf("%d",&n); int cas = 1; while(n--) { scanf("%s", str); for(i = 0; i < (int)strlen(str); i++)
2012-12-04 11:23:18
276
原创 zoj 1241 Geometry Made Simple
#include #include int main() { float a, b, c; int cas = 1; while(scanf("%f%f%f", &a,&b,&c) && a != 0) { if(-1 == c) { printf("Triangle #%d\n", cas++);
2012-12-04 11:20:05
287
原创 zoj 1067 Color Me Less
#include #include #include #include #include #include #include #include #include #include #include using namespace std; struct color { int r, p, g; }map[20]; int i; int main() {
2012-12-03 18:46:06
212
原创 zoj 1115 Digital Roots
本题有两种方法,不过貌似都要用字符串转换,可是题目明明说的int型。。。。 一、常用做法 #include #include #include #include using namespace std; string num; int main() { while(cin>>num && num != "0") { int sum = 0;
2012-12-03 18:09:24
299
转载 Java源码分析:深入探讨Iterator模式
java.util包中包含了一系列重要的集合类。本文将从分析源码入手,深入研究一个集合类的内部结构,以及遍历集合的迭代模式的源码实现内幕。 下面我们先简单讨论一个根接口Collection,然后分析一个抽象类AbstractList和它的对应Iterator接口,并仔细研究迭代子模式的实现原理。 本文讨论的源代码版本是JDK 1.4.2,因为JDK 1.5在java.uti
2012-11-30 14:09:39
207
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人