永夜初晗凝碧天

本博客现已全部转移到新地址,欲获取更多精彩文章,请访问http://acshiryu.github.io/

导航

2011年11月24日 #

高级数据结构设计--并查集及实现学习笔记(有趣篇)

摘要: 为了解释并查集的原理,我将举一个更有趣的例子:话说江湖上散落着各式各样的大侠,有上千个之多。他们没有什么正当职业,整天背着剑在外面走来走去,碰到和自己不是一路人的,就免不了要打一架。但大侠们有一个优点就是讲义气,绝对不打自己的朋友。而且他们信奉“朋友的朋友就是我的朋友”,只要是能通过朋友关系串联起来的,不管拐了多少个弯,都认为是自己人。这样一来,江湖上就形成了一个一个的群落,通过两两之间的朋友关系串联起来。而不在同一个群落的人,无论如何都无法通过朋友关系连起来,于是就可以放心往死了打。但是两个原本互不相识的人,如何判断是否属于一个朋友圈呢?我们可以在每个朋友圈内推举出一个比较有名望的人,作为该圈子的代表人物,这样,每个圈子就可以这样命名“齐达内朋友之队”“罗纳尔多朋友之队”……两人只要互相对一下自己的队长是不是同一个人,就可以确定敌友关系了。 阅读全文

posted @ 2011-11-24 13:39 ACShiryu 阅读(3771) 评论(6) 推荐(5) 编辑

2011年11月22日 #

常见OJ评判结果对照表,作为ACMer你懂得!

摘要: 总结了一下比较常见的OJ评判结果以及它们表示的意思,仅供参考 阅读全文

posted @ 2011-11-22 13:52 ACShiryu 阅读(16260) 评论(0) 推荐(2) 编辑

2011年11月19日 #

111120周赛解题报告

摘要: 题目下载:http://files.cnblogs.com/ACShiryu/%E9%A2%98%E7%9B%AE.zip实时Rank:http://202.114.46.118/JudgeOnline/contestrank.php?cid=1009代码下载:http://files.cnblogs.com/ACShiryu/%E4%BB%A3%E7%A0%81.zipProblem A: 不服气的数字假设可以去的2数有k个如果要求取得没有0,则答案为k^1+k^2+k^3+......+k^n如果要求取得数含有0则答案为k+(k-1)*k+(k-1)*k^2+(k-1)*k^3+...(k 阅读全文

posted @ 2011-11-19 20:35 ACShiryu 阅读(319) 评论(0) 推荐(2) 编辑

2011年10月9日 #

讲题课件--简单数学题

摘要: http://files.cnblogs.com/ACShiryu/%E7%AE%80%E5%8D%95%E6%95%B0%E5%AD%A6%E9%A2%98ByACShiryu.ppt 阅读全文

posted @ 2011-10-09 18:45 ACShiryu 阅读(350) 评论(0) 推荐(0) 编辑

2011年9月17日 #

并查集(有趣篇)

摘要: 话说江湖上散落着各式各样的大侠,有上千个之多。他们没有什么正当职业,整天背着剑在外面走来走去,碰到和自己不是一路人的,就免不了要打一架。但大侠们有一个优点就是讲义气,绝对不打自己的朋友。而且他们信奉“朋友的朋友就是我的朋友”,只要是能通过朋友关系串联起来的,不管拐了多少个弯,都认为是自己人。这样一来,江湖上就形成了一个一个的群落,通过两两之间的朋友关系串联起来。而不在同一个群落的人,无论如何都无法通过朋友关系连起来,于是就可以放心往死了打。但是两个原本互不相识的人,如何判断是否属于一个朋友圈呢?我们可以在每个朋友圈内推举出一个比较有名望的人,作为该圈子的代表人物,这样,每个圈子就可以这样命名“齐达内朋友之队”“罗纳尔多朋友之队”……两人只要互相对一下自己的队长是不是同一个人,就可以确定敌友关系了。 阅读全文

posted @ 2011-09-17 16:56 ACShiryu 阅读(2183) 评论(0) 推荐(3) 编辑

2011年9月15日 #

poj 2492 纪念下九月份AC的第一道题----并查集----有点重口味

摘要: Background Professor Hopper is researching the sexual behavior of a rare species of bugs. He assumes that they feature two different genders and that they only interact with bugs of the opposite gender. In his experiment, individual bugs and their interactions were easy to identify, because numbers were printed on their backs. Problem Given a list of bug interactions, decide whether the experiment supports his assumption of two genders with no homosexual bugs or if it contains some bug int 阅读全文

posted @ 2011-09-15 22:24 ACShiryu 阅读(1571) 评论(0) 推荐(1) 编辑

2011年9月1日 #

平面分割和空间分割的相关公式

摘要: n条折线分割平面数:2*n*n-n+1 n条折线可以看做是2n条直线分割平面,然后减去多余的区域 2n条直线分割平面的区域数就是n(2n+1)+1=2n^2+n+1 阅读全文

posted @ 2011-09-01 22:55 ACShiryu 阅读(5101) 评论(0) 推荐(0) 编辑

2011年8月28日 #

hdu 1785 You Are All Excellent

摘要: 本次集训队共有30多人参加,毫无疑问,你们都是很优秀的,但是由于参赛名额有限,只能选拔部分队员参加省赛。从学校的角度,总是希望选拔出最优秀的18人组成6支队伍来代表学校。但是,大家也知道,要想做到完全客观,是一件很难的事情。因为选拔的标准本身就很难统一。 阅读全文

