自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 CF 226 DIV2 B. Bear and Strings

B. Bear and Stringstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputThe bear has a string s = s1s2... s|s| (

2014-01-26 10:35:46 924

原创 hdu 2115 I Love This Game

这题其实就是一个简单的排序,但某渣太差了,代码写了很长,字典序排序也是一个一个字符去比较看了别人代码才发现其实用strcmp 就可以了自己代码:#include#include#include#include#includeusing namespace std;struct node{ int m; int s; char ch[111];

2014-01-24 09:59:39 709

原创 hdu 2112 HDU Today( 最短路)

这题我用Dijkstra算法的时间花费为562MSFloyd算法的时间花费为921MS ,险过Floyd代码: #include#include#include#include#includeusing namespace std;#define INF 0xffffff__int64 map[200][200];char s[200][50];//

2014-01-23 15:48:09 631

原创 hdu 2108 Shape of HDU(向量叉乘)

题目大意:按逆时针方向给出N边形的N个点,判断该N边形是否为凸多边形凸多边形判断方法:  设P1,P2,P3为3个连续的点,由向量叉乘可得,如向量P1P2叉乘P2P3的积小于0,则P2P3的方向是P1P2的方向的左转(由右手定则可得)  因为题目中的点是逆时针方向给出的,所以判断是否所有3个连续的点的向量都小于0 ,若都小于0,则为凸,否则为凹代码:#include#i

2014-01-23 10:08:16 922

原创 CF 225DIV2 B. Multitasking

B. Multitaskingtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputIahub wants to enhance his multitasking abil

2014-01-22 17:10:25 606

原创 CF 224DIV2 B Number Busters

B. Number Busterstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputArthur and Alexander are number busters. T

2014-01-19 11:20:09 869

原创 hdu 2103 Family planning

怎么说,这明显是一道大水题,不过我还是WA了一次,充分说明自己读题的不够仔细,特别是英文题的时候一定要看清题意 第一次做的时候没考虑到N AC代码: #include#include#include#include#includeusing namespace std;int main(){ __int64 a[33]; a[1]= 1; f

2014-01-17 10:56:42 670

原创 hdu 2062 Subset sequence

该题的意思为求N个数构成的第M个序列方法为一层一层往下剥,每次都求出当前序列的第一个数例如N= 3 时构成的序列为 1 1 2 1 2 3 1 3 1 3 2  2 2 1 2 1 3 2 3  2  3  1 3  3 1  3 1 2 3 2  3 2 1设两个数构成的序列和为a【2】,则明显可求出a【3】= 3 * (a

2014-01-16 15:54:35 727

原创 UVa 1388 Graveyard 墓地雕塑

圆上的等距N个点,每个点相距360/N 度,增加M个点后,每个点相距360/(N+m)度,这N个点可顺时针或逆时针移动每次去移动的最小值即可算出ans代码:#include#include#include#include#includeusing namespace std;double min(double x,double y){ return x<

2014-01-16 10:16:09 897

原创 UVa 11300 Spreading the Wealth 分金币 (中位数)

F. Spreading the Wealth ProblemA Communist regime is trying to redistribute wealth in a village. They have have decided to sit everyone around a circular table. First, everyone has con

2014-01-15 17:12:18 703

原创 UVa 11729 Commando War 突击战

Commando WarInput: Standard InputOutput: Standard Output  “Waiting for orders we held in the wood, word from the front never cameBy evening the sound of the gunfire was miles awa

2014-01-15 16:38:46 668

原创 UVa 11292 Spreading the Wealth 勇者斗恶龙

对恶龙的头和骑士的能力排一次序即可代码:#include#include#include#include#includeusing namespace std;#define MAXSIZE 20005int a[MAXSIZE],b[MAXSIZE];int main(){ int m,n; while(scanf("%d %d",&m,&n)

2014-01-15 16:35:57 783

原创 HDU 2065 "红色病毒" 问题(二分快速幂)

之前看见别人说这题找规律,好吧,我找了半天都没找出来,看了别人的解题报告才知道原来规律是ans= 4^(n-1) + 2 ^(n-1) 个人感觉这规律有点难找,解这题要用到高数,可惜高数太渣。碰到这种题我就只能碰运气看能不能把规律找出来了。代码:#includeint Pow(__int64 n){ int r= 1,b= 2; while(n!=0) {

2014-01-15 14:01:01 731

空空如也

空空如也

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

TA关注的人

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