acm水题
acm入门到放弃
runnerzyc
区块链爱好者,欢迎交流 !
997151683@qq.com
展开
-
D的小L
D的小L时间限制:4000 ms | 内存限制:65535 KB难度:2描述 一天TC的匡匡找ACM的小L玩三国杀,但是这会小L忙着哩,不想和匡匡玩但又怕匡匡生气,这时小L给匡匡出了个题目想难倒匡匡(小L很D吧),有一个数n(0,,,聪明的你能帮匡匡解围吗?输入第一行输入一个数N(0输出按特定顺序输出所有组合。特定顺序:每一个组合中原创 2015-03-14 10:25:07 · 397 阅读 · 0 评论 -
找球号(一)
找球号(一)时间限制:3000 ms | 内存限制:65535 KB难度:3描述在某一国度里流行着一种游戏。游戏规则为:在一堆球中,每个球上都有一个整数编号i(0<=i<=100000000),编号可重复,现在说一个随机整数k(0<=k<=100000100),判断编号为k的球是否在这堆球中(存在为"YES",否则为"NO"),先答出者为胜。现在有一个人想玩玩这原创 2015-03-17 22:39:17 · 332 阅读 · 0 评论 -
擅长排列的小明
擅长排列的小明时间限制:1000 ms | 内存限制:65535 KB难度:4描述小明十分聪明,而且十分擅长排列计算。比如给小明一个数字5,他能立刻给出1-5按字典序的全排列,如果你想为难他,在这5个数字中选出几个数字让他继续全排列,那么你就错了,他同样的很擅长。现在需要你写一个程序来验证擅长排列的小明到底对不对。输入第一行输入整数N(1每组测试原创 2015-03-21 17:05:59 · 218 阅读 · 0 评论 -
不可以!
不可以!时间限制:1000 ms | 内存限制:65535 KB难度:1描述判断:两个数x、y的正负性。要求:不可以使用比较运算符,即"","=","==","!="。输入有多组数据,每组数据占一行,每一行两个数x,y。x、y保证在int范围内。输出每组数据输出占一行。如果两个数是一正一负,输出"Signs a原创 2015-02-24 16:30:13 · 502 阅读 · 0 评论 -
用位运算实现两个整数的加减乘除运算
原文链接:http://blog.csdn.net/luckyxiaoqiang/article/details/6886489位运算的思想可以应用到很多地方,这里简单的总结一下用位运算来实现整数的四则运算。1.整数加法[cpp] view plaincopyint Add(int a,int b) {转载 2015-03-15 10:56:39 · 448 阅读 · 0 评论 -
Humble Numbers
Humble NumbersTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 20341 Accepted Submission(s): 8869Problem DescriptionA number whose原创 2015-07-24 21:40:08 · 334 阅读 · 0 评论 -
sprintf函数与sscanf函数
sprintf()函数:sprintf() 格式化输出函数(图形)功能: 函数sprintf()用来作格式化的输出。用法: 此函数调用方式为int sprintf(char *string,char *format,arg_list);说 明: 函数sprintf()的用法和printf()函数一样,只是sprintf()函数给出第一个参数string(一般为字符数组),然后再转载 2015-02-14 11:46:11 · 459 阅读 · 0 评论 -
一种排序
一种排序时间限制:3000 ms | 内存限制:65535 KB难度:3描述现在有很多长方形,每一个长方形都有一个编号,这个编号可以重复;还知道这个长方形的宽和长,编号、长、宽都是整数;现在要求按照一下方式排序(默认排序规则都是从小到大);1.按照编号从小到大排序2.对于编号相等的长方形,按照长方形的长排序;3.如果编号和长都相同,按照长原创 2015-01-11 19:14:29 · 292 阅读 · 0 评论 -
简单计算器
Problem Description读入一个只包含 +, -, *, / 的非负整数计算表达式,计算该表达式的值。 Input测试输入包含若干测试用例,每个测试用例占一行,每行不超过200个字符,整数和运算符之间用一个空格分隔。没有非法表达式。当一行中只有0时输入结束,相应的结果不要输出。 Output对每个测试用例输出1行,即该表达式的值,精确到小数原创 2014-11-13 22:55:09 · 317 阅读 · 0 评论 -
蛇形填数
蛇形填数时间限制:3000 ms | 内存限制:65535 KB难度:3描述在n*n方陈里填入1,2,...,n*n,要求填成蛇形。例如n=4时方陈为:10 11 12 19 16 13 28 15 14 37 6 5 4输入直接输入方陈的维数,即n的值。(n输出输出结果是蛇形方陈。样例输入3样例输出7 8 1原创 2015-01-11 21:32:05 · 349 阅读 · 0 评论 -
Fibonacci Again
Problem DescriptionThere are another kind of Fibonacci numbers: F(0) = 7, F(1) = 11, F(n) = F(n-1) + F(n-2) (n>=2). InputInput consists of a sequence of lines, each containing an integer n原创 2014-09-13 09:59:24 · 240 阅读 · 0 评论 -
Encoding
Problem DescriptionGiven a string containing only 'A' - 'Z', we could encode it using the following method:1. Each sub-string containing k same characters should be encoded to "kX" where "X" i原创 2014-09-12 23:14:31 · 355 阅读 · 0 评论 -
A == B ?
Problem DescriptionGive you two numbers A and B, if A is equal to B, you should print "YES", or print "NO". Inputeach test case contains two numbers A and B. Outputfor each case, i原创 2014-11-12 21:23:00 · 322 阅读 · 0 评论 -
分数加减法
Description编写一个C程序,实现两个分数的加减法Input输入包含多行数据 每行数据是一个字符串,格式是"a/boc/d"。 其中a, b, c, d是一个0-9的整数。o是运算符"+"或者"-"。 数据以EOF结束 输入数据保证合法Output对于输入数据的每一行输出两个分数的运算结果。 注意结果应符合书写习惯,没有多余的符号原创 2014-12-18 08:00:26 · 358 阅读 · 0 评论 -
A + B Problem II
Problem DescriptionI have a very simple problem for you. Given two integers A and B, your job is to calculate the Sum of A + B. InputThe first line of the input contains an integer T(1<=T<原创 2014-09-09 23:00:49 · 198 阅读 · 0 评论 -
Fibonacci Numbers
Fibonacci NumbersTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1967 Accepted Submission(s): 771Problem DescriptionThe Fibonacci原创 2015-02-15 23:02:30 · 669 阅读 · 0 评论 -
3n+1问题
题意:对于任意da'yu原创 2014-09-09 16:02:37 · 570 阅读 · 0 评论 -
杭电 Digital Roots
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 that digit is the digital root. If the resu原创 2014-09-06 15:58:52 · 326 阅读 · 0 评论 -
Let the Balloon Rise
Problem DescriptionContest time again! How excited it is to see balloons floating around. But to tell you a secret, the judges' favorite time is guessing the most popular problem. When the contest i原创 2014-09-10 23:05:22 · 184 阅读 · 0 评论 -
Online Judge
Problem DescriptionIgnatius is building an Online Judge, now he has worked out all the problems except the Judge System. The system has to read data from correct output file and user's result file,原创 2014-10-26 11:55:07 · 891 阅读 · 0 评论 -
Coin Test
Coin Test时间限制:3000 ms | 内存限制:65535 KB难度: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,just believe what I say ~i原创 2015-02-11 17:55:09 · 308 阅读 · 0 评论 -
猜数字
猜数字 Time Limit : 20000/10000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other)Total Submission(s) : 17 Accepted Submission(s) : 10Font: Times New Roman | Verdana | Georgia Font Size:原创 2015-02-14 11:15:58 · 412 阅读 · 0 评论 -
剪花布条
剪花布条Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 9936 Accepted Submission(s): 6413Problem Description一块花布条,里面有些图案,另有一块直接可用的小饰条原创 2015-02-17 17:05:56 · 334 阅读 · 0 评论 -
Substrings
SubstringsTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 7659 Accepted Submission(s): 3447Problem DescriptionYou are given a num原创 2015-02-20 17:07:19 · 258 阅读 · 0 评论 -
Text Reverse
Text ReverseTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 7195 Accepted Submission(s): 1965 Problem DescriptionIgna原创 2015-07-22 17:06:28 · 304 阅读 · 0 评论 -
跳绳游戏
问题描述:小朋友玩跳绳比赛,要计算在一分钟内跳了多少下.假设每秒钟跳一下,如果中途失败了,则要花三秒钟后才能开始重跳.一般小朋友跳绳一分钟要跳坏好几次.现在给出小朋友每次跳坏时已经跳的总数,求小朋友在一分钟内跳了多少下.关于输入:原创 2014-08-26 11:29:10 · 1272 阅读 · 0 评论 -
Max Sum
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), the max sum in this sequence is 6 + (-1) + 5 +原创 2014-09-10 22:34:11 · 224 阅读 · 0 评论 -
骑车与走路
问题描述:在北大校园里原创 2014-08-26 10:15:19 · 1492 阅读 · 0 评论 -
水题之笨小熊南阳oj
•时间限制:2000 ms | 内存限制:65535 KB•难度:2•描述•笨小熊的词汇量很小,所以每次做英语选择题的时候都很头疼。但是他找到了一种方法,经试验证明,用这种方法去选择选项的时候选对的几率非常大!•这种方法的具体描述如下:假设maxn是单词中出现次数最多的字母的出现次数,minn是单词中出现次数最少的字母的出现次数,如果maxn-minn是一个质数,那么原创 2014-08-25 20:42:04 · 652 阅读 · 0 评论 -
一道水题
一道水题时间限制:1000 ms | 内存限制:65535 KB难度:2描述今天LZQ在玩一种小游戏,但是这游戏数有一点点的大,他一个人玩的累,想多拉一些人进来帮帮他,你能写一个程序帮帮他吗?这个游戏是这样的:有一行数字,如果我们把这行数字中的‘5’都看成空格,那么就得到一行用空格分割的若干非负整数(可能有些整数以‘0’开头,这些头部的‘0’应该被忽略掉,除非这原创 2015-03-14 21:49:39 · 344 阅读 · 0 评论 -
车牌号
车牌号时间限制:3000 ms | 内存限制:65535 KB难度:1描述茵茵很喜欢研究车牌号码,从车牌号码上可以看出号码注册的早晚,据研究发现,车牌号码是按字典序发放的,现在她收集了很多车牌号码,请你设计程序帮她判断注册较早的号码。车牌号码由5个字母或数字组成输入第一行是n,代表有n组数据,第二行是m,以下m行是m个车牌号码其中n输出输出注原创 2015-02-22 17:28:24 · 376 阅读 · 0 评论 -
盗梦空间
盗梦空间时间限制:3000 ms | 内存限制:65535 KB难度:2描述《盗梦空间》是一部精彩的影片,在这部电影里,Cobb等人可以进入梦境之中,梦境里的时间会比现实中的时间过得快得多,这里假设现实中的3分钟,在梦里就是1小时。然而,Cobb他们利用强效镇静剂,可以从第一层梦境进入第二层梦境,甚至进入三层,四层梦境,每层梦境都会产生同样的时间原创 2015-01-15 15:13:31 · 427 阅读 · 0 评论 -
Least Common Multiple
Problem DescriptionThe least common multiple (LCM) of a set of positive integers is the smallest positive integer which is divisible by all the numbers in the set. For example, the LCM of 5, 7 and 1原创 2014-09-12 23:58:15 · 309 阅读 · 0 评论 -
Elevator
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 which floors the elevator will stop, in specified原创 2014-09-11 22:44:19 · 235 阅读 · 0 评论 -
poj排列
Description题目描述: 大家知道,给出正整数n,则1到n这n个数可以构成n!种排列,把这些排列按照从小到大的顺序(字典顺序)列出,如n=3时,列出1 2 3,1 3 2,2 1 3,2 3 1,3 1 2,3 2 1六个排列。任务描述: 给出某个排列,求出这个排列的下k个排列,如果遇到最后一个排列,则下1排列为第1个排列,即排列1 2 3…n。 比如:原创 2014-08-23 22:18:26 · 833 阅读 · 1 评论 -
poj String Matching
DescriptionIt's easy to tell if two words are identical - just check the letters. But how do you tell if two words are almost identical? And how close is "almost"?There are lots of techniq原创 2014-08-23 22:28:22 · 468 阅读 · 0 评论