自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(29)
  • 资源 (4)
  • 收藏
  • 关注

原创 【POJ 2719 --- Faulty Odometer】

【POJ 2719 --- Faulty Odometer】DescriptionYou are given a car odometer which displays the miles traveled as an integer. The odometer has a defect, however: it proceeds from the digit 3 to the digit 5...

2019-05-31 17:34:49 300

原创 【POJ 1182 --- 食物链】

【POJ 1182 --- 食物链】Description动物王国中有三类动物A,B,C,这三类动物的食物链构成了有趣的环形。A吃B, B吃C,C吃A。现有N个动物,以1-N编号。每个动物都是A,B,C中的一种,但是我们并不知道它到底是哪一种。有人用两种说法对这N个动物所构成的食物链关系进行描述:第一种说法是"1 X Y",表示X和Y是同类。第二种说法是"2 X Y",表示X吃Y。此...

2019-05-30 22:11:41 315

原创 【POJ 2431 --- Expedition】

【POJ 2431 --- Expedition】DescriptionA group of cows grabbed a truck and ventured on an expedition deep into the jungle. Being rather poor drivers, the cows unfortunately managed to run over a rock a...

2019-05-28 15:19:35 425

原创 【POJ 3253 --- Fence Repair】

【POJ 3253 --- Fence Repair】DescriptionFarmer John wants to repair a small length of the fence around the pasture. He measures the fence and finds that he needs N (1 ≤ N ≤ 20,000) planks of wood, eac...

2019-05-25 17:04:15 348

原创 【POJ 3069 --- Saruman's Army】

【POJ 3069 --- Saruman's Army】DescriptionSaruman the White must lead his army along a straight path from Isengard to Helm’s Deep. To keep track of his forces, Saruman distributes seeing stones, known...

2019-05-25 14:52:53 200

原创 【POJ 3617 --- Best Cow Line】

【POJ 2376 --- Cleaning Shifts】DescriptionFJ is about to take his N (1 ≤ N ≤ 2,000) cows to the annual"Farmer of the Year" competition. In this contest every farmer arranges his cows in a line and he...

2019-05-25 14:16:08 210

原创 【POJ 2377 --- Bad Cowtractors】

【POJ 2377 --- Bad Cowtractors】DescriptionBessie has been hired to build a cheap internet network among Farmer John’s N (2 <= N <= 1,000) barns that are conveniently numbered 1…N. FJ has alread...

2019-05-25 13:40:15 159

原创 【POJ 2376 --- Cleaning Shifts】

【POJ 2376 --- Cleaning Shifts】DescriptionFarmer John is assigning some of his N (1 <= N <= 25,000) cows to do some cleaning chores around the barn. He always wants to have one cow working on c...

2019-05-24 16:44:20 497

原创 【POJ 2386 --- Lake Counting】

