hdu acmsteps 2.1.3 Cake】的更多相关文章

Cake Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 1815 Accepted Submission(s): 862 Problem Description 一次生日Party可能有p人或者q人参加,现准备有一个大蛋糕.问最少要将蛋糕切成多少块(每块大小不一定相等),才能使p人或者q人出席的任何一种情况,都能平均将蛋糕分食. Input…
HDU ACM-Steps RECORD Chapter 1 Section 1 暖手题 1.1.1 A+B for Input-Output Practice (I) #include <stdio.h> int main() { int a,b; while(scanf("%d %d",&a,&b)==2) printf("%d\n",a+b); return 0; } 1.1.2 A+B for Input-Output Pract…
Leftmost Digit Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 1982 Accepted Submission(s): 884 Problem Description Given a positive integer N, you should output the leftmost digit of N^N. Input T…
Fibonacci Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 2087 Accepted Submission(s): 999 Problem Description 2007年到来了.经过2006年一年的修炼,数学神童zouyu终于把0到100000000的Fibonacci数列 (f[0]=0,f[1]=1;f[i] = f[i-1…
pro:给定一个蛋糕,一个矩阵房子,一只蚂蚁.最开始三者两两相离,问蚂蚁触摸到蛋糕后再触摸矩阵的最短距离.结果保留两位小数,坐标的绝对值<1e4: sol:由于坐标不大,而且精度要求不高,不难想到可以暴力一点,直接分割圆. 假设分100000份,得到每个点到蚂蚁和矩阵的距离和,更新答案. (虽然我想到可能会三分这个圆,但是感觉情况蛮多的,因为可能不止一轮峰值,需要剥离三分的区间. 百度了下,情况其实不多. 因为剥离区间直接把圆分为[0,pi] [pi,2pi]即可. 因为如果有两个峰值,一定在对…
pid=4454" target="_blank" style="">题目链接:hdu 4454 Stealing a Cake 题目大意:给定一个起始点s,一个圆形.一个矩形.如今从起点開始,移动到圆形再移动到矩形.求最短距离. 解题思路:在圆周上三分就可以.即对角度[0,2*pi]三分.计算点和矩形的距离能够选点和矩形四条边的距离最短值. #include <cstdio> #include <cstring> #incl…
http://acm.hdu.edu.cn/showproblem.php?pid=2134 Problem Description Ice cream took a bronze medal in the Beijing match. Liu sir is very very happy. So he buys a cake for them. kiki is a child who likes eating, so the task of cuting cake was given to k…
King's Cake 题目连接: http://acm.hdu.edu.cn/showproblem.php?pid=5640 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…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5355 题意:给你n个尺寸大小分别为1,2,3,…,n的蛋糕,要求你分成m份,要求每份中所有蛋糕的大小之和均相同,如果有解,输出“YES”,并给出每份的蛋糕数及其尺寸大小,否则输出“NO” 例如n=5,m=3,即大小尺寸分别为1,2,3,4,5的5个蛋糕,要求分成三份,那么解可以是第一份一个蛋糕,大小为5:第二份两个蛋糕,大小为1.4:第三份两个蛋糕,大小为2.3.这样每份大小之和均为5,满足题目要求…
题目链接:http://acm.hdu.edu.cn/showproblem.php? pid=5355 题面: Cake Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others) Total Submission(s): 1632    Accepted Submission(s): 273 Special Judge Problem Description There are m…