自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(31)
  • 收藏
  • 关注

原创 E 使徒袭来

E 使徒袭来题目描述神秘的使徒袭击了第三新东京市,少男少女们驾驶着决战兵器EVA守护着人类的和平。牛可乐是NERV特务机关的指挥官,他必须时刻了解牛牛/牛妹/牛能三人的战斗状态。现在牛可乐获得了这三位EVA驾驶员的战斗力之积,在保证三位驾驶员战斗力均为正实数的情况下,请你帮助牛可乐计算这三位驾驶员的战斗力之和最低是多少?输入描述:一个正整数n,表示三位驾驶员的战斗力之积,n≤10 ^ 9。输出描述:输出三位驾驶员最低的战斗力之和,保留3位小数。示例1输入1输出3.000

2020-08-24 17:33:56 935

原创 B - Game of Robots这道题

In late autumn evening n robots gathered in the cheerful company of friends. Each robot has a unique identifier — an integer from 1 to 109.At some moment, robots decided to play the game “Snowball”. Below there are the rules of this game. First, all robo.

2020-05-20 14:48:28 222

原创 D - How Many Tables这道题

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 least. You have to notice that not all the friends know each other, and all the friends do not want to stay with strangers..

2020-05-17 20:42:02 139

原创 E - 二叉树先序遍历

输入一个整数n(n <= 100000),表示二叉树中结点个数,编号为1~n。约定1号结点为二叉树的根节点。然后输入n行,每行包括两个整数,第i行表示编号为i的结点的左子节点和右子节点的编号。如果某个结点没有左子节点,那么对应输行的第一个整数为0;如果某个结点没有右子节点,那么对应行的第二个整数为0。先序遍历输出此二叉树每个结点的编号,每行输出一个编号。先序遍历(DLR),是二叉树遍历的一种,也叫做先根遍历、前序遍历、前序周游,可记做根左右。前序遍历首先访问根结点然后遍历左子树,最后遍历右子树。.

2020-05-17 15:46:20 1266

原创 T - Convex

We have a special convex that all points have the same distance to origin point.As you know we can get N segments after linking the origin point and the points on the convex. We can also get N angle...

2020-02-15 19:10:03 121

原创 W - Pagodas

W - Pagodasn pagodas were standing erect in Hong Jue Si between the Niushou Mountain and the Yuntai Mountain, labelled from 1 to n. However, only two of them (labelled a and b, where 1≤a≠b≤n) withst...

2020-02-01 15:12:01 202

原创 B - Little Boxes

B - Little BoxesLittle boxes on the hillside.Little boxes made of ticky-tacky.Little boxes.Little boxes.Little boxes all the same.There are a green boxes, and b pink boxes.And c blue boxes and...

2020-01-09 13:37:25 178

原创 J -- Worker

Avin meets a rich customer today. He will earn 1 million dollars if he can solve a hard problem. There are n warehouses and m workers. Any worker in the i-th warehouse can handle ai orders per day. Th...

2019-11-18 19:18:47 442 1

原创 2019江西省赛F - String

Avin has a string. He would like to uniform-randomly select four characters (selecting the same character is allowed) from it. You are asked to calculate the probability of the four characters being ”...

2019-11-13 18:25:04 311

原创 B. Table Tennis

n people are standing in a line to play table tennis. At first, the first two players in the line play a game. Then the loser goes to the end of the line, and the winner plays with the next person fro...

2019-11-06 14:48:31 179

原创 A -- Til the Cows Come Home

大奶牛很热爱加班,他和朋友在凌晨一点吃完海底捞后又一个人回公司加班,为了多加班他希望可以找最短的距离回到公司。深圳市里有N个(2 <= N <= 1000)个公交站,编号分别为1…N。深圳是大城市,公交车整天跑跑跑。公交站1是大奶牛的位置,公司所在的位置是N。所有公交站中共有T (1 <= T <= 2000)条双向通道。大奶牛对自己的导航能力不太自信,所以一旦开始,他总...

2019-10-24 13:40:04 223

原创 B - Remainder

