随笔分类 -  日常作业

摘要:描述 A number of rectangular posters, photographs and other pictures of the same shape are pasted on a wall. Their sides are all vertical or horizontal. 阅读全文
posted @ 2018-10-22 20:19 TobicYAL 阅读(328) 评论(1) 推荐(0)
摘要:描述 You are working for Macrohard company in data structures department. After failing your previous task about key insertion you were asked to write a 阅读全文
posted @ 2018-10-22 20:10 TobicYAL 阅读(290) 评论(0) 推荐(0)
摘要:题目描述 如题,已知一个数列,你需要进行下面两种操作: 1.将某区间每一个数加上x 2.求出某区间每一个数的和 输入输出格式 输入格式: 第一行包含两个整数N、M,分别表示该数列数字的个数和操作的总个数。 第二行包含N个用空格分隔的整数,其中第i个数字表示数列第i项的初始值。 接下来M行每行包含3或 阅读全文
posted @ 2018-10-16 17:06 TobicYAL 阅读(205) 评论(0) 推荐(0)
摘要:描述 The citizens of Bytetown, AB, could not stand that the candidates in the mayoral election campaign have been placing their electoral posters at all 阅读全文
posted @ 2018-10-16 10:15 TobicYAL 阅读(264) 评论(0) 推荐(0)
摘要:描述 N (2 <= N <= 8,000) cows have unique brands in the range 1..N. In a spectacular display of poor judgment, they visited the neighborhood 'watering h 阅读全文
posted @ 2018-10-15 22:17 TobicYAL 阅读(310) 评论(0) 推荐(0)
摘要:题目内容: 老师给小学生门布置了一些作业,让它们按照一个模版写一些字符串交上来, 同学们把作业交上来了,问题来了,这么多的作业老师批改不过来,现在请你帮老师 写一个程序,帮助老师确定各个字符串是否合格。 首先老师有一个匹配模版,比如是“aa[123]bb”这一个字符串,同学们交的各种 作业字符串如a 阅读全文
posted @ 2018-10-10 22:40 TobicYAL 阅读(887) 评论(0) 推荐(0)
摘要:描述 一个数的序列bi,当b1 < b2 < ... < bS的时候,我们称这个序列是上升的。对于给定的一个序列(a1, a2, ..., aN),我们可以得到一些上升的子序列(ai1, ai2, ..., aiK),这里1 <= i1 < i2 < ... < iK <= N。比如,对于序列(1, 阅读全文
posted @ 2018-10-09 22:59 TobicYAL 阅读(843) 评论(0) 推荐(0)
摘要:描述 Suppose that the fourth generation mobile phone base stations in the Tampere area operate as follows. The area is divided into squares. The squares 阅读全文
posted @ 2018-10-08 18:11 TobicYAL 阅读(241) 评论(0) 推荐(0)
摘要:描述 There is an apple tree outside of kaka's house. Every autumn, a lot of apples will grow in the tree. Kaka likes apple very much, so he has been car 阅读全文
posted @ 2018-10-08 18:02 TobicYAL 阅读(269) 评论(0) 推荐(0)
摘要:字符串插入(10分) 字符串插入(10分) 题目内容: 有两个字符串str和substr,str和substr的字符个数不超过10^5,只包含大小写字母和数字。(字符个数不包括字符串结尾处的'\0'。)将substr插入到str中ASCII码最大的那个字符后面,若有多个最大则只考虑第一个。 输入格式 阅读全文
posted @ 2018-09-29 16:49 TobicYAL 阅读(315) 评论(0) 推荐(0)
摘要:描述 BackgroundProfessor Hopper is researching the sexual behavior of a rare species of bugs. He assumes that they feature two different genders and tha 阅读全文
posted @ 2018-09-17 16:33 TobicYAL 阅读(289) 评论(0) 推荐(0)
摘要:描述 动物王国中有三类动物A,B,C,这三类动物的食物链构成了有趣的环形。A吃B, B吃C,C吃A。现有N个动物,以1-N编号。每个动物都是A,B,C中的一种,但是我们并不知道它到底是哪一种。有人用两种说法对这N个动物所构成的食物链关系进行描述:第一种说法是"1 X Y",表示X和Y是同类。第二种说 阅读全文
posted @ 2018-09-17 16:28 TobicYAL 阅读(282) 评论(0) 推荐(0)
摘要:描述 Given three strings, you are to determine whether the third string can be formed by combining the characters in the first two strings. The first tw 阅读全文
posted @ 2018-06-30 15:11 TobicYAL 阅读(361) 评论(0) 推荐(0)
摘要:描述 Consider an arbitrary sequence of integers. One can place + or - operators between integers in the sequence, thus deriving different arithmetical e 阅读全文
posted @ 2018-06-30 15:08 TobicYAL 阅读(211) 评论(0) 推荐(0)
摘要:描述 一个圆形花圃被分为k个扇形区域(0,1,…,k-1)。有两只小鼹鼠A,B分别位于其中的两个区域。鼹鼠从一个扇形区域移动到相邻的区域需要1分钟。已知A鼹鼠总是沿顺时针方向移动(序号增大),B鼹鼠总是沿逆时针方向移动(序号减小),两只鼹鼠都是每隔一段时间钻出地面一次。请你求出两只鼹鼠第一次同时在同 阅读全文
posted @ 2018-06-30 15:03 TobicYAL 阅读(522) 评论(0) 推荐(0)
摘要:描述 A message from humans to extraterrestrial intelligence was sent through the Arecibo radio telescope in Puerto Rico on the afternoon of Saturday Nov 阅读全文
posted @ 2018-06-30 15:00 TobicYAL 阅读(309) 评论(0) 推荐(0)
摘要:描述 北大信息学院的同学小明毕业之后打算创业开餐馆.现在共有n 个地点可供选择。小明打算从中选择合适的位置开设一些餐馆。这 n 个地点排列在同一条直线上。我们用一个整数序列m1, m2, ... mn 来表示他们的相对位置。由于地段关系,开餐馆的利润会有所不同。我们用pi 表示在mi 处开餐馆的利润 阅读全文
posted @ 2018-06-30 14:55 TobicYAL 阅读(506) 评论(0) 推荐(0)
摘要:描述 BackgroundThe knight is getting bored of seeing the same black and white squares again and again and has decided to make a journeyaround the world. 阅读全文
posted @ 2018-06-30 14:52 TobicYAL 阅读(263) 评论(0) 推荐(0)
摘要:描述 You are given two pots, having the volume of A and B liters respectively. The following operations can be performed: Write a program to find the sh 阅读全文
posted @ 2018-06-27 20:15 TobicYAL 阅读(439) 评论(4) 推荐(0)
摘要:描述 动物园的规划和城市规划一样是个令人头疼的大问题。不幸的是,动物园规划师R.V.L.先生高估了小动物们的智商,他设计了一个极其复杂的动物园道路规划方案,如下图所示: 动物园按照下述方法进行扩建:当动物园规模扩大之后,R.V.L.先生设计的解决方案是把与原来动物园结构一样的区域复制或旋转90度之后 阅读全文
posted @ 2018-06-27 18:58 TobicYAL 阅读(456) 评论(0) 推荐(0)