上一页 1 ··· 4 5 6 7 8 9 10 11 12 13 下一页
摘要: 奋斗的小蜗牛时间限制:1000ms | 内存限制:65535KB难度:1描述传说中能站在金字塔顶的只有两种动物,一种是鹰,一种是蜗牛。一只小蜗牛听了这个传说后,大受鼓舞,立志要爬上金字塔。为了实现自己的梦想,蜗牛找到了老鹰,老鹰告诉它金字塔高H米,小蜗牛知道一个白天自己能向上爬10米,但由于晚上要休... 阅读全文
posted @ 2014-04-05 23:33 OpenSoucre 阅读(191) 评论(0) 推荐(0) 编辑
摘要: 16进制的简单运算时间限制:1000ms | 内存限制:65535KB难度:1描述现在给你一个16进制的加减法的表达式,要求用8进制输出表达式的结果。输入第一行输入一个正整数T(0int main(){ int t ; long long a, b ; scanf("%d",&t)... 阅读全文
posted @ 2014-04-05 22:34 OpenSoucre 阅读(185) 评论(0) 推荐(0) 编辑
摘要: 交换输出时间限制:3000ms | 内存限制:65535KB难度:1描述输入n(n#include #include using namespace std;int main(){ int n; while(cin >> n && n){ vector num(n); ... 阅读全文
posted @ 2014-04-05 22:15 OpenSoucre 阅读(217) 评论(0) 推荐(0) 编辑
摘要: DescriptionYou are given a sequence of integers, A = a1, a2, ... an. A consecutive subsequence of A (say ai, ai+1... aj) is called a "repeated sequence" if it appears more than once in A (there exists some positive k that ai+k= ai, ai+k+1= ai+1, ... aj+k= aj) and its appearances are not in 阅读全文
posted @ 2014-04-05 20:03 OpenSoucre 阅读(394) 评论(0) 推荐(0) 编辑
摘要: DescriptionGiven N arithmetic expressions, can you tell whose result is closest to 9?InputLine 1: N (1 #include #include #include #include #include #include using namespace std;int main(){ int n; cin >> n; vector res(n,0); for(int i = 0 ; i > a >> op >> b; switch(op){ case ... 阅读全文
posted @ 2014-04-05 20:02 OpenSoucre 阅读(378) 评论(2) 推荐(0) 编辑
摘要: 素数时间限制:3000ms | 内存限制:65535KB难度:1描述走进世博园某信息通信馆,参观者将获得前所未有的尖端互动体验,一场充满创想和喜悦的信息通信互动体验秀将以全新形式呈现,从观众踏入展馆的第一步起,就将与手持终端密不可分,人类未来梦想的惊喜从参观者的掌上展开。在等候区的梦想花园中,参观者... 阅读全文
posted @ 2014-04-05 17:53 OpenSoucre 阅读(530) 评论(0) 推荐(0) 编辑
摘要: 无线网络覆盖时间限制:3000ms | 内存限制:65535KB难度:3描述我们的乐乐同学对于网络可算得上是情有独钟,他有一个计划,那就是用无线网覆盖郑州大学。现在学校给了他一个机会,因此他要购买很多的无线路由。现在他正在部署某条大道的网络,而学校只允许把他的无线路由器放在路的正中间。我们默认这条大... 阅读全文
posted @ 2014-04-05 16:30 OpenSoucre 阅读(500) 评论(0) 推荐(0) 编辑
摘要: Coin Test时间限制:3000ms | 内存限制:65535KB难度:1描述As is known to all,if you throw a coin up and let it droped on the desk there are usually three results. Yes,... 阅读全文
posted @ 2014-04-05 14:56 OpenSoucre 阅读(243) 评论(0) 推荐(0) 编辑
摘要: 矩形的个数时间限制:1000ms | 内存限制:65535KB难度:1描述在一个3*2的矩形中,可以找到6个1*1的矩形,4个2*1的矩形3个1*2的矩形,2个2*2的矩形,2个3*1的矩形和1个3*2的矩形,总共18个矩形。给出A,B,计算可以从中找到多少个矩形。输入本题有多组输入数据(#incl... 阅读全文
posted @ 2014-04-05 14:27 OpenSoucre 阅读(388) 评论(0) 推荐(0) 编辑
摘要: A problem is easy时间限制:1000ms | 内存限制:65535KB难度:3描述When Teddy was a child , he was always thinking about some simple math problems ,such as “What it’s 1... 阅读全文
posted @ 2014-04-05 14:11 OpenSoucre 阅读(192) 评论(0) 推荐(0) 编辑
摘要: 字符串替换时间限制:3000ms | 内存限制:65535KB难度:2描述编写一个程序实现将字符串中的所有"you"替换成"we"输入输入包含多行数据每行数据是一个字符串,长度不超过1000数据以EOF结束输出对于输入的每一行,输出替换后的字符串样例输入you are what you do样例输出... 阅读全文
posted @ 2014-04-03 13:26 OpenSoucre 阅读(300) 评论(0) 推荐(0) 编辑
摘要: 字母统计时间限制:3000ms | 内存限制:65535KB难度:1描述现在给你一个由小写字母组成字符串,要你找出字符串中出现次数最多的字母,如果出现次数最多字母有多个那么输出最小的那个。输入第一行输入一个正整数T(0#include #include #include using namespac... 阅读全文
posted @ 2014-04-03 13:07 OpenSoucre 阅读(336) 评论(0) 推荐(0) 编辑
摘要: 分数加减法时间限制:3000ms | 内存限制:65535KB难度:2描述编写一个C程序,实现两个分数的加减法输入输入包含多行数据每行数据是一个字符串,格式是"a/boc/d"。其中a, b, c, d是一个0-9的整数。o是运算符"+"或者"-"。数据以EOF结束输入数据保证合法输出对于输入数据的... 阅读全文
posted @ 2014-04-03 00:21 OpenSoucre 阅读(348) 评论(0) 推荐(0) 编辑
摘要: cigarettes时间限制:3000ms | 内存限制:65535KB难度:2描述Tom has many cigarettes. We hypothesized that he has n cigarettes and smokes themone by one keeping all the ... 阅读全文
posted @ 2014-04-02 23:14 OpenSoucre 阅读(223) 评论(0) 推荐(0) 编辑
摘要: n-1位数时间限制:3000ms | 内存限制:65535KB难度:1描述已知w是一个大于10但不大于1000000的无符号整数,若w是n(n≥2)位的整数,则求出w的后n-1位的数。输入第一行为M,表示测试数据组数。接下来M行,每行包含一个测试数据。输出输出M行,每行为对应行的n-1位数(忽略前缀... 阅读全文
posted @ 2014-04-02 23:03 OpenSoucre 阅读(152) 评论(0) 推荐(0) 编辑
摘要: 兄弟郊游问题时间限制:3000ms | 内存限制:65535KB难度:2描述兄弟俩骑车郊游,弟弟先出发,每分钟X米,M分钟后,哥哥带一条狗出发。以每分钟Y米的速度去追弟弟,而狗则以每分钟Z米的速度向弟弟跑去,追上弟弟后又立即返回,直到哥哥追上弟弟时,狗跑了多少米?输入第一行输入一个整数N,表示测试数... 阅读全文
posted @ 2014-04-02 22:57 OpenSoucre 阅读(164) 评论(0) 推荐(0) 编辑
摘要: 精 挑 细 选时间限制:3000ms | 内存限制:65535KB难度:1描述小王是公司的仓库管理员,一天,他接到了这样一个任务:从仓库中找出一根钢管。这听起来不算什么,但是这根钢管的要求可真是让他犯难了,要求如下:1、这根钢管一定要是仓库中最长的;2、这根钢管一定要是最长的钢管中最细的;3、这根钢... 阅读全文
posted @ 2014-04-02 14:50 OpenSoucre 阅读(239) 评论(0) 推荐(0) 编辑
摘要: 国王的魔镜时间限制:3000ms | 内存限制:65535KB难度:1描述国王有一个魔镜,可以把任何接触镜面的东西变成原来的两倍——只是,因为是镜子嘛,增加的那部分是反的。比如一条项链,我们用AB来表示,不同的字母表示不同颜色的珍珠。如果把B端接触镜面的话,魔镜会把这条项链变为ABBA。如果再用一端... 阅读全文
posted @ 2014-04-02 14:29 OpenSoucre 阅读(288) 评论(0) 推荐(0) 编辑
摘要: 荷兰国旗问题时间限制:3000ms | 内存限制:65535KB难度:1描述荷兰国旗有三横条块构成,自上到下的三条块颜色依次为红、白、蓝。现有若干由红、白、蓝三种颜色的条块序列,要将它们重新排列使所有相同颜色的条块在一起。本问题要求将所有红色的条块放最左边、所有白色的条块放中间、所有蓝色的条块放最右... 阅读全文
posted @ 2014-04-01 21:21 OpenSoucre 阅读(464) 评论(0) 推荐(0) 编辑
摘要: 谁获得了最高奖学金时间限制:1000ms | 内存限制:65535KB难度:2描述某校的惯例是在每学期的期末考试之后发放奖学金。发放的奖学金共有五种,获取的条件各自不同: 1) 院士奖学金,每人8000元,期末平均成绩高于80分(>80),并且在本学期内发表1篇或1篇以上论文的学生均可获得; 2... 阅读全文
posted @ 2014-04-01 09:09 OpenSoucre 阅读(391) 评论(0) 推荐(0) 编辑
摘要: 过河问题时间限制:1000ms | 内存限制:65535KB难度:5描述在漆黑的夜里,N位旅行者来到了一座狭窄而且没有护栏的桥边。如果不借助手电筒的话,大家是无论如何也不敢过桥去的。不幸的是,N个人一共只带了一只手电筒,而桥窄得只够让两个人同时过。如果各自单独过桥的话,N人所需要的时间已知;而如果两... 阅读全文
posted @ 2014-04-01 00:23 OpenSoucre 阅读(1176) 评论(0) 推荐(0) 编辑
摘要: 笨小熊时间限制:2000ms | 内存限制:65535KB难度:2描述笨小熊的词汇量很小,所以每次做英语选择题的时候都很头疼。但是他找到了一种方法,经试验证明,用这种方法去选择选项的时候选对的几率非常大!这种方法的具体描述如下:假设maxn是单词中出现次数最多的字母的出现次数,minn是单词中出现次... 阅读全文
posted @ 2014-04-01 00:19 OpenSoucre 阅读(298) 评论(0) 推荐(0) 编辑
摘要: 另一种阶乘问题时间限制:3000ms | 内存限制:65535KB难度:1描述大家都知道阶乘这个概念,举个简单的例子:5!=1*2*3*4*5.现在我们引入一种新的阶乘概念,将原来的每个数相乘变为i不大于n的所有奇数相乘例如:5!!=1*3*5.现在明白现在这种阶乘的意思了吧!现在你的任务是求出1!... 阅读全文
posted @ 2014-03-31 23:39 OpenSoucre 阅读(179) 评论(0) 推荐(0) 编辑
摘要: 6174问题时间限制:1000ms | 内存限制:65535KB难度:2描述假设你有一个各位数字互不相同的四位数,把所有的数字从大到小排序后得到a,从小到大后得到b,然后用a-b替换原来这个数,并且继续操作。例如,从1234出发,依次可以得到4321-1234=3087、8730-378=8352、... 阅读全文
posted @ 2014-03-31 23:24 OpenSoucre 阅读(319) 评论(0) 推荐(0) 编辑
摘要: 蛇形填数时间限制:3000ms | 内存限制:65535KB难度:3描述在n*n方陈里填入1,2,...,n*n,要求填成蛇形。例如n=4时方陈为:10 11 12 19 16 13 28 15 14 37 6 5 4输入直接输入方陈的维数,即n的值。(n#include #include usin... 阅读全文
posted @ 2014-03-31 16:16 OpenSoucre 阅读(243) 评论(0) 推荐(0) 编辑
摘要: Given an array of integers, every element appearstwiceexcept for one. Find that single one.Note:Your algorithm should have a linear runtime complexity... 阅读全文
posted @ 2014-03-31 09:42 OpenSoucre 阅读(111) 评论(0) 推荐(0) 编辑
摘要: Given an array withnobjects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red, wh... 阅读全文
posted @ 2014-03-28 15:29 OpenSoucre 阅读(169) 评论(0) 推荐(0) 编辑
摘要: Given a non-negative number represented as an array of digits, plus one to the number.The digits are stored such that the most significant digit is at... 阅读全文
posted @ 2014-03-28 14:31 OpenSoucre 阅读(128) 评论(0) 推荐(0) 编辑
摘要: Given a linked list, swap every two adjacent nodes and return its head.For example,Given1->2->3->4, you should return the list as2->1->4->3.Your algor... 阅读全文
posted @ 2014-03-28 14:15 OpenSoucre 阅读(148) 评论(0) 推荐(0) 编辑
摘要: Given a linked list, remove thenthnode from the end of list and return its head.For example, Given linked list: 1->2->3->4->5, and n = 2. After re... 阅读全文
posted @ 2014-03-27 23:48 OpenSoucre 阅读(113) 评论(0) 推荐(0) 编辑
摘要: Given a sorted array, remove the duplicates in place such that each element appear onlyonceand return the new length.Do not allocate extra space for a... 阅读全文
posted @ 2014-03-27 18:36 OpenSoucre 阅读(115) 评论(0) 推荐(0) 编辑
摘要: Given an array and a value, remove all instances of that value in place and return the new length.The order of elements can be changed. It doesn't mat... 阅读全文
posted @ 2014-03-27 18:10 OpenSoucre 阅读(180) 评论(0) 推荐(0) 编辑
摘要: Givennnon-negative integersa1,a2, ...,an, where each represents a point at coordinate (i,ai).nvertical lines are drawn such that the two endpoints of ... 阅读全文
posted @ 2014-03-27 17:20 OpenSoucre 阅读(145) 评论(0) 推荐(0) 编辑
摘要: Implementatoito convert a string to an integer.Hint:Carefully consider all possible input cases. If you want a challenge, please do not see below and ... 阅读全文
posted @ 2014-03-27 15:44 OpenSoucre 阅读(225) 评论(0) 推荐(0) 编辑
摘要: Determine whether an integer is a palindrome. Do this without extra space.题意是判断整数是不是回文串,第一个想法是将整数转换为字符串,但题目要求不能用额外的空间第二个想法是将数字反过来,比较两个数字是不是相等,但将两个数字反过... 阅读全文
posted @ 2014-03-27 14:04 OpenSoucre 阅读(126) 评论(0) 推荐(0) 编辑
摘要: Given a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999.罗马数字共有7个,即I(1)、V(5)、X(10)、L(50)、C(100)、D(500... 阅读全文
posted @ 2014-03-27 11:47 OpenSoucre 阅读(210) 评论(0) 推荐(0) 编辑
摘要: The string"PAYPALISHIRING"is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font fo... 阅读全文
posted @ 2014-03-27 11:01 OpenSoucre 阅读(180) 评论(0) 推荐(0) 编辑
摘要: Reverse digits of an integer.Example1:x = 123, return 321Example2:x = -123, return -321此题主要考查几种特殊的前导0的情况,还有单独为0的情况注意利用c++中的reverse时要加命名空间,不然该函数会递归调用自己... 阅读全文
posted @ 2014-03-26 18:16 OpenSoucre 阅读(192) 评论(0) 推荐(0) 编辑
摘要: You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single ... 阅读全文
posted @ 2014-03-26 17:29 OpenSoucre 阅读(181) 评论(0) 推荐(0) 编辑
摘要: There are two sorted arrays A and B of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should be ... 阅读全文
posted @ 2014-03-24 21:15 OpenSoucre 阅读(205) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8 9 10 11 12 13 下一页