摘要:
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 ... 阅读全文
摘要:
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... 阅读全文
摘要:
题目链接:https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=1633求一连串的幂,如果暴力算的话会溢出,题中会有一个求模,给出一个欧拉定理的应用:x^y % ... 阅读全文
摘要:
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4911InversionTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 131072/131072 K (Java/Others)Total Sub... 阅读全文
摘要:
题目链接:http://acm.hust.edu.cn/vjudge/problem/visitOriginUrl.action?id=26992DescriptionYou are given two integers:nandk, your task is to find the most si... 阅读全文
摘要:
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1568输出前四位的方法想不到,于是转载了方法:(原文地址http://jingyan.baidu.com/article/f3e34a128e48acf5ea65355b.html)题意:输出Fibona... 阅读全文
摘要:
A - Bi-shoe and Phi-shoe Crawling in process... Crawling failed Time Limit:2000MS Memory Limit:32768KB 64bit IO Format:%lld & %lluDescriptionBambo... 阅读全文
摘要:
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1695 两个区间内各取一个数,使这两个数的gcd为确定值,统计符合条件的数的对数。(认为(a,b)和(b,a)是同一对) 1 #include 2 #include 3 #include ... 阅读全文
摘要:
本题数字本身是素数,并且各数位和也是素数,这样的数字在某区间内的个数。 先素数筛,再筛出各数位和是奇数的数,接着统计1-a的时候所有符合条件的数字的个数,求特定区间符合条件的数字做差即可。 代码如下: 1 #include 2 #include 3 #include 4 #includ... 阅读全文
摘要:
置换群,求出循环节长度即可。 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... 阅读全文