摘要:
最大公约数的辗转相除法(欧几里得算法)证明:给出两个数a和b,求其最大公约数。设a%b=y;则a=k*b+y(k为一整数)设a,b的最小公约数为u则:(k*b+y)%u=0; b%u=0;由(2)式可知k*b%u=0,所以y%u=0所以a,b的最小公约数就可以转换为b... 阅读全文
摘要:
在鹅厂工作的DJ开始训练起了鹅厂的企鹅们,现在DJ教小企鹅玩一个疯狂的游戏(危险游戏,小朋友请勿模仿)。现在有一排小企鹅,从左到右编号为1....N,每个小企鹅有一个数字,每天早上,如果一个小企鹅发现他右边的小企鹅的数字比他的小,他就会消灭这个小企鹅。问到了第几天才会... 阅读全文
摘要:
点的修改:#include#include#include#include#include#include#include#include#include#include#include#define endl '\n'#define sc(x) scanf("%d"... 阅读全文
摘要:
The citizens of Bytetown, AB, could not stand that the candidates in the mayoral election campaign have been placing their electoral p... 阅读全文
摘要:
CC always becomes very depressed at the end of this month, he has checked his credit card yesterday, without any surprise, there are o... 阅读全文
摘要:
E - Blue Jeans POJ - 3080 The Genographic Project is a research partnership between IBM and The National Geographic Society that is an... 阅读全文
摘要:
Given two sequences of numbers : a[1], a[2], ...... , a[N], and b[1], b[2], ...... , b[M] (1 #include#include#include#include#include#... 阅读全文
摘要:
Prefixes and Suffixes CodeForces - 432D You have a string s = s1s2...s|s|, where |s| is the length of string s, and si its i-th charac... 阅读全文
摘要:
本题的题目选择的是病毒侵袭持续中 HDU - 3065 const int size=5e4+5;const int SIGMA_SIZE=26;int trie[size][26],val[size];char s_save[1005][60],s_fin[2000... 阅读全文
摘要:
KiKi's K-Number HDU - 2852 For the k-th number, we all should be very familiar with it. Of course,to kiki it is also simple. Now Kiki ... 阅读全文