自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

丙三醇

Stupid boy learn programming . QQ交流:792883735

  • 博客(29)
  • 资源 (2)
  • 收藏
  • 关注

原创 HDU1233——还是畅通工程

Problem Description某省调查乡村交通状况,得到的统计表中列出了任意两村庄间的距离。省政府“畅通工程”的目标是使全省任何两个村庄间都可以实现公路交通(但不一定有直接的公路相连,只要能间接通过公路可达即可),并要求铺设的公路总长度为最小。请计算最小的公路总长度。 Input测试输入包含若干测试用例。每个测试用例的第1行给出村庄数目N ( 当N为0时,输入结

2013-08-23 12:42:07 943 2

原创 HDU2594——Simpsons’ Hidden Talents

Problem DescriptionHomer: Marge, I just figured out a way to discover some of the talents we weren’t aware we had.Marge: Yeah, what is it?Homer: Take me for example. I want to find out if I have

2013-08-20 00:59:58 2037 5

原创 HDU1686——Oulipo

Problem DescriptionThe French author Georges Perec (1936–1982) once wrote a book, La disparition, without the letter 'e'. He was a member of the Oulipo group. A quote from the book:Tout avait Pa

2013-08-19 18:01:55 899

原创 HDU1711——Number Sequence

Problem DescriptionGiven two sequences of numbers : a[1], a[2], ...... , a[N], and b[1], b[2], ...... , b[M] (1 <= M <= 10000, 1 <= N <= 1000000). Your task is to find a number K which make a[K] = b

2013-08-17 18:09:34 1133

原创 Priority_queue优先队列容器

Priority_queue优先队列容器和队列一样只能在队尾插入队首删除但有个特性是队列中的最大元素总是位于队首所以出队时并非按先进先出的原则进行而是将当前队列中最大的元素出队这点类似给队列中的元素进行了默认的大到小的顺序排列重载“”可以重新定义比较规则Priority_queue优先队列容器优先队列的使用方法使用push()入队插入元素 pop()出队删除元素 top()读取队首

2013-08-14 19:27:22 871

原创 Bitset位集合容器

Bitset容器是一个bit位元素的序列容器每个元素只占一个bit位取值非0即1因而很节省空间他的10个元素只使用了两个字节的空间Bitset位集合容器创建bitset对象创建bitset对象时一定要指定容器大小大小一定义就不能修改 #include "stdafx.h"#include "iostream"#include "bitset"using namesp

2013-08-14 19:26:22 826

原创 Deque双端队列容器

1、Deque双端队列容器创建deque对象//可创建无任何元素的或者具有n个元素的或者具有n个元素的并赋初值的#include#include#include#include#include#include#include#include#include#include#include#includeusing namespace std;int main()

2013-08-14 17:02:50 734

原创 Multimap多重映照容器

1、Multimap多重映照容器 multimap对象的创建和元素插入//可使用insert()重复插入元素#include#include#include#include#include#include#include#include#include#include#includeusing namespace std;int main(){ int

2013-08-14 16:38:17 741

原创 Map映照容器

1、Map映照容器 map创建元素插入和遍历访问//创建map对象 键值与映照数据的类型自己定义 在默认比较函数下 元素的插入按键值小到大#include#include#include#include#include#include#include#include#include#include#includeusing namespace std;int main(

2013-08-14 16:14:52 953

原创 那些神话~

总要找点儿目标来激励自己什么的~对吧?~________________________________________wywcgs:亦称Lord Wu,俗名吴垠,2009级厦门大学智能科学与技术学院研究生,本科就读于哈尔滨工业大学。因其深厚的算法功底与独到的思维方式,被尊为“吴教主”,至今声威犹存。2006年起参加ACM/ICPC竞赛,获得分别获得上海、西安、长春三枚区域赛银

2013-08-14 15:32:53 938

原创 3xian之所在

最后一天,漫天飘起了雪花,假装欢送我离去。这次WF之战不太顺利,早期的C题大概花了1秒钟构思,然而由于输出格式多了一个空格直到两个半小时才逃脱Wrong Answer的纠缠。还好lynncui在期间独挡一面过掉D。最终成绩不好,然而没有遗憾,从不遗憾。相比之下,来自全球的队伍让我看到了很强大的实力,每一道题都有人过,包括SJTU欺骗性提交的H都被人干掉了。身为地球人我感到自豪。

2013-08-14 15:29:37 789 1

原创 HDU1004——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

2013-08-14 15:09:45 793

原创 HDU——2095find your present (2)

Problem DescriptionIn the new year party, everybody will get a "special present".Now it's your turn to get your special present, a lot of presents now putting on the desk, and only one of them will

2013-08-14 10:58:52 895

原创 Multiset多重集合容器

1、Multiset多重集合容器 multiset元素的插入//插入重复键值#include#include#include#include#include#include#include#include#include#includeusing namespace std;int main(){ multiset ms; ms.insert("111

2013-08-14 09:09:08 984

原创 Set集合容器

1、set集合容器创建set集合对象 //创建set对象时 要指定元素类型 元素排列按默认比较规则 比较规则可以自己定义#include#include#include#include#include#include#include#include#include#includeusing namespace std;int main(){ sets; ret

2013-08-14 08:57:33 1128

原创 String基本字符系列容器

1、/*创建s 空字符串*/#include#include#include#include#include#include#include#includeusing namespace std;int main(){ string s; cout<<s.length()<<endl; return 0;} 2、基本字符系列容器给string对象赋值

2013-08-13 20:21:44 990

原创 STL初涉~

STL入门系列~

2013-08-13 16:14:46 791

原创 定义函数模板

#include#includeusing namespace std;//定义函数模板template //template 是关键字,T 表示一种待实例化的类型//template 也是对的T MAX(T a, T b)//函数模板,函数名为 max,此函数有2个T类型的参数,返回类型为T{ return (a>b)?a:b;}//在此例实例化的时候,T可以是多

2013-08-12 20:51:40 804

原创 最大乘积(暴力)

输入n个元素组成的序列S,你需要找出一个乘积最大的连续子序列。如果这个最大的乘积不是正整,应输出-1(表示无解)。1≤n≤18,-10≤Si≤10。样例输入:32 4-352 5-1 2 -1样例输出:820【分析】连续子序列有两个要素:起点和终点,因此只需要枚举起点和终点即可。由于每个元素的绝对值不超过10,一共又不超过18个元素,最大可能的乘积示会超过1

2013-08-11 16:54:33 3049 3

原创 2013 Multi-University Training Contest 1——I-number

题目描述The I-number of x is defined to be an integer y, which satisfied the the conditions below:1.  y>x;2.  the sum of each digit of y(under base 10) is the multiple of 10;3.  among all integers

2013-08-10 09:36:36 1144

原创 UVA445—— Marvelous Mazes

Your mission, if you decide to accept it, is to create a maze drawing program. A maze will consist of the alphabetic characters A-Z, * (asterisk), and spaces. Input and OutputYour program will g

2013-08-10 00:12:58 1377

原创 UVA490—— Rotating Sentences

In ``Rotating Sentences,'' you are asked to rotate a series of input sentences 90 degrees clockwise. So instead of displaying the input sentences from left to right and top to bottom, your program wil

2013-08-09 23:05:15 861

原创 UVA414—— Machined Surfaces

An imaging device furnishes digital images of two machined surfaces that eventually will be assembled in contact with each other. The roughness of this final contact is to be estimated.A digital i

2013-08-07 20:15:13 4018

原创 UVA 494—— Kindergarten Counting Game

Everybody sit down in a circle. Ok. Listen to me carefully.``Woooooo, you scwewy wabbit!'' Now, could someone tell me how many words I just said? Input and OutputInput to your program wi

2013-08-07 19:33:26 911

原创 简 单 枚 举

输入正整数n,按从小到大的顺序输出所有形如abcde/fghij=n的表达式,其中a~j恰好为数字0~9的一个排列,2≤n≤79。样例输入:62样例输出:79546/01283=6294736/01528=62【分析】只需要枚举fghij就可以计算出abcde,然后判断是否所有数字都不相同即可。不仅程序简单,而枚举量也从10!=3628800降低至不到1万。#inc

2013-08-07 19:16:51 1041

原创 孪生素数

如果n和n+2都是素数,则称它们是孪生素数。输入m,输出两个数均不超过m的最大孪生素数。5≤m≤10000。例如m=20时答案是17、19,m=1000时答案是881、883。【分析】被1和它自身整除的、大于1的整数称为素数。由于要判断n和n+2是否是素数,所以把“判断素数”可以写成一个函数,只需调用这个函数两次就可以了。这样的“判断一个事物是否具有某一性质”的函数还有一个学术名称——谓词

2013-08-04 17:07:45 3803

原创 math skill

1、(1)hypot函数的功能是计算一直角三角形的斜边长度。(2)函数hypot(x,y)表示根据直角三角形的两直解边长度x和y计算其斜边的长度。或者是从标点(x,y)到原点的距离,该函数的算法等同于sqrt(x*x+y*y)。#include#include#include#include#include#include#include#includeusing name

2013-08-04 16:18:51 992

原创 最长回文子串

输入一个字符串,求出其中最长的回文子串。子串的含义是:在原串中连续出现的字符串片段。回文的含义是:正着看和倒着看相同。如abba和yyxyy。在判断时,应该忽略所有标点符号和空格,且忽略大小写,但输出应保持原样(在回文串的首部和尾部不要输出多余字符)。输入字符串长度不超过5000,且占据单独的一行。应该输出最长的回文串,如果有多个,输出起始位置最靠左的。样例输入:Confuciuss say:

2013-08-03 23:29:12 2451

原创 hdu1010——Tempter of the Bone(DFS+剪枝)

Problem DescriptionThe doggie found a bone in an ancient maze, which fascinated him a lot. However, when he picked it up, the maze began to shake, and the doggie could feel the ground sinking. He re

2013-08-02 11:20:03 770

百度文库下载器(给力版)

百度文库下载器(给力版)

2013-03-30

dos高手速成

dos高手速成

2013-01-22

空空如也

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

TA关注的人

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