- 博客(59)
- 收藏
- 关注
原创 Codeforces Round #313 (Div. 2) C. Gerald's Hexagon
Description Gerald got a very curious hexagon for his birthday. The boy found out that all the angles of the hexagon are equal to . Then he measured the length of its sides, and found that each of the
2015-08-22 13:10:36
655
原创 Codeforces Round #315 (Div. 2)569A Music(模拟)
DescriptionLittle Lesha loves listening to music via his smartphone. But the smartphone doesn’t have much memory, so Lesha listens to his favorite songs in a well-known social network InTalk.Unfortunat
2015-08-22 12:54:52
452
原创 Codeforces 478B Random Teams
Descriptionn participants of the competition were split into m teams in some manner so that each team has at least one participant. After the competition each pair of participants from the same team be
2015-08-22 12:51:37
445
原创 lightOJ 1317 Throwing Balls into the Baskets
DescriptionYou probably have played the game “Throwing Balls into the Basket”. It is a simple game. You have to throw a ball into a basket from a certain distance. One day we (the AIUB ACMMER) were pla
2015-08-22 12:47:58
460
原创 hdu 1145: 不容易系列2
Description大家常常感慨,要做好一件事情真的不容易,确实,失败比成功容易多了! 做好“一件”事情尚且不易,若想永远成功而总从不失败,那更是难上加难了,就像花钱总是比挣钱容易的道理一样。 话虽这样说,我还是要告诉大家,要想失败到一定程度也是不容易的。比如,我高中的时候,就有一个神奇的女生,在英语考试的时候,竟然把40个单项选择题全部做错了!大家都学过概率论,应该知道出现这种情况的概率
2015-08-22 12:44:30
962
原创 HDU 1405 The Last Practice
DescriptionTomorrow is contest day, Are you all ready? We have been training for 45 days, and all guys must be tired.But , you are so lucky comparing with many excellent boys who have no chance to at
2015-08-22 12:39:52
382
原创 hdu 2669 Romantic 扩展欧几里德
DescriptionThe Sky is Sprite. The Birds is Fly in the Sky. The Wind is Wonderful. Blew Throw the Trees Trees are Shaking, Leaves are Falling. Lovers Walk passing, and so are You. …………………………
2015-08-22 12:37:02
303
原创 hdu 4548(美素数)
Description 小明对数的研究比较热爱,一谈到数,脑子里就涌现出好多数的问题,今天,小明想考考你对素数的认识。 问题是这样的:一个十进制数,如果是素数,而且它的各位数字和也是素数,则称之为“美素数”,如29,本身是素数,而且2+9 = 11也是素数,所以它是美素数。 给定一个区间,你能计算出这个区间内有多少个美素数吗?Input第一行输入一个正整数T,表示总共有T组数据(T <
2015-08-22 12:34:27
347
原创 HDU 1222 Wolf and Rabbit
DescriptionThere is a hill with n holes around. The holes are signed from 0 to n-1. A rabbit must hide in one of the holes. A wolf searches the rabbit in anticlockwise order. The first hole he get into
2015-08-22 12:29:26
330
原创 LightOJ1104---Birthday Paradox (概率)
DescriptionSometimes some mathematical results are hard to believe. One of the common problems is the birthday paradox. Suppose you are in a party where there are 23 people including you. What is the p
2015-08-22 12:23:55
502
原创 数字三角形——动态转移方程
数字三角形问题。 7 3 8 8 1 0 2 7 7 4 5 5 2 6 5数字三角形中的数字为不超过100的正整数。现规定从最顶层走到最底层,每一步可沿左斜线向下或右斜线向下走。假设三角形行数≤100,编程求解从最顶层走到最底层的一条路径,使得沿着
2015-08-22 12:08:47
749
转载 HDU 2602 Bone Collector
DescriptionMany years ago , in Teddy’s hometown there was a man who was called “Bone Collector”. This man like to collect varies of bones , such as dog’s , cow’s , also he went to the grave … The bon
2015-08-16 15:50:11
351
原创 POJ 3903 Stock Exchange(LIS)
DescriptionThe world financial crisis is quite a subject. Some people are more relaxed while others are quite anxious. John is one of them. He is very concerned about the evolution of the stock exchang
2015-08-12 20:03:02
515
转载 HDU 1069 – Monkey and Banana
Description 一组研究人员正在设计一项实验,以测试猴子的智商。他们将挂香蕉在建筑物的屋顶,同时,提供一些砖块给这些猴子。如果猴子足够聪明,它应当能够通过合理的放置一些砖块建立一个塔,并爬上去吃他们最喜欢的香蕉。研究人员有n种类型的砖块,每种类型的砖块都有无限个。第i块砖块的长宽高分别用xi,yi,zi来表示。 同时,由于砖块是可以旋转的,每个砖块的3条边可以组成6种不同的长宽高。在构建塔
2015-08-12 16:29:06
711
原创 hdu 1003 Max Sum
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 + 4 = 14. InputT
2015-08-12 10:01:09
344
原创 CodeForces 492B
Description Vanya walks late at night along a straight street of length l, lit by n lanterns. Consider the coordinate system with the beginning of the street corresponding to the point 0, and its end
2015-08-08 16:41:53
634
原创 HDU 4911
Description bobo has a sequence a 1,a 2,…,a n. He is allowed to swap two adjacent numbers for no more than k times. Find the minimum number of inversions after his swaps. Note: The number of inversion
2015-08-08 16:37:44
404
原创 CodeForces 18C
Description Once Bob took a paper stripe of n squares (the height of the stripe is 1 square). In each square he wrote an integer number, possibly negative. He became interested in how many ways exist
2015-08-08 16:33:12
445
原创 POJ 3122 Pie
My birthday is coming up and traditionally I’m serving pie. Not just one pie, no, I have a number N of them, of various tastes and of various sizes. F of my friends are coming to my party and each of t
2015-08-06 16:24:08
322
原创 啊哈,算法!-----dfs3
题目描叙 迷宫由n行m列的单元格测组成(n和m都小于等于50),每个单元格要么是空地,要么是障碍物。你的任务是找到一条从迷宫起点通往同伴的最短路径。注(障碍物不能通过,也不能走到迷宫外) 代码实现#include<iostream>#include<cstdio>using namespace std;int n,m,p,q,_min=99999999;int a[51][51],book
2015-08-05 21:53:04
497
原创 啊哈,算法!-----dfs2
从1~9九个组成形如abc+def=ghi的式子 输出式子的总数代码实现#include<iostream>#include<cstdio>using namespace std;int a[10],book[10],total=0;void dfs(int step){ int i; if(step==10) { if(a[1]*100+a[2]*
2015-08-05 20:28:35
427
原创 UVa 714 Copying Books
Before the invention of book-printing, it was very hard to make a copy of a book. All the contents had to be re-written by hand by so called scribers. The scriber had been given a book and after severa
2015-08-05 19:38:22
320
原创 啊哈,算法! -----dfs1
问题:输入一个数n,输出1~n的全排序。(利用深度搜索)题解:假设每个n个盒子去存储n个数字代码实现#include<cstdio>#include<iostream>using namespace std;int a[10],book[10],n;void dfs(int step) //step表示盒子的编号{ int i; if(step==n+1) {
2015-08-04 20:33:52
452
原创 POJ2299 Ultra-QuickSort
DescriptionIn this problem, you have to analyze a particular sorting algorithm. The algorithm processes a sequence of n distinct integers by swapping two adjacent sequence elements until the sequence i
2015-08-04 16:17:20
357
原创 归并排序
void Merge(int array[], int start, int mid, int end)//归并排序的合并算法{ int temp1[10], temp2[10]; int n1, n2; n1 = mid - start + 1; n2 = end - mid; for (int i = 0; i < n2; i++){
2015-08-04 10:14:25
307
原创 UVALive 6661 Equal Sum Sets
Let us consider sets of positive integers less than or equal to n. Note that all elements of a set are different. Also note that the order of elements doesnt matter, that is, both {3, 5, 9} and {5, 9,
2015-07-31 20:56:20
458
原创 CodeForces 556A Case of the Zeros and Ones
Andrewid the Android is a galaxy-famous detective. In his free time he likes to think about strings containing zeros and ones.Once he thought about a string of length n consisting of zeroes and ones. C
2015-07-31 19:24:05
431
原创 HDU 5224 Tom and paper
Problem DescriptionThere is a piece of paper in front of Tom, its length and width are integer. Tom knows the area of this paper, he wants to know the minimum perimeter of this paper.InputIn the first
2015-07-31 19:15:23
371
原创 hdu 2524矩形A + B
Description 给你一个高为n ,宽为m列的网格,计算出这个网格中有多少个矩形,下图为高为2,宽为4的网格. Input 第一行输入一个t, 表示有t组数据,然后每行输入n,m,分别表示网格的高和宽 ( n < 100 , m < 100). Output 每行输出网格中有多少个矩形.Sample Input 2 1 2 2 4 Sample Output 3 30 代码
2015-07-30 08:59:13
314
原创 NOIP2008 火柴棒等式
【问题描述】给你n根火柴棒,你可以拼出多少个形如“A+B=C”的等式?等式中的A、B、C是用火柴棒拼出的整数(若该数非零,则最高位不能是0)。用火柴棒拼数字0–9的拼法如图所示: 注意加号与等号各自需要2根火柴棒 如果A≠B,则A+B=C与B+A=C视为不同的等式(A、B、C>=0) n根火柴棒必须全部用上 【输入】 ,有一个整数n(n<=24)。【输出】输出表示能拼成的不同等式的数目。【
2015-07-29 19:43:07
569
原创 Uva524 Primer Ring Problem
DescriptionA ring is composed of n (even number) circles as shown in diagram. Put natural numbers $1, 2,……, into each circle separately, and the sum of numbers in two adjacent circles should be a prim
2015-07-29 16:09:29
383
原创 hdu 3529 炸弹人
你还记得小霸王游戏机上的炸弹人吗?用放置炸弹的方法来消灭敌人。必须将画面上的敌人全部消灭。必须画面上的敌人全部消灭后,并找到隐藏的墙里面的暗门才能过关。 现在有一个特殊的关卡你只有一枚炸弹,但是这枚炸弹威力超强(杀伤距离超长,可以消灭杀伤范围内的所有敌人)。请问在哪里放置炸弹才可以消灭最多的敌人呢? 题解将图形化地图转化为字符型二维数组;##############GG.GGG#GGG
2015-07-29 09:45:36
878
原创 UVA 725 Division
Write a program that finds and displays all pairs of 5-digit numbers that between them use the digits 0 through 9 once each, such that the first number divided by the second is equal to an integer N, w
2015-07-28 16:13:11
467
原创 Uva 11059 Maximum Product
Given a sequence of integers S = {S1, S2, … , Sn}, you should determine what is the value of the maximum positive product involving consecutive terms of S. If you cannot find a positive sequence, you
2015-07-28 10:32:24
318
原创 Push和Pop操作原理
#include<iostream>#include<cstdio>using namespace std;#define MAXSIZE 100typedef struct//堆栈的定义{ int data[MAXSIZE]; int top;}SqStack;int Push (SqStack *s,int e) //Push{ if(s->top==MAX
2015-07-27 09:39:06
3407
转载 单链表基本操作
//////////////////////////////////////////// //单链表的初始化,建立,插入,查找,删除。// //Author:Wang Yong // //Date: 2010.8.19 // /////////////////////////////
2015-07-27 09:28:52
401
原创 计蒜课-统计三角形
给N根不同长度的木棍,求这些木棍一共能拼出多少个不同的不等边三角形。注意在拼三角形的时候一定要用上所有的N根木棍。不同的定义是至少有一条边的长度不相同;不等边的定义是三条边都不相等。输入格式:第一行为数据组数T,(1<=T<=15)。 接下来每行数据占两行,第一行为木棍的数量N(1<=N<=15) 第二行有N个正整数li(1<=li<100),表示N个木棍的长度。保证每个长度都不相同。输出格式:
2015-07-27 08:33:37
683
原创 计蒜课-奇怪的国家
有一个奇怪的国家,里面的国民对于事情的态度永远只有两面。当两个人遇到一起讨论一个事情的时候——两个持赞同观点的人遇到一起后会对这个事情都继续赞同;一个持赞同观点的人遇到一个持不赞同观点的人的时候,两人都会不再继续赞同;两个持不赞同观点的人遇到一起讨论后反而会对这个事情开始赞同。 输入包括两行,每行包括N个数字(1≤N≤50),分别表示两个人对于N个事情对应的看法——0表示不赞同、1表示赞同。 输
2015-07-26 19:53:48
738
原创 acer v5 573g 黑苹果clover
Yosemite Install(14B25).cdr:http://pan.baidu.com/s/1bn9BM4Rclover EFIhttp://pan.baidu.com/s/1i9yge
2015-07-25 16:38:42
4495
1
原创 HDU1276:士兵队列训练
Description 某部队进行新兵队列训练,将新兵从一开始按顺序依次编号,并排成一行横队,训练的规则如下:从头开始一至二报数,凡报到二的出列,剩下的向小序号方向靠拢,再从头开始进行一至三报数,凡报到三的出列,剩下的向小序号方向靠拢,继续从头开始进行一至二报数。。。,以后从头开始轮流进行一至二报数、一至三报数直到剩下的人数不超过三人为止。 Input 本题有多个测试数据组,第一行为组数N,接着
2015-07-25 16:21:02
513
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