摘要: A. ArraysYou are given two arrays A and B consisting of integers, sorted in non-decreasing order. Check whether it is possible to choose k numbers in ... 阅读全文
posted @ 2015-08-23 02:40 Kirai 阅读(265) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include 10 #include 11 #include 12 #include 13 #in... 阅读全文
posted @ 2015-08-22 22:12 Kirai 阅读(162) 评论(0) 推荐(0) 编辑
摘要: 题目链接:https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=1633求一连串的幂,如果暴力算的话会溢出,题中会有一个求模,给出一个欧拉定理的应用:x^y % ... 阅读全文
posted @ 2015-08-22 17:00 Kirai 阅读(247) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4911InversionTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 131072/131072 K (Java/Others)Total Sub... 阅读全文
posted @ 2015-08-20 21:01 Kirai 阅读(273) 评论(0) 推荐(1) 编辑
摘要: 题目链接:http://acm.hust.edu.cn/vjudge/problem/visitOriginUrl.action?id=26992DescriptionYou are given two integers:nandk, your task is to find the most si... 阅读全文
posted @ 2015-08-20 00:28 Kirai 阅读(182) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1568输出前四位的方法想不到,于是转载了方法:(原文地址http://jingyan.baidu.com/article/f3e34a128e48acf5ea65355b.html)题意:输出Fibona... 阅读全文
posted @ 2015-08-19 23:09 Kirai 阅读(260) 评论(0) 推荐(0) 编辑
摘要: A - Bi-shoe and Phi-shoe Crawling in process... Crawling failed Time Limit:2000MS Memory Limit:32768KB 64bit IO Format:%lld & %lluDescriptionBambo... 阅读全文
posted @ 2015-08-19 18:57 Kirai 阅读(210) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1695 两个区间内各取一个数,使这两个数的gcd为确定值,统计符合条件的数的对数。(认为(a,b)和(b,a)是同一对) 1 #include 2 #include 3 #include ... 阅读全文
posted @ 2015-08-19 10:37 Kirai 阅读(190) 评论(0) 推荐(0) 编辑
摘要: 本题数字本身是素数,并且各数位和也是素数,这样的数字在某区间内的个数。 先素数筛,再筛出各数位和是奇数的数,接着统计1-a的时候所有符合条件的数字的个数,求特定区间符合条件的数字做差即可。 代码如下: 1 #include 2 #include 3 #include 4 #includ... 阅读全文
posted @ 2015-08-18 22:03 Kirai 阅读(269) 评论(0) 推荐(0) 编辑
摘要: 置换群,求出循环节长度即可。 1 #include 2 #include 3 #include 4 5 using namespace std; 6 7 const int maxn = 1111; 8 int n; 9 int p[maxn];10 bool vis[maxn];11 1... 阅读全文
posted @ 2015-08-18 21:20 Kirai 阅读(149) 评论(0) 推荐(0) 编辑