You are given a huge decimal number consisting of n digits. It is guaranteed that this number has no leading zeros. Each digit of this number is either 0 or 1.You may perform several (possibly zero) ...

2019-10-09 17:06:25 167

原创 C -- Vitaly and Strings

Vitaly is a diligent student who never missed a lesson in his five years of studying in the university. He always does his homework on time and passes his exams in time.During the last lesson the tea...

2019-09-28 14:13:54 134

原创 B - Dungeon Master

Description - 题目描述[NWUACM]你被困在一个三维的空间中,现在要寻找最短路径逃生!空间由立方体单位构成你每次向上下前后左右移动一个单位需要一分钟你不能对角线移动并且四周封闭是否存在逃出生天的可能性?如果存在,则需要多少时间?Input - 输入  输入第一行是一个数表示空间的数量。  每个空间的描述的第一行为L,R和C(皆不超过30)。  L表示空间的高度。...

2019-09-12 16:05:35 169

原创 A - 棋盘问题

在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求解对于给定形状和大小的棋盘,摆放k个棋子的所有可行的摆放方案C。Input输入含有多组测试数据。每组数据的第一行是两个正整数,n k,用一个空格隔开,表示了将在一个n*n的矩阵内描述棋盘,以及摆放棋子的数目。 n <= 8 , k <= n当为...

2019-09-11 16:28:05 271 2

原创 A - The Child and Homework

Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the chil...

2019-08-21 19:51:27 153

原创 E - Currency Exchange

我们的城市有几个货币兑换点。让我们假设每一个点都只能兑换专门的两种货币。可以有几个点,专门从事相同货币兑换。每个点都有自己的汇率,外汇汇率的A到B是B的数量你1A。同时各交换点有一些佣金,你要为你的交换操作的总和。在来源货币中总是收取佣金。 例如,如果你想换100美元到俄罗斯卢布兑换点,那里的汇率是29.75,而佣金是0.39,你会得到(100 - 0.39)×29.75=2963.3975卢布。...

2019-08-20 21:38:06 241

原创 B - 畅通工程续

