自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(26)
  • 收藏
  • 关注

原创 poj 1990

Every year, Farmer John’s N (1 <= N <= 20,000) cows attend “MooFest”,a social gathering of cows from around the world. MooFest involves a variety of events including haybale stacking, fence jumping, pi

2016-12-30 11:37:25 341

原创 全排列总结(蓝桥)

两种方法:递归和非递归 转自:http://blog.csdn.net/e3399/article/details/7543861递归#include <stdio.h> int n = 0; void swap(int *a, int *b) { int m; m = *a; *a = *b; *b = m; }

2016-12-26 19:26:27 445

原创 蓝桥带分数(全排列)

感觉自己越来越菜了,应该是累的,好好打代码好好休息。我要变强。蓝瘦想哭 标题:带分数100 可以表示为带分数的形式:100 = 3 + 69258 / 714还可以表示为:100 = 82 + 3546 / 197注意特征:带分数中,数字1~9分别出现且只出现一次(不包含0)。类似这样的带分数,100 有 11 种表示法。题目要求: 从标准输入读入一个正整数N (N<1000*1000) 程

2016-12-26 19:17:26 463

原创 poj 3258河石(二分的妙用)

Every year the cows hold an event featuring a peculiar version of hopscotch that involves carefully jumping from rock to rock in a river. The excitement takes place on a long, straight river with a roc

2016-12-24 00:40:01 332

原创 poj 2155 二维树状数组 二维线段树

Given an N*N matrix A, whose elements are either 0 or 1. A[i, j] means the number in the i-th row and j-th column. Initially we have A[i, j] = 0 (1 <= i, j <= N). We can change the matrix in the follow

2016-12-23 14:59:04 367

转载 poj 2356 find a multiple(抽屉定理)

