自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(18)
  • 问答 (6)
  • 收藏
  • 关注

原创 C++ 双冒号::符号详解

一、作用域符号:作用域符号::的前面一般是类名称,后面一般是该类的成员名称,C++ 为例避免不同的类有名称相同的成员而采用作用域的方式进行区分。例如:A,B 表示两个类,在 A,B 中都有成员 member。那么:1、A::member就表示类A中的成员member。 2、B::member就表示类B中的成员member。二、全局作用域符号:全局作用域符号:当全局变量在局部函数中与其中某个变量重名,那么就可以用::来区分,例如:char zhou; //全局变量...

2021-11-25 16:03:38 11682 1

原创 C++ vector::size()返回值

vector.size()返回值类型为size_type,Member typesize_typeis an unsigned integral type,即无符号整数。

2021-10-26 15:29:33 1240

原创 C++ vector::end() 函数以及如何获取最后一个元素方法

vector::end() 是 "vector" 头文件的库函数,可用于获取向量的最后一个元素。它返回一个指向向量的 past-the-end 元素的迭代器。注意:要使用矢量,请包括<vector>标题。 它不指向最后一个元素,因此要获取我们可以使用的最后一个元素vector::end()-1。vector::end() 函数的语法 vector::end();参数:none——它什么都不接受。返回值:iterator– 它返回一个指向向量的 past-th..

2021-10-26 15:06:51 24788

原创 源码安装gcc4.4.6记录(包含error: Building GCC requires GMP 4.2+, MPFR 2.3.1+ and MPC 0.8.0解决方法)

源码安装gcc4.4.6记录环境操作系统:centos6.5当前gcc版本:4.4.7目标gcc版本:4.4.6具体步骤去官网下载所需gcc版本http://mirrors.concertpass.com/gcc/releases/gcc-4.4.6/解压缩安装包tar -zxvf gcc-4.4.6.tar.bz2进入安装包cd gcc-4.4.6新建安装目录mkdir /opt/gcc-4.4.6执行配置文件./configure --prefix=/opt/gcc

2021-01-30 09:43:33 453

原创 CentOs 6 yum换源记录

CentOs 6 yum换源记录cd /etc/yum.repos.d/mkdir bakmv * bak/curl -o /etc/yum.repos.d/CentOS-Base.repohttp://file.kangle.odata.cc/repo/Centos-6.repocurl -o /etc/yum.repos.d/epel.repohttp://file.kangle.odata.cc/repo/epel-6.repoyum clean allyum makecache..

2021-01-24 15:04:27 187

原创 E - 二分

It is very hard to wash and especially to dry clothes in winter. But Jane is a very smart girl. She is not afraid of this boring process. Jane has decided to use a radiator to make drying faster. But ...

2018-08-04 15:04:55 195

原创 D - 贪心

Given m sequences, each contains n non-negative integer. Now we may select one number from each sequence to form a sequence with m integers. It's clear that we may get n ^ m this kind of sequences. Th...

2018-08-03 15:21:41 117

原创 C - map

You have just moved from Waterloo to a big city. The people here speak an incomprehensible dialect of a foreign language. Fortunately, you have a dictionary to help you understand them.InputInput ...

2018-08-02 15:56:51 712

原创 F - 递推

我们看到过很多直线分割平面的题目,今天的这个题目稍微有些变化,我们要求的是n条折线分割平面的最大数目。比如,一条折线可以将平面分成两部分,两条折线最多可以将平面分成7部分,具体如下所示。 Input输入数据的第一行是一个整数C,表示测试实例的个数,然后是C 行数据,每行包含一个整数n(0&lt;n&lt;=10000),表示折线的数量。  Output对于每个测试实例,请输出平面...

2018-08-01 16:55:48 179

原创 E - 贪心

FatMouse prepared M pounds of cat food, ready to trade with the cats guarding the warehouse containing his favorite food, JavaBean. The warehouse has N rooms. The i-th room contains J[i] pounds of Ja...

2018-08-01 16:44:01 370

原创 D - stl 的 map

Once again, James Bond is fleeing from some evil people who want to see him dead. Fortunately, he has left a bungee rope on a nearby highway bridge which he can use to escape from his enemies. His pla...

2018-08-01 16:41:22 111

原创 C - stl 的 map

夏天来了~~好开心啊,呵呵,好多好多水果~~ Joe经营着一个不大的水果店.他认为生存之道就是经营最受顾客欢迎的水果.现在他想要一份水果销售情况的明细表,这样Joe就可以很容易掌握所有水果的销售情况了. Input第一行正整数N(0&lt;N&lt;=10)表示有N组测试数据. 每组测试数据的第一行是一个整数M(0&lt;M&lt;=100),表示工有M次成功的交易.其后有M行数据,每...

2018-08-01 16:38:14 386

原创 B - stl 的 map

Ignatius is so lucky that he met a Martian yesterday. But he didn't know the language the Martians use. The Martian gives him a history book of Mars and a dictionary when it leaves. Now Ignatius want ...

2018-08-01 14:19:04 163

原创 A - stl 的 map

Contest 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 is over, they will cou...

2018-08-01 14:16:38 232

原创 B - Treasure the new start, freshmen!

background:  A new semester comes , and the HDU also meets its 50th birthday. No matter what's your major, the only thing I want to tell you is:"Treasure the college life and seize the time." Most p

2018-01-30 22:50:38 264

原创 P - 不容易系列之(4)——考新郎

国庆期间,省城HZ刚刚举行了一场盛大的集体婚礼,为了使婚礼进行的丰富一些,司仪临时想出了有一个有意思的节目,叫做"考新郎",具体的操作是这样的:  首先,给每位新娘打扮得几乎一模一样,并盖上大大的红盖头随机坐成一排; 然后,让各位新郎寻找自己的新娘.每人只准找一个,并且不允许多人找一个. 最后,揭开盖头,如果找错了对象就要当众跪搓衣板... 看来做新郎也不是容易的事情.

2018-01-26 10:57:58 215

原创 O-神、上帝以及老天爷

HDU 2006'10 ACM contest的颁奖晚会隆重开始了! 为了活跃气氛,组织者举行了一个别开生面、奖品丰厚的抽奖活动,这个活动的具体要求是这样的: 首先,所有参加晚会的人员都将一张写有自己名字的字条放入抽奖箱中; 然后,待所有字条加入完毕,每人从箱中取一个字条; 最后,如果取得的字条上写的就是自己的名字,那么“恭喜你,中奖了!” 大家可以想象一下当时的气氛之

2018-01-26 09:47:21 201

原创 K - 一只小蜜蜂...

有一只经过训练的蜜蜂只能爬向右侧相邻的蜂房,不能反向爬行。请编程计算蜜蜂从蜂房a爬到蜂房b的可能路线数。 其中,蜂房的结构如下所示。  Input输入数据的第一行是一个整数N,表示测试实例的个数,然后是N 行数据,每行包含两个整数a和b(0Output对于每个测试实例,请输出蜜蜂从蜂房a爬到蜂房b的可能路线数,每个实例的输出占一行。 Sample Input

2018-01-23 15:49:15 106

空空如也

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

TA关注的人

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