自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 算法竞赛入门经典-前四章-UVa488 - Triangle Wave-三角波-难度1

题目链接:http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=429  Triangle Wave  In this problem you are to generate a triangular wave form acc

2013-12-18 22:08:48 720

原创 算法竞赛入门经典-前四章-UVa694 - The Collatz Sequence-Collatz序列-难度1

题目链接: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=635   The Collatz Sequence  An algorithm given by Lothar Collatz p

2013-12-18 21:09:24 622

原创 算法竞赛入门经典-前四章-UVa445 - Marvelous Mazes-非凡的迷宫-难度1

题目链接:http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=386  Marvelous Mazes  Your mission, if you decide to accept it, is to

2013-12-18 20:21:35 849

原创 算法竞赛入门经典-前四章-UVa494 - Kindergarten Counting Game-幼儿园数数游戏-难度1

题目链接: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=435                                                                   Kindergarten Counting Game

2013-12-17 22:38:51 734

原创 算法竞赛入门经典-前四章-UVa10055 - Hashmat the Brave Warrior-勇士Hashmat-难度1

题目链接: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=996 Problem A Hashmat the brave warrior Input: standard input Output: standard output

2013-12-17 21:59:07 1070

原创 算法竞赛入门经典-前四章-UVa10071 - Back to High School Physics-重温高中物理-难度0

题目链接:http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=94&page=show_problem&problem=1012 Problem B Back to High School Physics Input: standard input Output: standar

2013-12-17 21:29:01 619

原创 算法竞赛入门经典-前四章-UVa10300 - Ecological Premium-生态奖金-难度0

题目链接:http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=1241 Problem A Ecological Premium Input: standard input Output: standard output Time Limi

2013-12-17 21:09:59 644

原创 算法竞赛入门经典-课后练习-3-4

代码: #include #include #include #include #include using namespace std; vector A, B; inline bool op(const char &a)//判断是不是运算符号 { if(a == '*' || a == '+' || a == '/' || a == '-') return 1; el

2013-12-17 19:24:34 787

原创 并查集-杭电1213-How Many Tables-难度1

Problem Description Today is Ignatius' birthday. He invites a lot of friends. Now it's dinner time. Ignatius wants to know how many tables he needs at least. You have to notice that not all the fri

2013-12-16 23:37:19 431

原创 并查集-杭电1856-More is better-难度1

Problem Description Mr Wang wants some boys to help him with a project. Because the project is rather complex, the more boys come, the better it will be. Of course there are certain requirements.

2013-12-16 22:23:57 427

原创 并查集-杭电1232-畅通工程-难度1

Problem Description 某省调查城镇交通状况,得到现有城镇道路统计表,表中列出了每条道路直接连通的城镇。省政府“畅通工程”的目标是使全省任何两个城镇间都可以实现交通(但不一定有直接的道路相连,只要互相间接通过道路可达即可)。问最少还需要建设多少条道路?    Input 测试输入包含若干测试用例。每个测试用例的第1行给出两个正整数,分别是城镇数目N

2013-12-16 21:56:09 533

原创 基础算法(2):快速排序(随机划分+三数取中划分+ 随机三数取中划分+尾递归)

快速排序:                  简介:快速排序是一种排序算法,包含n个数的输入数组,最坏情况为O(n^2),但是平均性能非常好:期望运行时间为O(n*lg(n))。                  基本思想:通过 一次划分得到一个主元在集合中的位置。                  影响因素:划分算法决定着一个快速排序的效率。

2013-12-10 10:07:17 2290

原创 基础算法(1):最值(最大值,最小值,同时求最大值和最小值)

一.寻找最小值和最大值。         方法: 遍历一遍元素集合,获得最值。         代码:                  最小值:  void findMin(const vector &num, int &min) { min = num[0]; vector::const_iterator iter; /*常量引用使用 const_iterator; 非常量使用

2013-12-09 20:54:17 1338

原创 OpenCV(3)-视频播放控制

OpenCV第三课(支持滚动条随着视频播放自动移动) /*第三个OpenCV程序*/ #include "opencv/cv.h" #include "opencv/highgui.h" int g_slider_position = 0; CvCapture *g_capture = NULL; void onTrackbarSlide(int pos) { /* * Function

2013-12-09 19:16:41 1433

原创 OpenCV(2)-播放AVI视频

OpenCV第二课。 /*第二个OpenCV程序*/ #include "opencv/highgui.h" int main(int argc, char **argv) { cvNamedWindow("Example2", CV_WINDOW_AUTOSIZE); //CvCapture *capture = cvCreateFileCapture(argv[1]); //CvCa

2013-12-09 15:09:02 696

原创 OpenCV(1)-初试牛刀--显示图像

学习OpenCV第一课。 /* 第一OpenCV程序 */ #include "opencv/highgui.h" int main(int argc, char** argv) { IplImage* img = cvLoadImage("1.jpg", 0); /* * C语言版本: IplImage* cvLoadImage(const char* filename,

2013-12-06 09:43:45 607

原创 UVa-10020 - Minimal coverage

The Problem Given several segments of line (int the X axis) with coordinates [Li,Ri]. You are to choose the minimal amount of them, such they would completely cover the segment [0,M]. The Inpu

2013-12-05 21:50:12 583

转载 MFC工具栏真彩图贴图设计

一步步制作VC++6.0的真彩工具条 例子程序最终效果图:   一直在寻找制作一个 24bit 及以上真彩工具条的简单有效方法,在各种VC站点都找到了很多有关这方面的文章和介绍,但是都存在一个不足的地方,介绍的不够详细,对初学者来说有点难度。最近终于有所发现,因此在这里将自己在制作真彩工具条方面的小经验介绍给大家,以期抛砖引玉。   在这里将介绍两个重点的内容,一个是制作真彩工

2013-11-04 21:43:52 1128

原创 数组排序

给定一个包含1-n的数列,我们通过交换任意两个元素给数列重新排序。求最少需要多少次交换,能把数组排成按1-n递增的顺序,其中,数组长度不超过100。 例如: 原数组是3,2,1, 我们只需要交换1和3就行了,交换次数为1,所以输出1。 原数组是2,3,1,我们需要交换2和1,变成1,3,2,再交换3和2,变为1,2,3,总共需要的交换次数为2,所以输出2。 函数

2013-10-23 19:56:52 437

原创 c++for循环小疑惑

#include using namespace std;char msg[] ="Now is the time.\n";int main(){ char * cp; int i; for(cp = msg; cp[0] ; cp++) cout return 0;}cp[0]是什么意思? 在for循环中,for(expression1;expression2;expression3)

2013-10-23 16:18:14 485 1

空空如也

空空如也

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

TA关注的人

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