The input contains N natural (i.e. positive integer) numbers ( N <= 10000 ). Each of that numbers is not greater than 15000. This numbers are not necessarily different (so it may happen that two or mor

2016-12-23 10:35:14 567

原创 POj 1019 number sequence(数学)

A single positive integer i is given. Write a program to find the digit located in the position i in the sequence of number groups S1S2…Sk. Each group Sk consists of a sequence of positive integer numb

2016-12-23 10:23:52 550

原创 poj 3273(二分)区间的最大值

Farmer John is an astounding accounting wizard and has realized he might run out of money to run the farm. He has already calculated and recorded the exact amount of money (1 ≤ moneyi ≤ 10,000) that he

2016-12-23 00:28:31 529

原创 POJ 1850 Code (递推数学)

第一次接触组合数学。。 Transmitting and memorizing information is a task that requires different coding systems for the best use of the available space. A well known system is that one where a number is associat

2016-12-22 16:42:11 401

原创 POj 3321 树状数组苹果树

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 carefully nurturing the big apple tree.The tree has N for

2016-12-22 00:34:37 623

原创 hdu 1180(广搜升阶)诡异的楼梯

Hogwarts正式开学以后,Harry发现在Hogwarts里,某些楼梯并不是静止不动的,相反,他们每隔一分钟就变动一次方向. 比如下面的例子里,一开始楼梯在竖直方向,一分钟以后它移动到了水平方向,再过一分钟它又回到了竖直方向.Harry发现对他来说很难找到能使得他最快到达目的地的路线,这时Ron(Harry最好的朋友)告诉Harry正好有一个魔法道具可以帮助他寻找这样的路线,而那个魔法道具上

2016-12-18 14:58:10 320

原创 POJ 3468 A Simple Problem with Integers(树状数组)

集训队已经开到树状数组,而我才刚学会线段树的基本,而且动归虽然接触过,但是还没练过。 For the k-th number, we all should be very familiar with it. Of course,to kiki it is also simple. Now Kiki meets a very similar problem, kiki wants to design

2016-12-18 14:43:54 304

原创 Poj 2299

In 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 is sorted in

2016-12-18 00:32:52 370

原创 poj 2528

The citizens of Bytetown, AB, could not stand that the candidates in the mayoral election campaign have been placing their electoral posters at all places at their whim. The city council has finally de

2016-12-17 23:16:30 300

原创 hdu 2852

集训队已经开到树状数组,而我才刚学会线段树的基本,而且动归虽然接触过,但是还没练过。 For the k-th number, we all should be very familiar with it. Of course,to kiki it is also simple. Now Kiki meets a very similar problem, kiki wants to design

2016-12-16 21:13:39 531

原创 Poj 3468 线段树的区间更新

A Simple Problem with Integers Time Limit: 5000MS Memory Limit: 131072K Total Submissions: 101266 Accepted: 31599 Case Time Limit: 2000MS DescriptionYou have N integers, A1, A2, … , AN.

2016-12-16 20:11:08 410

原创 关于STL 的那些事

今晚参加训练。。。树状数组的练习,傻乎乎的用STL做了一晚,虽然题没做出来,不过对STL的查找有了更深一层的理解。 关于STL。 输入输出 vector push_back pop_back stack push pop queue push pop 头:front() 尾 back() priority_queue push pop 头 top 没有尾 List p

2016-12-15 23:58:03 316

原创 关于小数负数丢失精度的问题

在pat 1051中会出现这样一个问题 1051. 复数乘法 (15) 复数可以写成(A + Bi)的常规形式,其中A是实部,B是虚部,i是虚数单位,满足i2 = -1;也可以写成极坐标下的指数形式(R*e(Pi)),其中R是复数模,P是辐角,i是虚数单位,其等价于三角形式(R(cos(P) + isin(P))。 现给定两个复数的R和P,要求输出两数乘积的常规形式。 输入格式: 输入在

2016-12-15 14:02:42 768

原创 codefoeces 384 div2 b题(二分)

第一次打codeforces,好开心啊,二血。(虽然是水题。。而且因为longlong耽误了很多时间。)可是好吧。。这样说又不是很开心了。 B. Chloe and the sequence time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard ou

2016-12-15 08:40:48 427

原创 POJ 2253 最短路的简单变形

Freddy Frog is sitting on a stone in the middle of a lake. Suddenly he notices Fiona Frog who is sitting on another stone. He plans to visit her, but since the water is dirty and full of tourists’ suns

2016-12-10 16:14:11 444

原创 POJ 1182 食物链(带权并查集)

哈哈哈 第一天脑子疼没看懂,第二天一看,也就那么回事嘛。 动物王国中有三类动物A,B,C,这三类动物的食物链构成了有趣的环形。A吃B, B吃C,C吃A。 现有N个动物,以1-N编号。每个动物都是A,B,C中的一种,但是我们并不知道它到底是哪一种。 有人用两种说法对这N个动物所构成的食物链关系进行描述: 第一种说法是”1 X Y”,表示X和Y是同类。 第二种说法是”2 X Y”,表示X

2016-12-09 16:16:44 403

原创 hdu 3038 日了狗的并查集

TT and FF are … friends. Uh… very very good friends -__-b FF is a bad boy, he is always wooing TT to play the following game with him. This is a very humdrum game. To begin with, TT should write down a

2016-12-08 17:05:00 523

转载 (转)动态规划和贪心算法的区别

(转自)http://hi.baidu.com/35661327/blog/item/d5463e17f1e8d011972b439c.html动态规划和贪心算法的区别 动态规划和贪心算法都是一种递推算法 均有局部最优解来推导全局最优解 不同点: 贪心算法: 1.贪心算法中,作出的每步贪心决策都无法改变,因为贪心策略是由上一步的最优解推导下一步的最优解,而上一部之前的最优解则不作保留。

2016-12-07 15:29:13 614

原创 POJ 3069 贪心

Saruman the White must lead his army along a straight path from Isengard to Helm’s Deep. To keep track of his forces, Saruman distributes seeing stones, known as palantirs, among the troops. Each palan

2016-12-07 15:12:52 345

原创 Codeforces 556A 贪心

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

2016-12-07 14:32:57 898

转载 poj 3070 深入理解贪心的例题

AllowanceTime Limit: 1000MSMemory Limit: 65536KTotal Submissions: 2300Accepted: 945DescriptionAs a reward for record mil

2016-12-07 11:54:32 634

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除