c++类 重载 继承 多态

知识点总结 一·运算符重载 将运算符看作是一种特殊的函数,将操作数看作参数,运算结果作为返回值。如果运算符也可以被看作是函数则也可以重载。 因为运算符只限制于系统本来就定义好的数据类型如int,double等。 1.重载方式 类似于普通函数但函数名由关键字operator和要重载的符号,返回值类型...

2019-06-23 00:51:49

阅读数 7

评论数 0

系统开发心得感想

系统总结 到现在也是写了几个小系统了图书管理,通讯录,atm。也有着不小的收获,对系统开发多少是有了点认识。 1.首先需要将大体的类和每个类所要实现的功能构思一下然后将其以用大体的代码写出来不需要实现只要把函数名写出来明白每个函数之间的功能,用什么容器来存储操作数据如何才能使代码更加简洁,以及做好...

2019-06-22 21:34:04

阅读数 60

评论数 0

Email from Polycarp cf

cf1185b 题目大意就是 一个人的键盘坏了 他的键盘每次按下去一个键就会出现一个至多个该字母 有n组数据 每次输入两个字符串 a,b问是否有可能在键盘上输入a的时候会输出b这个字符串。 思路,因为是按顺序输入 所以只需要按照a的顺序遍历看b是否符合这里要注意一个坑就是当有很多个相同的字母联在一...

2019-06-20 23:28:18

阅读数 133

评论数 0

Plus from Picture

Plus from Picture You have a given picture with size w×hw×h. Determine if the given picture has a single “+” shape or not. A “+” shape is described ...

2019-06-13 21:03:21

阅读数 46

评论数 0

POJ - 1951

A krunched word has no vowels (“A”, “E”, “I”, “O”, and “U”) and no repeated letters. Removing vowels and letters that appear twice or more from MISSI...

2019-06-12 22:14:46

阅读数 4

评论数 0

Best Cow Fences

POJ - 2018 这个题感受很多是个二分好题 用到了很好的技巧。 题意给你n个牛的自身价值,让你找出连续的且数量大于等于F的一段区间,使这段区间内的牛的平均价值最大。将其转化为二分很不好想 枚举平均值然后计算差值的前缀和与0比较省去不少麻烦 (还是见得少) Farmer John’s fa...

2019-06-08 23:01:29

阅读数 10

评论数 0

POJ - 3660

Cow Contest N (1 ≤ N ≤ 100) cows, conveniently numbered 1…N, are participating in a programming contest. As we all know, some cows code better than...

2019-06-08 20:55:52

阅读数 5

评论数 0

POJ - 3661

Running The cows are trying to become better athletes, so Bessie is running on a track for exactly N (1 ≤ N ≤ 10,000) minutes. During each minute, ...

2019-06-08 20:49:46

阅读数 7

评论数 0

训练总结

今天被一个曾经做过的二分题给卡住了很难受也发现了自己的一些毛病,做题太想当然了做过的题目没有完全的理解它导致其中的小细节没有思考到还有就是求最大值的时候总是喜欢用sort排序一下然后就把sort之后数组的最后一位拿来做最大值用这样就会错(很难受)也当做是一次教训吧以前也遇到过这种错误但是没有警戒起...

2019-06-07 11:21:20

阅读数 9

评论数 0

poj3268

One cow from each of N farms (1 ≤ N ≤ 1000) conveniently numbered 1…N is going to attend the big cow party to be held at farm #X (1 ≤ X ≤ N). A total...

2019-06-05 22:05:04

阅读数 11

评论数 0

POJ2189

Farmer John has two feuding herds of cattle, the Moontagues and the Cowpulets. One of the bulls in the Moontague herd, Romeo, has fallen in love with...

2019-06-04 20:02:30

阅读数 11

评论数 0

B. Ehab Is an Odd Person

B. Ehab Is an Odd Person You’re given an array a of length n. You can perform the following operation on it as many times as you want: Pick two inte...

2019-06-04 19:27:11

阅读数 49

评论数 0

The puzzle

The puzzle Kayaking is playing a puzzle game containing n different blocks. He marks the blocks with integers from 1 to n, which show the blocks’ or...

2019-06-02 23:20:22

阅读数 7

评论数 0

hdu flower

Flower Rabbit loves flowers very much and she plants n pots of flowers in her house. But she never prunes them because she is lazy. So the flowers ...

2019-06-02 17:12:23

阅读数 2

评论数 0

A Hard Allocation

A Hard Allocation One day, WNJXYK came out an excellent idea that he could give his friends his special cakes which made of kiwis to eat in parties....

2019-06-02 14:43:37

阅读数 6

评论数 0

A Count Task

A Count Task Count is one of WNJXYK’s favorite tasks. Recently, he had a very long string and he wondered that how many substrings which contains e...

2019-06-02 14:20:40

阅读数 4

评论数 0

acm总结

今天也是开了试水题目啊啊感觉自己好水刚开一个小时把四个简单题做出来剩下的就光按住一个题从哪里钻牛角尖等到发现另一个简单题的时候时间已经不够了。两个思维题一个深搜一个最短路径本来看着这个最短路径数据量挺小的1000个就寻思着直接三重循环暴力了结果超时了又用的 dijistra算法解决的emm怎么说呢...

2019-05-29 22:56:34

阅读数 10

评论数 0

acm学习总结

最短路径floyed算法思想用到三重循环枚举区间的起点终点和中间节点来不断松弛就可以找到最短路径但是三重循环太费时间。 dijkstra算法比佛洛依德快只需要两个循环 起点只有一个的情况枚举每个节点到起点的最短距离(用一维数组的下标来表示终点来存储) 不断地选取起点到某一个点的最短路径来松弛其他可...

2019-05-25 23:44:47

阅读数 15

评论数 0

cf 805c

A few years ago Sajjad left his school and register to another one due to security reasons. Now he wishes to find Amir, one of his schoolmates and go...

2019-05-25 21:40:34

阅读数 13

评论数 0

cf 805d

We have a string of letters ‘a’ and ‘b’. We want to perform some operations on it. On each step we choose one of substrings “ab” in the string and re...

2019-05-25 21:33:10

阅读数 7

评论数 0

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