上一页 1 ··· 29 30 31 32 33 34 35 36 37 ··· 46 下一页
摘要: There are n houses in the village and some bidirectional roads connecting them. Every day peole always like to ask like this "How far is it if I want 阅读全文
posted @ 2018-02-06 23:29 楼主好菜啊 阅读(264) 评论(0) 推荐(0)
摘要: 推荐博客 : http://blog.csdn.net/lw277232240/article/details/72870644 LCA 就是去寻找最近公共祖先 ,如上图中 10 与 11 的LCA是 6 ,7 和 12 的LCA 是 4 。 通过这个我们可以解决的一类问题就是 求任意两点之间的距离 阅读全文
posted @ 2018-02-06 23:24 楼主好菜啊 阅读(191) 评论(0) 推荐(0)
摘要: int a[100000010]; int main() { int i,len,n; while(scanf("%d",&n)!=EOF){ a[1]=1; len=1; for(int k=2;k=10) { a[i+1]+=a[i]/10; a[i]%=10; ... 阅读全文
posted @ 2018-02-05 18:24 楼主好菜啊 阅读(154) 评论(0) 推荐(0)
摘要: Bizon the Champion isn't just attentive, he also is very hardworking. Bizon the Champion decided to paint his old fence his favorite color, orange. Th 阅读全文
posted @ 2018-02-04 14:00 楼主好菜啊 阅读(470) 评论(0) 推荐(0)
摘要: Let D(x) be the number of positive divisors of a positive integer x. For example, D(2) = 2 (2 is divisible by 1 and 2), D(6) = 4 (6 is divisible by 1, 阅读全文
posted @ 2018-02-03 19:14 楼主好菜啊 阅读(365) 评论(0) 推荐(0)
摘要: 如何 快速求一个数的因数的个数 问题 2 : 如何求 1 - n 里所有数约数个数的总和 ? 对于一个所要求的数 n ,我们要求的就是遍历 1 - n , 找有几个数是此数的倍数,将结果累加就可以。 问题3 : 如何求 1 - n 里所有数约数个数最多的数是哪个? 约数定理 : 任意一个数都可以写成 阅读全文
posted @ 2018-02-03 17:04 楼主好菜啊 阅读(390) 评论(0) 推荐(0)
摘要: C. Swap Adjacent Elements time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output You have an arr 阅读全文
posted @ 2018-02-03 15:16 楼主好菜啊 阅读(168) 评论(0) 推荐(0)
摘要: 题目描述 小W在计算一个数列{An},其中A1=1,A2=2,An+2=An+1+An。尽管他计算非常精准,但很快他就弄混了自己的草稿纸,他找出了一些他计算的结果,但他忘记了这些都是数列中的第几项。 输入描述: 每行包括数列中的一项Ak(k<=100000)。 总行数T<=30。 输出描述: 对于每 阅读全文
posted @ 2018-02-03 14:31 楼主好菜啊 阅读(169) 评论(0) 推荐(0)
摘要: You are given a non-negative integer n, its decimal representation consists of at most 100 digits and doesn't contain leading zeroes. Your task is to 阅读全文
posted @ 2018-02-02 16:51 楼主好菜啊 阅读(932) 评论(0) 推荐(0)
摘要: Woken up by the alarm clock Igor the financial analyst hurried up to the work. He ate his breakfast and sat in his car. Sadly, when he opened his GPS 阅读全文
posted @ 2018-02-02 10:46 楼主好菜啊 阅读(329) 评论(0) 推荐(0)
上一页 1 ··· 29 30 31 32 33 34 35 36 37 ··· 46 下一页