随笔分类 - ACM—水题
摘要:描述烧饼有两面,要做好一个兰州烧饼,要两面都弄热。当然,一次只能弄一个的话,效率就太低了。有这么一个大平底锅,一次可以同时放入k个兰州烧饼,一分钟能做好一面。而现在有n个兰州烧饼,至少需要多少分钟才能全部做好呢?输入依次输入n和k,中间以空格分隔,其中1 2 int main() 3 { 4 ...
阅读全文
摘要:描述现在给你一个由小写字母组成字符串,要你找出字符串中出现次数最多的字母,如果出现次数最多字母有多个那么输出最小的那个。输入第一行输入一个正整数T(0 2 #include 3 #include 4 using namespace std; 5 int main() 6 { 7 int n;...
阅读全文
摘要:取石子描述Yougth和Hrdv玩一个游戏,拿出n个石子摆成一圈,Yougth和Hrdv分别从其中取石子,谁先取完者胜,每次可以从中取一个或者相邻两个,Hrdv先取,输出胜利着的名字。输入输入包括多组测试数据。每组测试数据一个n,数据保证int范围内。输出输出胜利者的名字。样例输入23样例输出Hrd...
阅读全文
摘要:Problem Description输入一行数字,如果我们把这行数字中的‘5’都看成空格,那么就得到一行用空格分割的若干非负整数(可能有些整数以‘0’开头,这些头部的‘0’应该被忽略掉,除非这个整数就是由若干个‘0’组成的,这时这个整数就是0)。你的任务是:对这些分割得到的整数,依从小到大的顺序排...
阅读全文
摘要:Shaking hands问题描述今天是Gorwin的生日,所以她举办了一个派对并邀请她的朋友来参加。她将邀请n个朋友,为了方便,Gorwin把他们从1到n标号。他们之中有一些人已经相互认识,有一些人不认识对方。相互认识的朋友见面之后会握手然后喝一杯香槟。Gorwin想要知道要准备多少杯香槟。你能帮...
阅读全文
摘要:放盘子小度熊喜欢恶作剧。今天他向来访者们提出一个恶俗的游戏。他和来访者们轮流往一个正多边形内放盘子。最后放盘子的是获胜者,会赢得失败者的一个吻。玩了两次以后,小度熊发现来访者们都知道游戏的必胜策略。现在小度熊永远是先手,他想知道他是否能获胜。注意盘子不能相交也不能和多边形相交也不能放在多边形外。就是...
阅读全文
摘要:大搬家近期B厂组织了一次大搬家,所有人都要按照指示换到指定的座位上。指示的内容是坐在位置i上的人要搬到位置j上。现在B厂有N个人,一对一到N个位置上。搬家之后也是一一对应的,改变的只有位次。在第一次搬家后,度度熊由于疏忽,又要求大家按照原指示进行了一次搬家。于是,机智的它想到:再按这个指示搬一次家不...
阅读全文
摘要:IP聚合点击这里Problem Description当今世界,网络已经无处不在了,小度熊由于犯了错误,当上了度度公司的网络管理员,他手上有大量的 IP列表,小度熊想知道在某个固定的子网掩码下,有多少个网络地址。网络地址等于子网掩码与 IP 地址按位进行与运算后的结果,例如:子网掩码:A.B.C.D...
阅读全文
摘要:Problem DescriptionGiven a string containing only 'A' - 'Z', we could encode it using the following method: 1. Each sub-string containing k same chara...
阅读全文
摘要:Problem DescriptionA number of students sit in a circle facing their teacher in the center. Each student initially has an even number of pieces of can...
阅读全文
摘要:We all know that Bin-Laden is a notorious terrorist, and he has disappeared for a long time. But recently, it is reported that he hides in Hang Zhou o...
阅读全文
摘要:Problem DescriptionThe digital root of a positive integer is found by summing the digits of the integer. If the resulting value is a single digit then...
阅读全文
摘要:Problem DescriptionA number whose only prime factors are 2,3,5 or 7 is called a humble number. The sequence 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 15,...
阅读全文
摘要:Problem DescriptionFatMouse prepared M pounds of cat food, ready to trade with the cats guarding the warehouse containing his favorite food, JavaBean....
阅读全文
摘要:Problem DescriptionThe highest building in our city has only one elevator. A request list is made up with N positive numbers. The numbers denote at wh...
阅读全文
摘要:Problem DescriptionA number sequence is defined as follows:f(1) = 1, f(2) = 1, f(n) = (A * f(n - 1) + B * f(n - 2)) mod 7.Given A, B, and n, you are t...
阅读全文
摘要:Problem DescriptionContest time again! How excited it is to see balloons floating around. But to tell you a secret, the judges' favorite time is guess...
阅读全文
摘要:描述在一个3*2的矩形中,可以找到6个1*1的矩形,4个2*1的矩形3个1*2的矩形,2个2*2的矩形,2个3*1的矩形和1个3*2的矩形,总共18个矩形。给出A,B,计算可以从中找到多少个矩形。输入本题有多组输入数据(/*对于3*2矩形,计算为 3*(1+2) 2*(1+2) 1*(1+2),...
阅读全文
摘要:Problem DescriptionGiven a sequence a[1],a[2],a[3]......a[n], your job is to calculate the max sum of a sub-sequence. For example, given (6,-1,5,4,-7)...
阅读全文
摘要:Description蛇形针回字阵:如3*3:回字阵:765814923Input多组数据:每一行一个正整数n(n为奇数, 2 #include 3 int main() 4 { 5 int a[30][30]; 6 int n; 7 while(scanf("%d",&n)...
阅读全文

浙公网安备 33010602011771号