水题(杂七杂八)
文章平均质量分 62
h1021456873
这个作者很懒,什么都没留下…
展开
-
HDU 1035 机器人行走步数 (模拟)
Problem DescriptionA robot has been programmed to follow the instructions in its path. Instructions for the next direction the robot is to move are laid down in a grid. The possible instructio原创 2015-12-12 00:12:33 · 558 阅读 · 0 评论 -
51nod 1402 最大值 (模拟)
坑点在要维护两端。。从左扫一遍,从右扫一遍。。。一个N长的数组s[](注意这里的数组初始下标设为1,而不是0,即N个元素为s[1],s[2],...,s[N]),满足以下性质:1)每个元素都是非负的整数,且s[1]=0;2)任意两个相邻元素差值的绝对值不大于1,即| s[i]-s[i+1] |3)对于部分特殊点xi,要求s[xi]问在以上约束下s[]中的最大值最大可原创 2015-12-04 23:22:37 · 611 阅读 · 0 评论 -
51nod 1414 冰雕 (水题)
白兰大学正在准备庆祝成立256周年。特别任命副校长来准备校园的装扮。校园的中心竖立着n个冰雕。这些雕像被排在一个等分圆上,因此他们形成了一个正n多边形。这些冰雕被顺针地从1到n编号。每一个雕有一个吸引力t[i].校长来看了之后表示不满意,他想再去掉几个雕像,但是剩下的雕像必须满足以下条件:· 剩下的雕像必须形成一个正多边形(点数必须在3到n之间,inclusi原创 2015-12-05 00:22:09 · 607 阅读 · 0 评论 -
51nod 1435 位数阶乘 (简单题)
X是一个n位数的正整数 (x=a0a1...an−1) 现在定义 F(x)=∏i=0n−1(ai!) , 比如F(135)=1!*3!*5!=720.我们给定一个n位数的整数X(至少有一位数大于1,X中可能有前导0),然后我们去找一个正整数(s)符合以下条件:1.这个数尽可能大,2.这个数中不能含有数字0或1。3.F(s)=F(x)原创 2016-01-26 19:57:20 · 427 阅读 · 0 评论 -
A - 汉诺塔III (找规律)
Description约19世纪末,在欧州的商店中出售一种智力玩具,在一块铜板上有三根杆,最左边的杆上自上而下、由小到大顺序串着由64个圆盘构成的塔。目的是将最左边杆上的盘全部移到右边的杆上,条件是一次只能移动一个盘,且不允许大盘放在小盘的上面。现在我们改变游戏的玩法,不允许直接从最左(右)边移到最右(左)边(每次移动一定是移到中间杆或从中间移出),也不允许大盘放到下盘的上面。 D原创 2016-02-05 14:35:55 · 439 阅读 · 0 评论 -
C - ZhangYu Speech (水题)
Descriptionas we all know, ZhangYu(Octopus vulgaris) brother has a very famous speech - “Keep some distance from me”. ZhangYu brother is so rich that everyone want to contact he, and scfkcf is o原创 2016-02-05 14:38:36 · 353 阅读 · 0 评论 -
蓝桥 分糖果 (模拟)
问题描述 有n个小朋友围坐成一圈。老师给每个小朋友随机发偶数个糖果,然后进行下面的游戏: 每个小朋友都把自己的糖果分一半给左手边的孩子。 一轮分糖后,拥有奇数颗糖的孩子由老师补给1个糖果,从而变成偶数。 反复进行这个游戏,直到所有小朋友的糖果数都相同为止。 你的任务是预测在已知的初始糖果情形下,老师一共需要补发多少个糖果。输入格式原创 2016-01-13 19:20:07 · 394 阅读 · 0 评论 -
HDU 1056 HangOver (简单数学题)
题意:意思就是 你输入一个长度,问你最少用几张卡片能 让伸出去的长度大于等于你输入的长度.公式题目题目上面有Problem DescriptionHow far can you make a stack of cards overhang a table? If you have one card, you can create a maximum over原创 2016-01-15 14:16:26 · 2292 阅读 · 0 评论 -
cf 625 Guest From the Past (买饮料_锻炼思维的题)
思维要谨慎!!!!两种饮料可以买,总共n元,一种是a元,另一种是b元,喝完后退c元。问最多能买多少饮料!Kolya Gerasimov loves kefir very much. He lives in year 1984 and knows all the details of buying this delicious drink. One day, as you原创 2016-03-02 22:18:03 · 861 阅读 · 1 评论 -
cf 625 b.War of the Corporations (字符串)
给出s1,s2两个字符串,要求修改字符串的字符,要求不能存在字串s2,问最少修改几个,其实找到相同的字符串后,修改最后一个字符,就可以直接跳到下一个字符...A long time ago, in a galaxy far far away two giant IT-corporations Pineapple and Gogol continue their fierce原创 2016-03-02 22:50:48 · 988 阅读 · 1 评论 -
HDU 1030 数塔找最短路 (找规律)
Problem DescriptionA triangle field is numbered with successive integers in the way shown on the picture below. The traveller needs to go from the cell with number M to the cell with num原创 2015-12-04 16:29:35 · 1819 阅读 · 0 评论 -
UVa 11078 Ai-Aj(i<j)的最大值
已知序列A0,A1...An-1,使得Ai-Aj(i#include#include#includeusing namespace std;const int maxn=1e5+100;int pre[maxn],back[maxn],a[maxn];int main(){ int n,ans,i,j; int t; scanf("%d",&t); while(t原创 2015-12-03 01:00:54 · 1472 阅读 · 0 评论 -
HDU 1049 青蛙爬进 (水题_模拟)
Problem DescriptionAn inch worm is at the bottom of a well n inches deep. It has enough energy to climb u inches every minute, but then has to rest a minute before climbing again. During the rest,原创 2015-12-15 00:31:09 · 455 阅读 · 0 评论 -
HDU 1062 字符串翻转 (水题)
Problem DescriptionIgnatius likes to write words in reverse way. Given a single line of text which is written by Ignatius, you should reverse all the words and then output them. Input原创 2016-01-15 15:57:37 · 438 阅读 · 0 评论 -
HDU 1060 求N^N的最高位 (数学,科学计数法+log10()函数)
Problem DescriptionGiven a positive integer N, you should output the leftmost digit of N^N. InputThe input contains several test cases. The first line of the input is a single inte原创 2015-12-14 21:21:59 · 458 阅读 · 0 评论 -
HDU 1048 字符串转化(整行读取函数cin.getline(str,100))
Problem DescriptionJulius Caesar lived in a time of danger and intrigue. The hardest situation Caesar ever faced was keeping himself alive. In order for him to survive, he decided to create one of原创 2015-12-15 00:19:14 · 500 阅读 · 0 评论 -
HDU 1076 (闰年判断)
Problem DescriptionIgnatius was born in a leap year, so he want to know when he could hold his birthday party. Can you tell him?Given a positive integers Y which indicate the start year, and a原创 2016-01-17 18:28:36 · 479 阅读 · 0 评论 -
51nod 1158 全是1的最大子矩阵 (暴力枚举)
给出1个M*N的矩阵M1,里面的元素只有0或1,找出M1的一个子矩阵M2,M2中的元素只有1,并且M2的面积是最大的。输出M2的面积。Input第1行:2个数m,n中间用空格分隔(2 <= m,n <= 500)第2 - N + 1行:每行m个数,中间用空格分隔,均为0或1。Output输出最大全是1的子矩阵的面积。Input示例3 31原创 2015-12-19 15:14:08 · 843 阅读 · 0 评论 -
51nod 1403 有趣的堆栈 (找规律题)
大家都熟悉堆栈操作。一个堆栈一般有两种操作,push和pop。假设所有操作都是合法的并且最终堆栈为空。我们可以有很多方法记录堆栈的操作,(1) 对每个pop操作,我们记录它之前一共有多少个push操作。(2) 对每个pop操作,我们记录这个被Pop的元素曾经被压上了几个。例如:操作push, push, pop, push, push, pop, push, pop, pop, pop原创 2015-12-19 16:10:46 · 825 阅读 · 0 评论 -
HDU 1084 What Is Your Grade? (模拟题)
题意:ac 5题,100分ac 4题,排名前50% 95分,其余 90分。。。。。。。。。。。。ac 0题,50分Problem Description“Point, point, life of student!”This is a ballad(歌谣)well known in colleges, and you must care原创 2016-01-21 14:19:12 · 441 阅读 · 0 评论 -
UVA 11384 最少操作使数列变为零 (找规律)
用最少的操作次数把序列1,2,....,n 中的所有数都变成0.#include#include#include#include#include#include#include#includeusing namespace std;int a[100];int init(){ int i; a[1]=1; for( i=2;;i++) { a[i]=2*原创 2015-12-03 00:12:24 · 1077 阅读 · 0 评论 -
cf 625 C. K-special Tables (打表+规律)
People do many crazy things to stand out in a crowd. Some of them dance, some learn by heart rules of Russian language, some try to become an outstanding competitive programmers, while others collect原创 2016-03-02 23:27:06 · 945 阅读 · 1 评论 -
第十一届浙江省程序设计竞赛
A.Pokemon MasterCalem and Serena are pokemon masters. One day they decided to have a pokemon battle practice before Pokemon World Championships. Each of them has some pokemons in each's team.原创 2016-03-16 20:02:03 · 916 阅读 · 1 评论 -
ZOJ 3326 日历 (打表)
DescriptionIn order to encourage Hiqivenfin to study math, his mother gave him a sweet candy when the day of the month was a prime number. Hiqivenfin was happy with that. But several days later, h原创 2016-03-13 00:03:22 · 381 阅读 · 1 评论 -
HDU 5641 King's Phone 手机解锁 (模拟)
问题描述阅兵式上,国王见到了很多新奇东西,包括一台安卓手机。他很快对手机的图形解锁产生了兴趣。解锁界面是一个 3 \times 33×3 的正方形点阵,第一行的三个点标号 1, 2, 31,2,3,第二行的三个点标号 4, 5, 64,5,6,第三行的三个点标号 7, 8, 97,8,9。密码本身是一段序列,表示经过点的先后顺序,但遵循如下规则:1. 密码至少经过四个点。2. 不能原创 2016-03-13 00:07:48 · 448 阅读 · 1 评论 -
蓝桥杯 移动距离 (打表)
移动距离X星球居民小区的楼房全是一样的,并且按矩阵样式排列。其楼房的编号为1,2,3...当排满一行时,从下一行相邻的楼往反方向排号。比如:当小区排号宽度为6时,开始情形如下: 1 2 3 4 5 612 11 10 9 8 713 14 15 .....我们的问题是:已知了两个楼号m和n,需要求出它们之间的最短移动距离(不能斜线方向移动)输入为3个原创 2016-03-13 21:02:57 · 1048 阅读 · 1 评论 -
ZOJ 3600 Taxi Fare (细节题)
DescriptionLast September, Hangzhou raised the taxi fares.The original flag-down fare in Hangzhou was 10 yuan, plusing 2 yuan per kilometer after the first 3km and 3 yuan per kilometer after 10k原创 2016-04-19 20:39:06 · 612 阅读 · 0 评论 -
ZOJ 3603 Draw Something Cheat (模拟)
DescriptionHave you played Draw Something? It's currently one of the hottest social drawing games on Apple iOS and Android Devices! In this game, you and your friend play in turn. You need to pick原创 2016-04-19 22:16:35 · 454 阅读 · 0 评论 -
ZOJ 3607Lazier Salesgirl (模拟题)
DescriptionKochiya Sanae is a lazy girl who makes and sells bread. She is an expert at bread making and selling. She can sell the i-th customer a piece of bread for price pi. But she is so lazy th原创 2016-04-20 17:17:25 · 590 阅读 · 0 评论 -
usaco Friday the Thirteenth (数星期)
/** PROG:friday LANG:C++ ID:zpc19951 **/#include#include#include#includeusing namespace std;int f[11];bool judge(int y){ if((y%4==0&&y%100!=0)||y%400==0) return true; return fa原创 2016-10-27 19:23:47 · 217 阅读 · 0 评论 -
usaco Greedy Gift Givers (送礼物)
A group of NP (2 ≤ NP ≤ 10) uniquely named friends has decided to exchange gifts of money. Each of these friends might or might not give some money to any or all of the other friends. Likewise, each f原创 2016-10-27 19:27:54 · 367 阅读 · 0 评论 -
usaco Transformations (矩形翻转||模拟题)
A square pattern of size N x N (1 <= N <= 10) black and white square tiles is transformed into another square pattern. Write a program that will recognize the minimum transformation that has been appl原创 2016-10-29 14:03:18 · 359 阅读 · 0 评论 -
Hanoi Tower Troubles Again! (找规律)
DescriptionPeople stopped moving discs from peg to peg after they know the number of steps needed to complete the entire task. But on the other hand, they didn't not stopped thinking about similar原创 2016-02-27 19:33:22 · 937 阅读 · 1 评论 -
HDU 2830 移动的矩阵 (思维题)
Problem DescriptionGiven an N * M matrix with each entry equal to 0 or 1. We can find some rectangles in the matrix whose entries are all 1, and we define the maximum area of such rectangle as thi原创 2016-03-23 18:54:02 · 374 阅读 · 1 评论 -
cf17A Noldbach problem (素数打表)
2-n个数之间,有多少个素数能由相邻素数相加+1,组成。。。Nick is interested in prime numbers. Once he read about Goldbach problem. It states that every even integer greater than 2 can be expressed as the sum of two原创 2016-03-29 22:53:11 · 575 阅读 · 0 评论 -
cf17B 建树,使得边之和最小 (水题)
要建立一颗树,使得树的边sum最小,同时判断是否能生成一颗树..Nick's company employed n people. Now Nick needs to build a tree hierarchy of «supervisor-surbodinate» relations in the company (this is to say that each em原创 2016-03-30 00:56:19 · 429 阅读 · 0 评论 -
cf628B 求字符串的字串有多少个能整除4 (找规律)
因为100是4的倍数,那么只要先暴力一遍一位数的,满足要求的+1然后在暴力2位数的,符合要求的+前缀....之前训练赛有做过类似的题目,所以....so eazyDescriptionMax wants to buy a new skateboard. He has calculated the amount of money that is needed to b原创 2016-03-30 01:15:17 · 1054 阅读 · 0 评论 -
HDU 黑白棋 (找规律)
首先,如果先对偶数行取反,再对偶数列取反,可以得到一个[n/2] + [m/2][n/2]+[m/2](下取整)的解, 只要说明这个这是答案的下界就可以了。 考虑第一列,每次操作最多使得两个第一列的相邻元素变得一样, 第一列有n-1n−1对相邻元素,这样使得第一列变成一样的次数就是[(n-1)/2][(n−1)/2](上取整),同理考虑第一行即可。问题描述一个n \ti原创 2016-02-21 19:52:27 · 1182 阅读 · 1 评论 -
HUST 1602 (找规律)
DescriptionThis problem is quiet easy. Initially, there is a string A. Then we do the following process infinity times. A := A + “HUSTACM” + A For example, if a = “X”, then Aft原创 2016-03-07 19:05:25 · 305 阅读 · 1 评论 -
HUST 1606 判断一个数是否是3个数的立方和 (暴力)
DescriptionGive you a positive integer x, determine whether it is the sum of three positive cubic numbers.InputThere’re several test cases. For each case: Only one line containing an原创 2016-03-07 19:08:44 · 900 阅读 · 1 评论