hdu 5643 BestCoder Round #75】的更多相关文章

King's Game  Accepts: 249  Submissions: 671  Time Limit: 2000/1000 MS (Java/Others)  Memory Limit: 65536/65536 K (Java/Others) 问题描述 为了铭记历史,国王准备在阅兵的间隙玩约瑟夫游戏.它召来了 n(1\le n\le 5000)n(1≤n≤5000) 个士兵,逆时针围成一个圈,依次标号 1, 2, 3 ... n1,2,3...n. 第一轮第一个人从 11 开始报数,报…
King's Phone  Accepts: 310  Submissions: 2980  Time Limit: 2000/1000 MS (Java/Others)  Memory Limit: 65536/65536 K (Java/Others) 问题描述 阅兵式上,国王见到了很多新奇东西,包括一台安卓手机.他很快对手机的图形解锁产生了兴趣. 解锁界面是一个 3 \times 33×3 的正方形点阵,第一行的三个点标号 1, 2, 31,2,3,第二行的三个点标号 4, 5, 64,5…
Problem Description It is the king's birthday before the military parade . The ministers prepared a rectangle cake of size n×m(1≤n,m≤10000) . The king plans to cut the cake himself. But he has a strange habit of cutting cakes. Each time, he will cut…
Sequence  Accepts: 59  Submissions: 650  Time Limit: 2000/1000 MS (Java/Others)  Memory Limit: 65536/65536 K (Java/Others) Problem Description \ \ \ \    Holion August will eat every thing he has found. \ \ \ \    Now there are many foods,but he does…
King's Cake Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 736    Accepted Submission(s): 539 Problem Description It is the king's birthday before the military parade . The ministers prepared a…
zxa and leaf Problem Description zxa have an unrooted tree with n nodes, including (n−1) undirected edges, whose nodes are numbered from 1 to n. The degree of each node is defined as the number of the edges connected to it, and each node whose degree…
题目链接 : http://bestcoder.hdu.edu.cn/contests/contest_chineseproblem.php?cid=641&pid=1003 题意 : 给N集合, 每个集合由若干个正整数组成, 要求划分为L个部分, 使得每个部分的所有集合的交集非空 能划分输出YES, 否则NO 思路 : 一共N个集合, 划分的个数为1 - N个, 所以当 L > N 时必然是不行的 考虑如何取到最小的划分个数cnt, 如果 cnt <= L 则可行 方法 : 记录所有…
题目链接 : http://bestcoder.hdu.edu.cn/contests/contest_chineseproblem.php?cid=641&pid=1002 思路 : N有若干个质因子, N = a^b * c^d * e^f...... M也有若干个质因子, M = a^(b+k) * c(d+k1) * e^(f+k2)...... N能到达M的条件是它们的质因子必须完全相同 N每次可以乘上它的若干个质因子, 直到这个质因子的幂次等于M这个质因子的幂次 考虑这样一个事实,…
  题目链接 : http://bestcoder.hdu.edu.cn/contests/contest_chineseproblem.php?cid=637&pid=1002 思路 : 考虑这个序列当前的第i个数能有几种组合方法, 前面有2^(i-1)种, 后面有有2^(n-i)种, 本来答案是a[i] * 2^(n-1), 但要求对于某种排列存在相邻且相等的数是不计入答案的 例如 第二组样例 1 2 1 3,   1 1 3中1重复故要减去一个1 可见, 只有前一个数和a[i]相等时, a…
1001:King's Cake(数论) http://acm.hdu.edu.cn/showproblem.php?pid=5640 这题有点辗转相除的意思.基本没有什么坑点. 代码: #include <iostream> #include <cstdio> #include <cstdlib> #include <cmath> #include <cstring> #include <algorithm> #include &l…