posted @ 2011-08-28 11:23 ACShiryu 阅读(758) 评论(0) 推荐(0) 编辑

hdu2108和hdu2036 叉乘的运用

摘要: 最简单的计算几何 阅读全文

posted @ 2011-08-28 11:18 ACShiryu 阅读(869) 评论(0) 推荐(0) 编辑

2011年8月21日 #

[转]ACM人生

摘要: 与ACM接触这么长时间了...有点感悟..... -------------------------------------------------我割------------------------------------------------------------------------------- 首先呢,为了简化文章,请允许我 #define 它 ACM 其实能,它对人生的指引很大.... 阅读全文

posted @ 2011-08-21 17:54 ACShiryu 阅读(389) 评论(0) 推荐(0) 编辑

2011年8月20日 #

[转]位运算(简版:方便+好用+好看+无废话)

摘要: By:Hellis 我是在Nettle和matrix67两位大牛的基础上修改的。把过多的废话和例题给和谐了,剩下的都是重点和基础。 至于为什么文中用了N多个“1314520”这就不能问我了,我是无辜的……55555。 Pascal和C中的位运算符号 下面的a和b都是整数类型,则: C语言 | Pascal语言 -------+------------- a & b | a and ... 阅读全文

posted @ 2011-08-20 12:28 ACShiryu 阅读(706) 评论(0) 推荐(0) 编辑

2011年8月16日 #

poj1080 人类基因配对

摘要: It is well known that a human gene can be considered as a sequence, consisting of four nucleotides, which are simply denoted by four letters, A, C, G, and T. Biologists have been interested in identifying human genes and determining their functions, because these can be used to diagnose human diseases and to design new drugs for them. 阅读全文

posted @ 2011-08-16 10:03 ACShiryu 阅读(1337) 评论(0) 推荐(1) 编辑

hdu2955 教你怎样抢银行划算!

摘要: The aspiring Roy the Robber has seen a lot of American movies, and knows that the bad guys usually gets caught in the end, often because they become too greedy. He has decided to work in the lucrative business of bank robbery only for a short while, before retiring to a comfortable job at a university. 阅读全文

posted @ 2011-08-16 09:39 ACShiryu 阅读(810) 评论(0) 推荐(0) 编辑

2011年8月14日 #

poj1088记忆化搜索

摘要: Michael喜欢滑雪百这并不奇怪, 因为滑雪的确很刺激。可是为了获得速度,滑的区域必须向下倾斜,而且当你滑到坡底,你不得不再次走上坡或者等待升降机来载你。Michael想知道载一个区域中最长底滑坡。区域由一个二维数组给出。数组的每个数字代表点的高度。 阅读全文

posted @ 2011-08-14 00:12 ACShiryu 阅读(1496) 评论(0) 推荐(0) 编辑

poj1050经典DP的二维形式

摘要: Given a two-dimensional array of positive and negative integers, a sub-rectangle is any contiguous sub-array of size 1*1 or greater located within the whole array. The sum of a rectangle is the sum of all the elements in that rectangle. In this problem the sub-rectangle with the largest sum is referred to as the maximal sub-rectangle. 阅读全文

posted @ 2011-08-14 00:06 ACShiryu 阅读(723) 评论(0) 推荐(0) 编辑

2011年8月13日 #

poj2479与poj2593 , 同一道DP题

摘要: Give you N integers a1, a2 ... aN (|ai| =1000, 1 = i = N). You should output S. 阅读全文

posted @ 2011-08-13 11:29 ACShiryu 阅读(507) 评论(0) 推荐(0) 编辑

2011年8月9日 #

poj3233 又见矩阵,不过是等比吗?

摘要: Given a n × n matrix A and a positive integer k, find the sum S = A + A^2 + A^3 + … + A^k.也许可以用等比数列的前n项来求和??? 阅读全文

posted @ 2011-08-09 11:44 ACShiryu 阅读(2352) 评论(7) 推荐(1) 编辑

poj3070来体会矩阵的妙用

摘要: In the Fibonacci integer sequence, F0 = 0, F1 = 1, and Fn = Fn − 1 + Fn − 2 for n ≥ 2. For example, the first ten terms of the Fibonacci sequence are: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, … Given an integer n, your goal is to compute the last 4 digits of Fn. 阅读全文

posted @ 2011-08-09 11:11 ACShiryu 阅读(1590) 评论(1) 推荐(0) 编辑

poj3370同样的是抽屉原理

摘要: Every year there is the same problem at Halloween: Each neighbour is only willing to give a certain total number of sweets on that day, no matter how many children call on him, so it may happen that a child will get nothing if it is too late. To avoid conflicts, the children have decided they will put all sweets together and then divide them evenly among themselves. From last year's experience of Halloween they know how many sweets they get from each neighbour. Since they care more about justice 阅读全文

posted @ 2011-08-09 10:54 ACShiryu 阅读(1831) 评论(0) 推荐(0) 编辑

从poj2356来体会 抽屉原理 的妙用

摘要: 抽屉原理又称鸽巢原理,它是组合数学的一个基本原理,最先是由德国数学家狭利克雷明确地提出来的,因此,也称为狭利克雷原理。这个原理可以简单地叙述为“把10个苹果,任意分放在9个抽屉里,则至少有一个抽屉里含有两个或两个以上的苹果”。这个道理是非常明显的,但应用它却可以解决许多有趣的问题,并且常常得到一些令人惊异的结果。 阅读全文

posted @ 2011-08-09 10:53 ACShiryu 阅读(3521) 评论(7) 推荐(2) 编辑