08 2015 档案
摘要:链接:http://blog.csdn.net/lvshubao1314/article/details/39829217
阅读全文
摘要:链接: http://blog.csdn.net/lvshubao1314/article/details/41702291
阅读全文
摘要:Description杭州有N个景区,景区之间有一些双向的路来连接,现在8600想找一条旅游路线,这个路线从A点出发并且最后回到A点,假设经过的路线为V1,V2,....VK,V1,那么必须满足K>2,就是说至除了出发点以外至少要经过2个其他不同的景区,而且不能重复经过同一个景区。现在8600需要你...
阅读全文
摘要:DescriptionDandelion's uncle is a boss of a factory. As the spring festival is coming , he wants to distribute rewards to his workers. Now he has a tr...
阅读全文
摘要:Description有N个比赛队(1#include #include using namespace std;const int N=510;int i,j,k,m,n;int map[N][N],indegre[N];void topo(){ for(i=1;i<=n;i++) f...
阅读全文
摘要:Problem DescriptionAs we all known , the Fibonacci series : F(0) = 1, F(1) = 1, F(N) = F(N - 1) + F(N - 2) (N >= 2).Now we define another kind of Fibo...
阅读全文
摘要:Description我们定义斐波那契数列如下:f1=1f2=2f(n)=f(n-1)+f(n-2)(n>=3)现在,给定两个数a和b,计算有多少个斐波那契数列中的数在a和b之间(包含边界)。Input输入包含多组测试数据,每组测试数据都是两个非负整数a和b,当a和b都等于0时,程序结束。0#inc...
阅读全文
摘要:DescriptionThe Fibonacci sequence is the sequence of numbers such that every element is equal to the sum of the two previous elements, except for the ...
阅读全文
摘要:Description2007年到来了。经过2006年一年的修炼,数学神童zouyu终于把0到100000000的Fibonacci数列(f[0]=0,f[1]=1;f[i] = f[i-1]+f[i-2](i>=2))的值全部给背了下来。接下来,CodeStar决定要考考他,于是每问他一个数字,他...
阅读全文
摘要:A Fibonacci sequence is calculated by adding the previous two members the sequence, with the first two members being both 1.F(1) = 1, F(2) = 1, F(3) =...
阅读全文
摘要:As we know , the Fibonacci numbers are defined as follows:""""Given two numbers a and b , calculate. """"InputThe input contains several test cases. E...
阅读全文
摘要:Maybe ACMers of HIT are always fond of fibonacci numbers, because it is so beautiful. Don't you think so? At the same time,fishcanflyalways likes to c...
阅读全文
摘要:1、stringadd(strings1,strings2){if(s1.length()=0;i--,j--){s1[i]=char(s1[i]+(j>=0?s2[j]-'0':0));if(s1[i]-'0'>=10){s1[i]=char((s1[i]-'0')%10+'0');if(i)s1...
阅读全文
摘要:DescriptionIgnatius最近遇到一个难题,老师交给他很多单词(只有小写字母组成,不会有重复的单词出现),现在老师要他统计出以某个字符串为前缀的单词数量(单词本身也是自己的前缀).Input输入数据的第一部分是一张单词表,每行一个单词,单词的长度不超过10,它们代表的是老师交给Ignat...
阅读全文
摘要:Problem DescriptionC国的死对头A国这段时间正在进行军事演习,所以C国间谍头子Derek和他手下Tidy又开始忙乎了。A国在海岸线沿直线布置了N个工兵营地,Derek和Tidy的任务就是要监视这些工兵营地的活动情况。由于采取了某种先进的监测手段,所以每个工兵营地的人数C国都掌握的一...
阅读全文
摘要:POJ-1182 食物链(NYOJ-207)食物链时间限制:1000ms | 内存限制:65535KB难度:5描述动物王国中有三类动物A,B,C,这三类动物的食物链构成了有趣的环形。A吃B, B吃C,C吃A。现有N个动物,以1-N编号。每个动物都是A,B,C中的一种,但是我们并不知道它到底是哪一种。...
阅读全文
摘要:DescriptionBackgroundProfessor Hopper is researching the sexual behavior of a rare species of bugs. He assumes that they feature two different genders...
阅读全文
摘要:Description 严重急性呼吸系统综合症( SARS), 一种原因不明的非典型性肺炎,从2003年3月中旬开始被认为是全球威胁。为了减少传播给别人的机会, 最好的策略是隔离可能的患者。 在Not-Spreading-Your-Sickness大学( NSYSU), 有许多学生团体。同一组的学生
阅读全文
摘要:DescriptionThe doggie found a bone in an ancient maze, which fascinated him a lot. However, when he picked it up, the maze began to shake, and the dog...
阅读全文
摘要:DescriptionThe GeoSurvComp geologic survey company is responsible for detecting underground oil deposits. GeoSurvComp works with one large rectangular...
阅读全文
摘要:DescriptionThere is a rectangular room, covered with square tiles. Each tile is colored either red or black. A man is standing on a black tile. From a...
阅读全文
摘要:EatChocolate一天,DB小公主把n块不同大小的巧克力送给了HY和SMZ,HY和SMZ决定玩一场游戏。他们把这n块巧克力排成一条线放在桌子上,之后HY从左向右开始一个一个地吃巧克力,而SMZ则从右向左吃。假设他们吃巧克力的速度是一样的,并且速度是1g/s。当然两个人是不能同时吃同一块巧克...
阅读全文
摘要:DescriptionMr. Tenant is going to buy a new house. In fact, he is going to buy a piece of land and build his new house on it. In order to decide which...
阅读全文
摘要:Every year there is the same problem at Halloween: Each neighbour is only willing to give a certaintotal number of sweets on that day, no matter how m...
阅读全文
摘要:输入n(using namespace std;typedef long long LL;LL a[15];LL gcd(LL a,LL b) //求a和b的最大公约数{ if(b) return gcd(b,a%b); return a;}LL lcm(LL a,LL b) //求a和b的最小公倍...
阅读全文
摘要:typedef long long LL;LL quick(LL a,LL b,LL m) //a^b%m 快速取模 使得复杂度从0(b){ // 降低为0(log2(b)) LL ans=1; while(b) { if(b&1) ans=ans*a%m; b>>=1; a=a*a%m; } re...
阅读全文
摘要:输入N和M,M表示接下来会输入M个数,求从1到N中不能被这M个数整出的数的个数。思路:先算出从1到N中能被这M个数整除(即是这M个数中任意一个数的倍数)的数的个数,在用N减去就是答案了。#include #include using namespace std;long long num[20];l...
阅读全文
摘要:题意:将A(n , m)转化成k进制后末尾0的个数。分析:求A(n, m)转化成k进制以后末尾0的个数。对k素因子分解,第i个因子为fac[i],第i个因子的指数为num[i],然后再对n的对A(n, m)进行素因子分解,设count[i]代表fac[i]对应的指数,ans = min{count[...
阅读全文

浙公网安备 33010602011771号