-
函数
eg: #includeiostream using namespace std; int i; // 全局变量在整个程序中皆能使用,若与函数冲突则在该函数中使用该函数内的变量 int jiaohuan( int x,y) // 函数类型为整型,与定义变量类似;""意为别名 { int i; // 局部变量在该函数中使用 i=x;x=y;y= i;} int ma...
2018-06-17 22:10:42
-
HDU 6040---Hints of sd0061(STL)
题目链接 Problem Description sd0061 , the legend of Beihang University ACM-ICPC Team, retired last year leaving a group of noobs. Noobs have no idea how to deal with m coming contests. sd0061 has left a set of hints for them. There are n noobs in th...
2018-06-17 22:10:38
-
0-1背包问题(the knapsack problem)
---恢复内容开始--- 关键原理:动态规划。 tab[i][j] = max(tab[i- 1 ][j-weight[i]]+value[i],tab[i- 1 ][j]) ({i,j| 0 i=n, 0 =j=total}) i表示放第i个物品,j表示背包所容纳的重量,那么tab[i-1][j-weight[i]]+value[i]表示放入第i物品。 流程: 状态转移方程:...
2018-06-17 22:10:40
-
P2894 [USACO08FEB]酒店Hotel
题目描述 The cows are journeying north to Thunder Bay in Canada to gain cultural enrichment and enjoy a vacation on the sunny shores of Lake Superior. Bessie, ever the competent travel agent, has named the Bullmoose Hotel on famed Cumberland Street...
2018-06-17 22:10:35
-
P3369 【模板】普通平衡树(Treap/SBT)
题目描述 您需要写一种数据结构(可参考题目标题),来维护一些数,其中需要提供以下操作: 插入x数 删除x数(若有多个相同的数,因只删除一个) 查询x数的排名(若有多个相同的数,因输出最小的排名) 查询排名为x的数 求x的前驱(前驱定义为小于x,且最大的数) 求x的后继(...
2018-06-17 22:10:33
-
关于c++预编译符的使用
(该内容是在观看了孙鑫老师的MFC教程后,觉得有必要记录的) 在学习c++时,我们经常会用到#include,#define两种预编译符,很简单,前者是一种引用文件的方法,后者是宏定义的方法。 引用文件,在你写的源代码前可以引用其他文件,将其他文件中的内容直接进行使用。常...
2018-06-17 22:10:25
-
P3381 【模板】最小费用最大流
题目描述 如题,给出一个网络图,以及其源点和汇点,每条边已知其最大流量和单位流量费用,求出其网络最大流和在最大流情况下的最小费用。 输入输出格式 输入格式: 第一行包含四个正整数N、M、S、T,分别表示点的个数、有向边的个数、源点序号、汇点序号。 接下来M行...
2018-06-17 22:10:29
-
Vijos1982 NOIP2015Day2T2 子串 substring 动态规划
子串 (substring.cpp/c/pas) 题目链接 【问题描述】 有两个仅包含小写英文字母的字符串 A 和 B。现在要从字符串 A 中取出 k 个 互不重叠 的非空子串,然后把这 k 个子串按照其在字符串 A 中出现的顺序依次连接起来得到一 个新的字符串,请问有多少种方案可以使得这个新...
2018-06-17 22:10:25
-
HDU 6034---Balala Power!(搜索+贪心)
题目链接 Problem Description Talented Mr.Tang has n strings consisting of only lower case characters. He wants to charge them with Balala Power (he could change each character ranged from a to z into each number ranged from 0 to 25 , but each two di...
2018-06-17 22:10:12
-
C++学习(九)入门篇——String类
可以用string类而不是字符数组来存储字符串,string更加简单 要是用string类,则要在程序中包含头文件string,且位于std名称空间中,string类隐藏了字符串的数组性质,可以像处理普通变量那样处理字符串 程序清单4. 7 strtype1.cpp // strtypel.cpp - - using the C++...
2018-06-17 22:10:22
IDC资讯: 主机资讯 注册资讯 托管资讯 vps资讯 网站建设
网站运营: 建站经验 策划盈利 搜索优化 网站推广 免费资源
网络编程: Asp.Net编程 Asp编程 Php编程 Xml编程 Access Mssql Mysql 其它
服务器技术: Web服务器 Ftp服务器 Mail服务器 Dns服务器 安全防护
软件技巧: 其它软件 Word Excel Powerpoint Ghost Vista QQ空间 QQ FlashGet 迅雷
网页制作: FrontPages Dreamweaver Javascript css photoshop fireworks Flash