【POJ 2386 --- Lake Counting】DescriptionDue to recent rains, water has pooled in various places in Farmer John’s field, which is represented by a rectangle of N x M (1 <= N <= 100; 1 <= M &l...

2019-05-24 11:02:48 259

原创 【POJ 2201 --- Cartesian Tree】

【POJ 2201 --- Cartesian Tree】DescriptionLet us consider a special type of a binary search tree, called a cartesian tree. Recall that a binary search tree is a rooted ordered binary tree, such that f...

2019-05-24 00:01:13 296

原创 【POJ 1840 --- Eqs】

【POJ 1840 --- Eqs】DescriptionConsider equations having the following form:a1x1^3+ a2x2^3+ a3x3^3+ a4x4^3+ a5x5^3=0The coefficients are given integers from the interval [-50,50].It is consider a s...

2019-05-23 10:13:33 275

原创 【POJ 1838 --- Banana】

【POJ 1838 --- Banana】DescriptionConsider a tropical forrest, represented as a matrix. The cell from the right top corner of the matrix has the coordinates (1,1), and the coordinates of the other cel...

2019-05-22 22:59:41 266

原创 【POJ 1828 --- Monkeys' Pride】

【POJ 1828 --- Monkeys' Pride】DescriptionBackgroundThere are a lot of monkeys in a mountain. Every one wants to be the monkey king. They keep arguing with each other about that for many years. It is...

2019-05-22 14:16:29 286

原创 【POJ 1788 --- Building a New Depot】

【POJ 1788 --- Building a New Depot】DescriptionAdvanced Cargo Movement, Ltd. is successfully expanding. In order to meet new demands on truck maintenance, the management of the company decided to bui...

2019-05-22 13:48:03 176

原创 【POJ 1763 --- Shortcut】

【POJ 1763 --- Shortcut】DescriptionMirek has a favourite way from home to the university that he traverses every working day. The route consists of sections and each section is a straight segment 10 ...

2019-05-22 02:07:59 446

原创 【POJ 1852 --- Ants】

【POJ 1852 --- Ants】DescriptionAn army of ants walk on a horizontal pole of length l cm, each with a constant speed of 1 cm/s. When a walking ant reaches an end of the pole, it immediatelly falls off...

2019-05-21 14:39:35 331

原创 【POJ 1723 --- SOLDIERS】

【POJ 1723 --- SOLDIERS】DescriptionN soldiers of the land Gridland are randomly scattered around the country.A position in Gridland is given by a pair (x,y) of integer coordinates. Soldiers can move...

2019-05-21 10:40:27 966

原创 【POJ 1694 --- An Old Stone Game】

【1694 --- An Old Stone Game】DescriptionThere is an old stone game, played on an arbitrary general tree T. The goal is to put one stone on the root of T observing the following rules:At the beginni...

2019-05-20 15:20:23 313

原创 【POJ 1423 --- Big Number】

【1423 --- Big Number】DescriptionIn many applications very large integers numbers are required. Some of these applications are using keys for secure transmission of data, encryption, etc. In this pro...

2019-05-20 09:52:53 193

原创 【计算完全最短路径的Floyd算法】

【计算完全最短路径的Floyd算法】定义算法思想原理算法描述定义Floyd-Warshall算法(Floyd-Warshall algorithm)是解决任意两点间的最短路径的一种算法,可以正确处理有向图或负权的最短路径问题,同时也被用于计算有向图的传递闭包。Floyd-Warshall算法的时间复杂度为O(N3),空间复杂度为O(N2)。算法思想原理Floyd算法是一个经典的动态规划算法...

2019-05-17 17:33:48 920 2

原创 【Warshall算法】

【Warshall算法】定义方法一方法二定义方法一#include <iostream>using namespace std;int n;const int MAXN = 100;int arr[MAXN][MAXN];int main(){ cout << "请输入矩阵的阶数:"; cin >> n; cout << ...

2019-05-16 21:22:05 1094

原创 【C++】类与对象(五):多态

【C++】类与对象(五):多态1. 多态基本概念2. 向上类型转换及问题3. C++如何实现动态绑定4. 抽象基类和纯虚函数5. 纯虚函数和多继承6. 虚析构函数7. 重写,重载,重定义8. 指向类成员的指针8.1 指向成员变量的指针8.2 指向成员函数的指针8.3 指向静态成员的指针1. 多态基本概念多态是面向对象程序设计语言中数据抽象和继承之外的第三个基本特征。多态性(polymorph...

2019-05-16 01:54:12 229

原创 【C++】类与对象(四):继承和派生

【C++】类与对象(四):继承和派生1. 继承概述2. 派生类访问控制3. 继承中的构造和析构3.1 继承中的对象模型3.2 对象构造和析构的调用原则4. 继承中同名成员的处理方法5. 非自动继承的函数6. 继承中的静态成员特性(待更新)7. 多继承(待更新)1. 继承概述承是使代码可以复用的重要手段,也是面向对象程序设计的核心思想之一。简单的说,继承是指一个对象直接使用另一对象的属性和方法。...

2019-05-15 01:00:12 522

原创 【C++】类与对象(三):运算符重载

【C++】类与对象(三):运算符重载1. 运算符重载基本概念2. 运算符重载碰上友元函数3. 可重载的运算符4. 自增自减(++/--)运算符重载5. 指针(*,->)运算符重载6. 赋值(=)运算符重载7. 等于和不等于(==,!=)运算符重载8. 函数调用符号(())重载9. 不要重载&&,||10. 符号重载总结1. 运算符重载基本概念运算符重载,就是对已有的运算符...

2019-05-15 00:11:41 2057

原创 【C++】类与对象(二):面向对象模型初探,友元

【C++】类与对象(二):面向对象模型初探,友元1. 面向对象模型初探1.1 成员变量和函数的存储1.2 this指针1.2.1 this指针的工作原理1.2.2 this指针的使用1.2.3 const修饰成员函数(常函数)1.2.4 const修饰对象(常对象)2. 友元2.1 友元语法1. 面向对象模型初探1.1 成员变量和函数的存储在c语言中,成员与函数分开来声明的,也就是说,语言本...

2019-05-07 00:48:57 262

原创 【C++】类与对象(一)类和对象的基本概念,对象的构造和析构

【C++】类与对象(一)类和对象的基本概念,对象的构造和析构1. 类和对象的基本概念1.1 C和C++中struct的区别1.2 类的封装1.3 将成员变量设置为private2. 对象的构造和析构2.1 初始化和清理2.2 构造函数和析构函数2.3 构造函数的分类及调用2.4 构造函数调用规则2.5 深拷贝和浅拷贝2.6 多个对象构造和析构2.7 explicit关键字2.8 动态对象创建2.9...

2019-05-05 20:21:37 521

原创 【硬币收集问题】

【硬币收集问题】1. 问题描述2. 解决方案1. 问题描述在n*m格木板中放有一些硬币,每格的硬币数目最多为一个,在木板左上方的一个机器人需要收集尽可能多的硬币并把它们带到右下方的单元格。每一步,机器人可以从当前的位置向右移动一格或向下移动一格。当机器人遇到一个有硬币的单元格时,就会将这枚硬币收集起来。设计一个算法找出机器人能找到的最大硬币数并给出相应的路径。2. 解决方案解题思路:...

2019-05-04 12:00:11 5006 3

原创 【找零问题】

【找零问题】1. 问题描述2. 解决方案2.1 动态规划(一维数组实现)2.2 动态规划(二维数组实现)1. 问题描述需要找零的金额为n,最少要用多少面值为value[1]<value[2]<value[3]…<value[m]的硬币?2. 解决方案2.1 动态规划(一维数组实现)解题思路:设f[n]为总金额为n的数量最少的硬币数目,方便定义f[0]=0.获得n的途...

2019-05-04 11:16:57 1576

原创 【币值最大化问题】

【币值最大化问题】1. 问题描述2. 解决方案 --- 动态规划1. 问题描述给定一排n个硬币,其面值均为正整数c1,c2,…,cn,这些整数并不一定两两不同。请问如何选择硬币,使得在其原始位置互不相邻的条件下,所选硬币的总金额最大。2. 解决方案 — 动态规划解题思路:我们可以将问题划分为取最后一枚硬币和不取最后一枚硬币。根据不相邻这一条件,若取最后一枚硬币,则我们继续判断前n-2枚...

2019-05-04 09:54:51 5912 5

C Primer Plus 第6版中文高清版

畅销30余年的C语言入门教程,近百万程序员的C语言启蒙教程,技术大牛案头常备的工具书,新版第六版全新升级,针对C11标准进行全面升级。

2019-02-20

C语言程序设计(第四版)+谭浩强著高清晰版

C语言程序设计(第四版)+谭浩强著高清版,为了使用C语言编写程序,必须了解C语言,并且熟练的使用C语言,本书将由浅入深的介绍怎么阅读C语言程序和使用C语言编写程序

2019-02-09

空空如也

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

TA关注的人

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