05 2018 档案
摘要:Problem description Alyona's mother wants to present an array of n non-negative integers to Alyona. The array should be special. Alyona is a capriciou
阅读全文
摘要:Problem description After the lessons n groups of schoolchildren went outside and decided to visit Polycarpus to celebrate his birthday. We know that
阅读全文
摘要:Problem description Linear Kingdom has exactly one tram line. It has n stops, numbered from 1 to n in the order of tram's movement. At the i-th stop a
阅读全文
摘要:Problem description Year 2118. Androids are in mass production for decades now, and they do all the work for humans. But androids have to go to school
阅读全文
摘要:Problem description Crazy Town is a plane on which there are n infinite line roads. Each road is defined by the equation aix + biy + ci = 0, where ai
阅读全文
摘要:Problem description There are n stones on the table in a row, each of them can be red, green or blue. Count the minimum number of stones to take from
阅读全文
摘要:Problem description Xenia the beginner mathematician is a third year student at elementary school. She is now learning the addition operation. The tea
阅读全文
摘要:Problem description Little Petya loves presents. His mum bought him two strings of the same size for his birthday. The strings consist of uppercase an
阅读全文
摘要:Problem description As you may know, MemSQL has American offices in both San Francisco and Seattle. Being a manager in the company, you travel a lot b
阅读全文
摘要:Problem description Programmer Rostislav got seriously interested in the Link/Cut Tree data structure, which is based on Splay trees. Specifically, he
阅读全文
摘要:Problem description Consider the infinite sequence of integers: 1, 1, 2, 1, 2, 3, 1, 2, 3, 4, 1, 2, 3, 4, 5.... The sequence is built in the following
阅读全文
摘要:Problem description One day three best friends Petya, Vasya and Tonya decided to form a team and take part in programming contests. Participants are u
阅读全文
摘要:Problem description The classic programming language of Bitland is Bit++. This language is so peculiar and complicated. The language is that peculiar
阅读全文
摘要:Problem description Petya loves football very much. One day, as he was watching a football match, he was writing the players' current positions on a p
阅读全文
摘要:Problem description We often go to supermarkets to buy some fruits or vegetables, and on the tag there prints the price for a kilo. But in some superm
阅读全文
摘要:Problem description Eleven wants to choose a new name for herself. As a bunch of geeks, her friends suggested an algorithm to choose a name for her. E
阅读全文
摘要:Problem description Fafa owns a company that works on huge projects. There are n employees in Fafa's company. Whenever the company has a new project t
阅读全文
摘要:Problem description Luba thinks about watering her garden. The garden can be represented as a segment of length k. Luba has got n buckets, the i-th bu
阅读全文
摘要:Problem description We consider a positive integer perfect, if and only if the sum of its digits is exactly 10. Given a positive integer k, your task
阅读全文
摘要:Problem description Little girl Tanya is learning how to decrease a number by one, but she does it wrong with a number consisting of two or more digit
阅读全文
摘要:Problem description The following problem is well-known: given integers n and m, calculate 2n mod m, where 2n = 2·2·...·2 (n factors), and x mod y den
阅读全文
摘要:Problem description You are given a rectangular board of M × N squares. Also you are given an unlimited number of standard domino pieces of 2 × 1 squa
阅读全文
摘要:Problem description Petya started to attend programming lessons. On the first lesson his task was to write a simple program. The program was supposed
阅读全文
摘要:Problem description "Contestant who earns a score equal to or greater than the k-th place finisher's score will advance to the next round, as long as
阅读全文
摘要:Problem Description Tang and Jiang are good friends. To decide whose treat it is for dinner, they are playing a game. Specifically, Tang and Jiang wil
阅读全文
摘要:1 //算法6.8 普里姆算法 2 #include 3 using namespace std; 4 5 typedef char VerTexType; 6 typedef int ArcType; 7 #define MVNum 100 8 #define MaxInt 32767 //表示极大值,即∞ ...
阅读全文
摘要:Problem Description 一年在外 父母时刻牵挂春节回家 你能做几天好孩子吗寒假里尝试做做下面的事情吧陪妈妈逛一次菜场悄悄给爸爸买个小礼物主动地 强烈地 要求洗一次碗某一天早起 给爸妈用心地做回早餐如果愿意 你还可以和爸妈说咱们玩个小游戏吧 ACM课上学的呢~下面是一个二人小游戏:桌子
阅读全文
摘要:Problem Description 任何一个大学生对菲波那契数列(Fibonacci numbers)应该都不会陌生,它是这样定义的:F(1)=1;F(2)=2;F(n)=F(n-1)+F(n-2)(n>=3);所以,1,2,3,5,8,13……就是菲波那契数列。在HDOJ上有不少相关的题目,比
阅读全文
摘要:Problem Description 大学英语四级考试就要来临了,你是不是在紧张的复习?也许紧张得连短学期的ACM都没工夫练习了,反正我知道的Kiki和Cici都是如此。当然,作为在考场浸润了十几载的当代大学生,Kiki和Cici更懂得考前的放松,所谓“张弛有道”就是这个意思。这不,Kiki和Ci
阅读全文
摘要:Problem Description 有两堆石子,数量任意,可以不同。游戏开始由两个人轮流取石子。游戏规定,每次有两种不同的取法,一是可以在任意的一堆中取走任意多的石子;二是可以在两堆中同时取走相同数量的石子。最后把石子全部取完者为胜者。现在给出初始的两堆石子的数目,如果轮到你先取,假设双方都采取
阅读全文
摘要:Problem Description 1堆石子有n个,两人轮流取.先取者第1次可以取任意多个,但不能全部取完.以后每次取的石子数不能超过上次取子数的2倍。取完者胜.先取者负输出"Second win".先取者胜输出"First win". Input 输入有多组.每组第1行是2<=n<2^31.
阅读全文
摘要:Problem Description 虽然不想,但是现实总归是现实,Lele始终没有逃过退学的命运,因为他没有拿到奖学金。现在等待他的,就是像FarmJohn一样的农田生涯。要种田得有田才行,Lele听说街上正在举行一场别开生面的拍卖会,拍卖的物品正好就是一块20亩的田地。于是,Lele带上他的全
阅读全文
摘要:Problem Description New Year is Coming! ailyanlu is very happy today! and he is playing a chessboard game with 8600.The size of the chessboard is n*n.
阅读全文
摘要:Problem Description 十年前读大学的时候,中国每年都要从国外引进一些电影大片,其中有一部电影就叫《勇敢者的游戏》(英文名称:Zathura),一直到现在,我依然对于电影中的部分电脑特技印象深刻。今天,大家选择上机考试,就是一种勇敢(brave)的选择;这个短学期,我们讲的是博弈(g
阅读全文
摘要:Problem Description 对于四川同胞遭受的灾难,全国人民纷纷伸出援助之手,几乎每个省市都派出了大量的救援人员,这其中包括抢险救灾的武警部队,治疗和防疫的医护人员,以及进行心理疏导的心理学专家。根据要求,我校也有一个奔赴灾区救灾的名额,由于广大师生报名踊跃,学校不得不进行选拔来决定最后
阅读全文
摘要:Problem Description Dandelion's uncle is a boss of a factory. As the spring festival is coming , he wants to distribute rewards to his workers. Now he
阅读全文
摘要:描述 小Hi和小Ho所在学校的校园网被黑客入侵并投放了病毒。这事在校内BBS上立刻引起了大家的讨论,当然小Hi和小Ho也参与到了其中。从大家各自了解的情况中,小Hi和小Ho整理得到了以下的信息: 校园网主干是由N个节点(编号1..N)组成,这些节点之间有一些单向的网路连接。若存在一条网路连接(u,v
阅读全文
摘要:描述 由于今天上课的老师讲的特别无聊,小Hi和小Ho偷偷地聊了起来。 小Ho:小Hi,你这学期有选什么课么? 小Hi:挺多的,比如XXX1,XXX2还有XXX3。本来想选YYY2的,但是好像没有先选过YYY1,不能选YYY2。 小Ho:先修课程真是个麻烦的东西呢。 小Hi:没错呢。好多课程都有先修课
阅读全文
摘要:Problem Description 有N个比赛队(1<=N<=500),编号依次为1,2,3,。。。。,N进行比赛,比赛结束后,裁判委员会要将所有参赛队伍从前往后依次排名,但现在裁判委员会不能直接获得每个队的比赛成绩,只知道每场比赛的结果,即P1赢P2,用P1,P2表示,排名时P1在P2之前。现
阅读全文
摘要:Problem Description 上次Gardon的迷宫城堡小希玩了很久(见Problem B),现在她也想设计一个迷宫让Gardon来走。但是她设计迷宫的思路不一样,首先她认为所有的通道都应该是双向连通的,就是说如果有一个通道连通了房间A和B,那么既可以通过它从房间A走到房间B,也可以通过它
阅读全文
摘要:Description Given a n × n matrix A and a positive integer k, find the sum S = A + A2 + A3 + … + Ak. Given a n × n matrix A and a positive integer k, f
阅读全文
摘要:Description In the Fibonacci integer sequence, F0 = 0, F1 = 1, and Fn = Fn − 1 + Fn − 2 for n ≥ 2. For example, the first ten terms of the Fibonacci s
阅读全文
摘要:Problem Description 某省调查城镇交通状况,得到现有城镇道路统计表,表中列出了每条道路直接连通的城镇。省政府“畅通工程”的目标是使全省任何两个城镇间都可以实现交通(但不一定有直接的道路相连,只要互相间接通过道路可达即可)。问最少还需要建设多少条道路? Input 测试输入包含若干测
阅读全文
摘要:Problem Description A为一个方阵,则Tr A表示A的迹(就是主对角线上各项的和),现要求Tr(A^k)%9973。 Input 数据的第一行是一个T,表示有T组数据。每组数据的第一行有n(2 <= n <= 10)和k(2 <= k < 10^9)两个数据。接下来有n行,每行有n
阅读全文
摘要:Problem Description "Well, it seems the first problem is too easy. I will let you know how foolish you are later." feng5166 says."The second problem i
阅读全文
摘要:Problem Description: Input: 输入数据有多组,每一组第一行包含两个数字N,M(1 <= N <= 50000 , 1 <= M <= 50000) 接下来M行,每一行包含两个数, 第一个数输入1则表示铁头娃要分蛋糕,接下来一个数字K,表示所有编号取余K为0的小伙伴分到一个蛋
阅读全文
摘要:Problem Description Eddy begins to like painting pictures recently ,he is sure of himself to become a painter.Every day Eddy draws pictures in his sma
阅读全文
摘要:题目描述:There are n cities in Byteland, and the ith city has a value ai. The cost of building a bidirectional road between two cities is the sum of their
阅读全文
摘要:Problem Description: Input: 输入包含多个测试用例。 每行包含两个整数n,m(0 <n,m <= 2000)。 当n = 0和m = 0时输入终。 Input: Output: 如果kiki赢,输出kiki;如果bibi赢,输出bibi。 Output: Sample In
阅读全文
摘要:Problem Description: Input: 输入有多组数据,输入一个整数n(1 <= n <= 10^6),代表这个无聊者序列的个数。 Input: Output: 输出一个数,代表子序列的个数为多少,该数需要mod(1000000007) Output: Sample Input: 3
阅读全文
摘要:Problem Description: Input: 输入一个N,N<30 Input: Output: 对于每组数据,输出移动过程中所有会产生的系列总数 Output: Sample Input: 1 3 Sample Input: Sample Output: 3 27解题思路:这道题跟 杭电
阅读全文
摘要:Problem Description Today is Ignatius' birthday. He invites a lot of friends. Now it's dinner time. Ignatius wants to know how many tables he needs at
阅读全文
摘要:Problem Description: Input: The input includes several cases. For each case, the first line contains the number of farms, N (3 <= N <= 100). The follo
阅读全文
摘要:Problem Description: Input: 输入包含多组数据,每组输入包含一个位正整数n,表示当前密码. Input: Output: 对于每组输入,如果小X能够在极限之前(包括10秒)上厕所,则输出“ok”(不包含引号),否则输出“gg”(不包含引号) Output: Sample I
阅读全文
摘要:Problem Description 虽然草儿是个路痴(就是在杭电待了一年多,居然还会在校园里迷路的人,汗~),但是草儿仍然很喜欢旅行,因为在旅途中 会遇见很多人(白马王子,^0^),很多事,还能丰富自己的阅历,还可以看美丽的风景……草儿想去很多地方,她想要去东京铁塔看夜景,去威尼斯看电影,去阳明
阅读全文
摘要:Problem Description 省政府“畅通工程”的目标是使全省任何两个村庄间都可以实现公路交通(但不一定有直接的公路相连,只要能间接通过公路可达即可)。经过调查评估,得到的统计表中列出了有可能建设公路的若干条道路的成本。现请你编写程序,计算出全省畅通需要的最低成本。 Input 测试输入包
阅读全文
摘要:Problem Description 某省调查乡村交通状况,得到的统计表中列出了任意两村庄间的距离。省政府“畅通工程”的目标是使全省任何两个村庄间都可以实现公路交通(但不一定有直接的公路相连,只要能间接通过公路可达即可),并要求铺设的公路总长度为最小。请计算最小的公路总长度。 Input 测试输入
阅读全文
摘要:Problem Description Jimmy experiences a lot of stress at work these days, especially since his accident made working difficult. To relax after a hard
阅读全文
摘要:Problem Description 给你n个点,m条无向边,每条边都有长度d和花费p,给你起点s终点t,要求输出起点到终点的最短距离及其花费,如果最短距离有多条路线,则输出花费最少的。 Input 输入n,m,点的编号是1~n,然后是m行,每行4个数 a,b,d,p,表示a和b之间有一条边,且其
阅读全文
摘要:Why Males And Females Apart? Why Males And Females Apart? Time Limit: 2000/1000ms (Java/Others) Time Limit: 2000/1000ms (Java/Others) Problem Descript
阅读全文
摘要:lowbit lowbit Time Limit: 2000/1000ms (Java/Others) Time Limit: 2000/1000ms (Java/Others) Problem Description: long long ans = 0; for(int i = 1; i < =
阅读全文
摘要:黑色星期五 黑色星期五 Time Limit: 2000/1000ms (Java/Others) Time Limit: 2000/1000ms (Java/Others) Problem Description: 13号又是星期五是一个不寻常的日子吗?13号在星期五比在其他日少吗?为了回答这个问
阅读全文
摘要:统计字符串 统计字符串 Time Limit: 2000/1000ms (Java/Others) Time Limit: 2000/1000ms (Java/Others) Problem Description: 给定n个字符串,统计字符串的个数。 如给定 5 sss ab sss abcd a
阅读全文
摘要:求交集 求交集 Time Limit: 2000/1000ms (Java/Others) Time Limit: 2000/1000ms (Java/Others) Problem Description: 输入集合A和B,按大小顺序输出A和B的交集。 Problem Description: I
阅读全文
摘要:圆的面积 圆的面积 Time Limit: 2000/1000ms (Java/Others) Time Limit: 2000/1000ms (Java/Others) Problem Description: AB是圆O的一条直径,CD、EF是两条垂直于AB的弦,并且以CD为直径的半圆和以EF为
阅读全文
摘要:二维数组的查找 二维数组的查找 Time Limit: 2000/1000ms (Java/Others) Time Limit: 2000/1000ms (Java/Others) Problem Description: 给定一个n*m的二维数组,保证a[i][j] < a[i+1][j],a[
阅读全文
摘要:Problem Description: Problem Description: 在一个二维平面,从左到右竖立n根高度分别为:a[1],a[2],....a[n],且宽度都为1的木板。试给出平面内最大的矩阵面积。 Input: 输入包含多组测试数据,每一组数据的第一行输入正整数n(<=5000),
阅读全文
摘要:Chocolate,Chocolate Chocolate,Chocolate Time Limit: 2000/1000ms (Java/Others) Time Limit: 2000/1000ms (Java/Others) Problem Description: 都说发神喜欢吃巧克力,有一
阅读全文
摘要:招新笔试题系列——买包子 招新笔试题系列——买包子 Time Limit: 2000/1000ms (Java/Others) Time Limit: 2000/1000ms (Java/Others) Problem Description: 小华刚到大学,一天早上她替她室友买早餐,一共要N个包子
阅读全文
摘要:Problem Description Op tech briefing, 2002/11/02 06:42 CST "The item is locked in a Klein safe behind a painting in the second-floor library. Klein sa
阅读全文
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1010 Problem Description The doggie found a bone in an ancient maze, which fascinated him a lot. Howeve
阅读全文
摘要:Problem Description: 蛇形矩阵是由1开始的自然数依次排列成的一个矩阵上三角形。 Input: 本题有多组数据,每组数据由一个正整数N组成。(N不大于100) Output: 对于每一组数据,输出一个N行的蛇形矩阵。两组输出之间不要额外的空行。矩阵三角中同一行的数字用一个空格分开。
阅读全文
摘要:拼接数字 拼接数字 Time Limit: 2000/1000ms (Java/Others) Time Limit: 2000/1000ms (Java/Others) Problem Description: 给定一个正整数数组,现在把数组所有数字都拼接成一个大数字,如何使得拼接后的数字最小。
阅读全文
摘要:Scramble Sort Scramble Sort Time Limit: 2000/1000ms (Java/Others) Time Limit: 2000/1000ms (Java/Others) Problem Description: In this problem you will
阅读全文
摘要:Problem Description: Problem Description: 广财建校33年了,如今迎来了她的校庆。 小财最近想在研究素数,她突发奇想,把包含33的素数称为校庆素数。 她想知道在L和R之间(包含L和R)有多少个校庆素数,她觉得这个问题太简单了,于是想考一下你。 比如 2333
阅读全文
摘要:Problem Description: Problem Description: 斐波那契数列定义如下:f(0)=0,f(1)=1,f(n+2)=f(n+1)+f(n); 求斐波那契数列的第n项对10009取余后的结果。 Input: 多组测试,每组测试输入一个整数n(0<=n<=10^17).
阅读全文
摘要:题目内容:一个多项式可以表达为x的各次幂与系数乘积的和,比如:2x6+3x5+12x3+6x+20;现在,你的程序要读入两个多项式,然后输出这两个多项式的和,也就是把对应的幂上的系数相加然后输出。程序要处理的幂最大为100。输入格式:总共要输入两个多项式,每个多项式的输入格式如下:每行输入两个数字,
阅读全文
摘要:发工资咯: 发工资咯: Time Limit: 2000/1000ms (Java/Others) Time Limit: 2000/1000ms (Java/Others) Problem Description: 作为广财大的老师,最盼望的日子就是每月的8号了,因为这一天是发工资的日子,养家糊口
阅读全文
摘要:NNNNN NNNNN Time Limit: 2000/1000ms (Java/Others) Time Limit: 2000/1000ms (Java/Others) Problem Description: 对于整数N,求N^N的前5位和后5位(1057题加强版) Problem Desc
阅读全文
摘要:求补集的交集 求补集的交集 Time Limit: 2000/1000ms (Java/Others) Time Limit: 2000/1000ms (Java/Others) Problem Description: 给定一个集合,然后再给出两个该集合的子集,求他们对应补集的交集。 Proble
阅读全文
摘要:The Next Permutation The Next Permutation Time Limit: 2000/1000ms (Java/Others) Time Limit: 2000/1000ms (Java/Others) Problem Description: For this pr
阅读全文
摘要:走楼梯Ⅱ Time Limit: 2000/1000ms (Java/Others) Problem Description: 有一楼梯共N+1级,刚开始时你在第一级,若每次能走M级(1<=M<=N),要走上第N+1级,共有多少种走法?(不可以后退) Problem Description: Inp
阅读全文
摘要:Meetings 系列一 Problem Description: 多年之后的广财ACM编协如日中天,下系多个部门,且编协成员几近过百。这一次,为了庆祝ACM编协近年飞速的发展,各部门都决定在同一天召开会议。请注意:这次由于资源紧张,仅申请到一个报告厅。现在需要你给出安排方案,使得同一天24小时内举
阅读全文
摘要:求f(n) 求f(n) Time Limit: 2000/1000ms (Java/Others) Time Limit: 2000/1000ms (Java/Others) Problem Description: 设函数f(n)=1*1*1+2*2*2+3*3*3+...+n*n*n; 求f(n
阅读全文
摘要:四数之和 四数之和 Time Limit: 2000/1000ms (Java/Others) Time Limit: 2000/1000ms (Java/Others) Problem Description: 有n个不同的整数,判断能否从中选4次,4个数和刚好为m。数字可重复选取。 Proble
阅读全文
摘要:除了sort,你还会什么 除了sort,你还会什么 Time Limit: 1000/500ms (Java/Others) Time Limit: 1000/500ms (Java/Others) Problem Description: 给出若干人的年龄(1~100之间的整数),把它们按照从小到
阅读全文
摘要:1 import java.util.Scanner; 2 import java.math.BigInteger; 3 public class Main { 4 public static void main(String[] args) { 5 Scanner scan = new Scanner(System.in); 6 BigInt...
阅读全文
摘要:抢糖果 抢糖果 Time Limit: 2000/1000ms (Java/Others) Time Limit: 2000/1000ms (Java/Others) Problem Description: 今天计实班的生活委员心情大好,在永诚超市狂购了好多好多糖果,好开心~o(∩_∩)o 刚付完
阅读全文
摘要:Hailstone HOTPO Hailstone HOTPO Time Limit: 2000/1000ms (Java/Others) Time Limit: 2000/1000ms (Java/Others) Problem Description: The hailstone sequenc
阅读全文
摘要:背包4 背包4 Time Limit: 2000/1000ms (Java/Others) Time Limit: 2000/1000ms (Java/Others) Problem Description: 有n个重量和价值分别为Wi,Vi的物品,现从这些物品中挑选出总量不超过W的物品,求所有方案
阅读全文
摘要:背包2 背包2 Time Limit: 2000/1000ms (Java/Others) Time Limit: 2000/1000ms (Java/Others) Problem Description: 有n个重量和价值分别为Wi,Vi的物品,现从这些物品中挑选出总量刚好为 W 的物品,求所有
阅读全文
摘要:背包3 背包3 Time Limit: 2000/1000ms (Java/Others) Problem Description: 有n种(每一种有无数个)重量和价值分别为Wi,Vi的物品,现从这些物品中挑选出总量不超过W的物品,求所有方案中价值总和的最大值。 Problem Descriptio
阅读全文
摘要:寒冰王座 寒冰王座 Time Limit: 2000/1000ms (Java/Others) Time Limit: 2000/1000ms (Java/Others) Problem Description: 不死族的巫妖王发工资拉,死亡骑士拿到一张N元的钞票(记住,只有一张钞票),为了防止自己
阅读全文
摘要:闹钟人生 闹钟人生 Time Limit: 2000/1000ms (Java/Others) Time Limit: 2000/1000ms (Java/Others) Problem Description: 已知一个时钟一开始指向0点,顺时针走了n个小时,求它最终所指向的数字(时间按12进制计
阅读全文
摘要:Problem Description: Problem Description: 一心想搞ACM的小G最近迷上了数论,特别对于跟“素数”相关的问题特别有感觉。今天,突发奇想的他给自己出了个难题,随便给出一个int32位范围内的正整数,能否知道它相邻的素数呢? Input: 输入数据有多组,每组包含
阅读全文
摘要:Uppercase Uppercase Time Limit: 2000/1000ms (Java/Others) Time Limit: 2000/1000ms (Java/Others) Problem Description: 给出一句中间无特殊符号的英语句子,要求将各单词的首字母改大写。 P
阅读全文
摘要:背包1 背包1 Time Limit: 2000/1000ms (Java/Others) Problem Description: 有n个重量和价值分别为Wi,Vi的物品,现从这些物品中挑选出总量不超过 W 的物品,求所有方案中价值总和的最大值。 Problem Description: Inpu
阅读全文
摘要:题目描述 喜爱ACM的PBY同学遇到了一道数学难题,已知底数n,请你帮他准确的计算出结果a = nπ(n的π次方),结果保留小数点后x位。 输入描述: 第一行是一个整数t,表示测试实例的个数; 然后是t行输入数据,每行包含两个正整数n和x,表示底数和保留位数。 (1 <= t <= 100,1 <=
阅读全文
摘要:Problem Description: 在N*N的方格棋盘放置了N个皇后,使得它们不相互攻击(即任意2个皇后不允许处在同一排,同一列,也不允许处在与棋盘边框成45角的斜线上。 你的任务是,对于给定的N,求出有多少种合法的放置方法。 Input: 共有若干行,每行一个正整数N≤12,表示棋盘和皇后的
阅读全文
摘要:Problem Description: 有n根棍子,棍子i的长度为ai,想要从中选出3根棍子组成周长尽可能长的三角形。请输出最大的周长,若无法组成三角形则输出0。 Input: 输入包含多组测试,每组测试第一行输入一个整数n(3≤n≤10^5);第二行输入n个整数ai(1≤ai≤10^6); Ou
阅读全文
摘要:题目描述 给出共享长方体一个顶点的三个面的面积,求它十二条边的边长和。 输入描述: 一行三个整数a, b, c表示面积(1 <= a, b, c <= 10000)。 输出描述: 一行一个整数表示边长和。 <!-- <br/> <h5 style="font-size:14px;font-weigh
阅读全文
摘要:输出格式 输出格式 Time Limit: 2000/1000ms (Java/Others) Time Limit: 2000/1000ms (Java/Others) Problem Description: 某水比参加了XX杯,但是他太水,所以三等都木有,所以他决定出一道水题水一水。 Prob
阅读全文
摘要:Problem Description: Problem Description: 一个简单的问题,大家应该有不少做过大数加法题吧。这个题的数据也是64位整数放不下的,给定一个数,判断该数是否能整除18. Input: 输入包含多组测试数据,对于每组数据,输入一个整数(位数小于100,没有前导零).
阅读全文
摘要:括号匹配(栈) 括号匹配(栈) Time Limit: 2000/1000ms (Java/Others) Time Limit: 2000/1000ms (Java/Others) Problem Description: 给一组包含[]()两种括号的序列,检查是否是合法的。 如:()[],([]
阅读全文
摘要:Problem Description: Problem Description: 锴神:我尊重作者原意,你们出什么我就加什么。于是小光打了道水题(也就是这道),但是呢比赛的时候拿着自己的标程却AC不了,最后只能尴尬地打表!!为毛呢?!请你来看看这道题,为了缓解小光的尴尬,他决定不告诉你样例输入输出
阅读全文
摘要:Problem Description: 有排成一行的n个方格,用红(Red)、粉(Pink)、绿(Green)三色涂每个格子,每格涂一色,要求任何相邻的方格不能同色,且首尾两格也不同色.求全部的满足要求的涂法. Input: 输入数据包含多个测试实例,每个测试实例占一行,由一个整数N组成,(0<n
阅读全文
摘要:Problem Description: 国庆期间,省城HZ刚刚举行了一场盛大的集体婚礼,为了使婚礼进行的丰富一些,司仪临时想出了有一个有意思的节目,叫做"考新郎",具体的操作是这样的: 首先,给每位新娘打扮得几乎一模一样,并盖上大大的红盖头随机坐成一排; 然后,让各位新郎寻找自己的新娘.每人只准找
阅读全文
摘要:Problem Description: 把M个同样的苹果放在N个同样的盘子里,允许有的盘子空着不放,问共有多少种不同的分法?(用K表示)5,1,1和1,5,1 是同一种分法。 Input: 第一行是测试数据的数目t(0 <= t <= 20)。以下每行均包含二个整数M和N,以空格分开。1<=M,N
阅读全文
摘要:Problem Description: 今年暑假GOJ集训队第一次组成女生队,其中有一队叫RPG,但做为集训队成员之一的野骆驼竟然不知道RPG三个人具体是谁谁。RPG给他机会让他猜猜,第一次猜:R是公主,P是草儿,G是月野兔;第二次猜:R是草儿,P是月野兔,G是公主;第三次猜:R是草儿,P是公主,
阅读全文
摘要:折线分割平面 折线分割平面 Time Limit: 2000/1000ms (Java/Others) Time Limit: 2000/1000ms (Java/Others) Problem Description: 我们看到过很多直线分割平面的题目,今天的这个题目稍微有些变化,我们要求的是n条
阅读全文
摘要:Problem Description: Problem Description: 131号是一个主回文,因为它是一个素数和一个回文(当向后读时,它是相同的数字)。编写一个程序, 计算两个提供的数字a和b (5 <= a <b <= 10 ^ 8)范围内的主回文数; a和b都被认为在范围内。 例如,
阅读全文
摘要:100块钱都不给我 100块钱都不给我 Time Limit: 2000/1000ms (Java/Others) Time Limit: 2000/1000ms (Java/Others) Problem Description: 今天是广财的ACM周赛,小光来到广财实验楼,想来蹭一下素拓分(其实
阅读全文
摘要:查找ACM(加强版) 查找ACM(加强版) Time Limit: 2000/1000ms (Java/Others) Time Limit: 2000/1000ms (Java/Others) Problem Description: 作为一个acmer,应该具备团队合作能力和分析问题能力。给你一
阅读全文

浙公网安备 33010602011771号