摘要: Problem DescriptionThe story happened long long ago. One day, Cao Cao made a special order called "Chicken Rib" to his army. No one got his point and ... 阅读全文
posted @ 2015-11-02 18:39 可怜丶流年 阅读(561) 评论(0) 推荐(0)
摘要: Given an interger N, you are supposed to tell me the last digit of S=11+22+....+NN.InputThe first line contains an integer N (1 #include#includetypede... 阅读全文
posted @ 2015-11-02 14:49 可怜丶流年 阅读(284) 评论(0) 推荐(0)
摘要: Problem DescriptionWe are all familiar with sorting algorithms: quick sort, merge sort, heap sort, insertion sort, selection sort, bubble sort, etc. B... 阅读全文
posted @ 2015-11-01 16:17 可怜丶流年 阅读(322) 评论(0) 推荐(0)
摘要: 问题描述XY在玩一个游戏:有N根柱子排成一排,编号为1到N,每个柱子上面有一块宝石,现在XY站在第S根柱子上,出口在第T跟柱子上,XY需要拿到所有宝石后从出口离开。每次XY可以走到相邻的柱子上,也可以使用超能力跳到第一根柱子或者第N根柱子上,如果离开了柱子之后再也不能到达这里。为了节省能量,XY想用... 阅读全文
posted @ 2015-11-01 09:23 可怜丶流年 阅读(269) 评论(0) 推荐(0)
摘要: ProblemDescriptionnpagodaswerestandingerectinHongJueSibetweentheNiushouMountainandtheYuntaiMountain,labelledfrom1ton.However,onlytwoofthem(labelledaan... 阅读全文
posted @ 2015-10-31 15:17 可怜丶流年 阅读(721) 评论(0) 推荐(0)
摘要: ForngivenstringsS1,S2,?,Sn,labelledfrom1ton,youshouldfindthelargesti(1≤i≤n)suchthatthereexistsanintegerj(1≤j#include#include#include#include#include#i... 阅读全文
posted @ 2015-10-31 15:01 可怜丶流年 阅读(203) 评论(0) 推荐(0)
摘要: 取石子问题有一种很有意思的游戏,就是有物体若干堆,可以是火柴棍或是围棋子等等均可。两个人轮流从堆中取物体若干,规定最后取光物体者取胜。这是我国民间很古老的一个游戏,别看这游戏极其简单,却蕴含着深刻的数学原理。下面我们来分析一下要如何才能够取胜。(一)巴什博奕(Bash Game):只有一堆n个物品,... 阅读全文
posted @ 2015-10-30 18:20 可怜丶流年 阅读(481) 评论(0) 推荐(0)
摘要: 数独游戏的规则是这样的:在一个9x9的方格中,你需要把数字1-9填写到空格当中,并且使方格的每一行和每一列中都包含1-9这九个数字。同时还要保证,空格中用粗线划分成9个3x3的方格也同时包含1-9这九个数字。比如有这样一个题,大家可以仔细观察一下,在这里面每行、每列,以及每个3x3的方格都包含1-9... 阅读全文
posted @ 2015-10-30 11:18 可怜丶流年 阅读(291) 评论(0) 推荐(0)
摘要: 欧拉函数是少于或等于n的数中与n互质的数的数目。 欧拉函数的性质:它在整数n上的值等于对n进行素因子分解后,所有的素数幂上的欧拉函数之积。 欧拉函数的值 通式:φ(x)=x(1-1/p1)(1-1/p2)(1-1/p3)(1-1/p4)…..(1-1/pn),其中p1, p2……pn为x的所有质因... 阅读全文
posted @ 2015-10-29 11:47 可怜丶流年 阅读(245) 评论(0) 推荐(0)
摘要: Yu Zhou likes to playGowith Su Lu. From the historical research, we found that there are much difference on the rules between ancient go and modern go... 阅读全文
posted @ 2015-10-28 13:31 可怜丶流年 阅读(237) 评论(0) 推荐(0)