某省自从实行了很多年的畅通工程计划后,终于修建了很多路。不过路多了也不好,每次要从一个城镇到另一个城镇时,都有许多种道路方案可以选择,而某些方案要比另一些方案行走的距离要短很多。这让行人很困扰。现在,已知起点和终点,请你计算出要从起点到终点,最短需要行走多少距离。Input本题目包含多组数据,请处理到文件结束。每组数据第一行包含两个正整数N和M(0<N<200,0<M&l...

2019-08-19 19:21:07 185

原创 A - 最短路

在每年的校赛里,所有进入决赛的同学都会获得一件很漂亮的t-shirt。但是每当我们的工作人员把上百件的衣服从商店运回到赛场的时候,却是非常累的!所以现在他们想要寻找最短的从商店到赛场的路线,你可以帮助他们吗?Input输入包括多组数据。每组数据第一行是两个整数N、M(N<=100,M<=10000),N表示成都的大街上有几个路口,标号为1的路口是商店所在地,标号为N的路口是赛场所在...

2019-08-18 21:17:11 187

原创 B - Frogger

湖中有n块石头,编号从1到n,有两只青蛙,Bob在1号石头上,Alice在2号石头上,Bob想去看望Alice,但由于水很脏,他想避免游泳,于是跳着去找她。但是Alice的石头超出了他的跳跃范围。因此,Bob使用其他石头作为中间站,通过一系列的小跳跃到达她。两块石头之间的青蛙距离被定义为两块石头之间所有可能路径上的最小必要跳跃距离,某条路径的必要跳跃距离即这条路径中单次跳跃的最远跳跃距离。你的工作...

2019-08-17 19:58:25 173

原创 E - 还是畅通工程

某省调查乡村交通状况,得到的统计表中列出了任意两村庄间的距离。省政府“畅通工程”的目标是使全省任何两个村庄间都可以实现公路交通(但不一定有直接的公路相连,只要能间接通过公路可达即可),并要求铺设的公路总长度为最小。请计算最小的公路总长度。Input测试输入包含若干测试用例。每个测试用例的第1行给出村庄数目N ( < 100 );随后的N(N-1)/2行对应村庄间的距离,每行给出一对正整数...

2019-08-15 21:31:17 123

原创 E - Tanya and Postcard

有个小女孩决定给他的爸爸寄明信片。她已经想好了一句话(即长度为n的字符串s),包括大写和小写英文字母。但是他不会写字,所以她决定将报纸里的字母剪下来贴到明信片上,最好能够把字符串s拼凑出来。报纸里包含字符串t,包括大写和小写英文字母。我们知道,t的长度大于或等于串s的长度。如果在s串中的某些位置上的字母能够在报纸串t中找到对应一模一样的字符,那么,她会高兴地喊“耶!”,如果在s串中的某些位置的字...

2019-08-14 20:22:58 217

原创 A - 畅通工程

某省调查城镇交通状况,得到现有城镇道路统计表,表中列出了每条道路直接连通的城镇。省政府“畅通工程”的目标是使全省任何两个城镇间都可以实现交通(但不一定有直接的道路相连,只要互相间接通过道路可达即可)。问最少还需要建设多少条道路?Input测试输入包含若干测试用例。每个测试用例的第1行给出两个正整数,分别是城镇数目N ( < 1000 )和道路数目M;随后的M行对应M条道路,每行给出一对正...

2019-08-13 21:35:29 239

原创 D - Wasted Time

Mr. Scrooge, a very busy man, decided to count the time he wastes on all sorts of useless stuff to evaluate the lost profit. He has already counted the time he wastes sleeping and eating. And now Mr. ...

2019-08-12 22:10:25 119

原创 D - Game Outcome

Sherlock Holmes and Dr. Watson played some game on a checkered board n × n in size. During the game they put numbers on the board’s squares by some tricky rules we don’t know. However, the game is now...

2019-08-11 22:32:27 145

原创 A - 深搜

有一个长方形的房间,覆盖了正方形的磁砖。每块磁砖的颜色,要么是红色,要么是黑色。一名男子站在一块黑色的磁砖上。他可以从一块磁砖移至相邻四块磁砖中的某一块。但是,他不允许在红色磁砖上移动,他只允许在黑色磁砖上移动。编写一个程序,使得他允许重复上述的移动,判断他所能到达的黑色磁砖的数量。输入输入由多个数据集组成。数据集的起始行包含了两个正整数 W 和 H;W 和 H 分别是 x- 和 y- 方向...

2019-08-10 21:22:28 94

原创 E - Fence

There is a fence in front of Polycarpus’s home. The fence consists of n planks of the same width which go one after another from left to right. The height of the i-th plank is hi meters, distinct plan...

2019-08-09 21:55:42 448

原创 C - Catch That Cow

C - Catch That Cow农夫知道一头牛的位置,想要抓住它。农夫和牛都于数轴上 ,农夫起始位于点 N(0<=N<=100000) ,牛位于点 K(0<=K<=100000) 。农夫有两种移动方式: 1、从 X移动到 X-1或X+1 ,每次移动花费一分钟 2、从 X移动到 2X ,每次移动花费一分钟 假设牛没有意识到农夫的行动,站在原地不动。最少要花多少时间才能抓...

2019-08-08 21:13:28 532

原创 B - Valuable Resources

B - Valuable ResourcesMany computer strategy games require building cities, recruiting army, conquering tribes, collecting resources. Sometimes it leads to interesting problems.Let’s suppose that yo...

2019-08-07 20:32:12 152

原创 A - Parity Alternated Deletions

Polycarp has an array aa consisting of nn integers.He wants to play a game with this array. The game consists of several moves. On the first move he chooses any element and deletes it (after the firs...

2019-05-26 13:27:13 227

原创 D - Registration system

A new e-mail service "Berlandesk" is going to be opened in Berland in the near future. The site administration wants to launch their project as soon as possible, that's why they ask you to help. You'r...

2019-05-22 20:05:29 237

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除