自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(193)
  • 资源 (2)
  • 收藏
  • 关注

原创 strncpy、strcpy_s、 strncpy_s、strlcpy、strncat、strcat_s、 strncat_s、 strlcat等字符串函数汇总

调查报告:整理并用实验比较分析strncpy、strcpy_s、 strncpy_s、strlcpy、strncat、strcat_s、 strncat_s、 strlcat等函数的异同包含在头文件 string .h 中。Strncpy: 函数原型:char *strncpy( char *dest, const char *src, std::size_t count );比较:str...

2019-10-25 09:11:47 4192

原创 单字节字符串、宽字符串和多字节字符串

调查报告:了解单字节字符串、宽字符串 和多字节字符串等C/C++语言字符串表示方 法,总结其原理、存储、操作、应用等特 征,并编制报告。单字节字符串(Single-Byte): 原理:每个字符用一个字节表示。这就决定了单字节字符集不可能包含256个以上 的字符。单字节字符包含拉丁文字母表,重音字符(accented characters)及ASCII标准和DOS操作系统定义的图形字符。存储:一个...

2019-10-25 09:07:55 2472

原创 Canary栈保护机制

实验要求:调研 VC .net 或 GCC 4.*中的 Canary 技术实现, 弄懂原理并设计相应的实验例程进行测试,编制相应 报告。实验环境:Windows 10, 编译器配置为 TDM-GCC 4.8.1 64-BIT Debug实验主题:调研 GCC 4.*中的 Canary 技术:原理:1、 在所有函数调用发生时,向栈帧内压入一个额外的随机 DWORD,这个随机数被称作“c...

2019-10-25 08:55:12 4138

原创 【BZOJ 2120】 数颜色 (分块,蛮力)

2120: 数颜色 Description墨墨购买了一套N支彩色画笔(其中有些颜色可能相同),摆成一排,你需要回答墨墨的提问。墨墨会像你发布如下指令: 1、 Q L R代表询问你从第L支画笔到第R支画笔中共有几种不同颜色的画笔。 2、 R P Col 把第P支画笔替换为颜色Col。为了满足墨墨的要求,你知道你需要干什么了吗?Input第1行两个整数N,M,分别代表初始画笔的数量以及墨墨会做的事情的

2019-10-25 08:45:05 628

原创 缓冲区溢出实验

实验背景:根据以上实例,在 VC6 环境下达到 绕开目的。另外,能不能通过缓冲区溢出 修改PwStatus达到绕开口令验证的目的? 为什么?纪录过程并编制报告实验环境: window XP ,VC++ 6.0实验原理:栈上的缓冲区溢出覆盖了栈中的数据的 时候,会导致栈粉碎(stack smashing)。本次实验采用:覆盖返回地址实验代码截图:分析栈的状态,如下图,我们利用gets()...

2019-10-25 08:36:43 940

原创 类型安全&弱类型安全

调查报告:什么是类型安全?什么是弱类型语言?举例说明之类型安全代码指访问被授权可以访问的内存位置。“类型安全”常被用来形容编程语言,其根据在于该门编程语言是否提供保障类型安全的机制;有的时候也用“类型安全”形容某个程序,判别的标准在于该程序是否隐含类型错误。强类型和弱类型主要是站在变量类型处理的角度进行分类的。强类型是指不允许隐式变量类型转换。弱类型则允许隐式类型...

2019-10-25 08:31:38 445

原创 针对各种字符串计算其所需存储空间长度(报告素材)

首先计算 单字节字符,宽字符 所需的储存空间长度分别是sizeof(char) = 1;sizeof(wchar_t) = 2;并举例说明各字符串所需存 储空间长度(byte为单位)char a[] = “12345”; //单 长度为6char b[] = “1234中”; //多 长度为7wchar_t c[] = L"12345";//宽 长度为12实验结果截图:...

2019-10-25 08:28:48 3433

原创 return-into-libc 实验(报告)

实验说明return-into-libc 方式(又称 arc injection)的 漏洞利用可以在不注入代码的情况下达到 攻击利用目的– 使用已经存在代码的地址覆盖返回地址,通常 为一个函数的地址及相应的参数,如 system()、 exec()等– 当返回时,通过调用 system()、exec()等函数, 执行攻击者指定的系统命令(函数参数中指定)– 利用 return-into-l...

2019-10-22 15:26:55 913 2

原创 实现矩阵链乘问题的备忘录算法

矩阵连乘的两个常见算法思路:区间动态规划(由下而上计算最优子结构)备忘录算法(topdown)递归时代记忆化搜索步骤:m[i][j] 记录 i 到 j 的最优结果,初始化为-1;//min_matrix_OP_beiwanglu #include <iostream> #include <stdio.h>#include <string.h&g...

2019-10-21 13:36:49 883

原创 【UOJ #218. 【UNR #1】】火车管理 可持久化线段树

题目: uoj 旗下有一个火车站,用来管理属于 uoj 的小火车。火车站一共有 n n 条编号为 1,…,n 1,…,n 的,只有一端的用来存放小火车的铁路,由于小火车特殊的构造,每条铁路可以停放无数辆小火车。每条铁路是相互独立的。铁路是一个栈结构,后停放的小火车可以先出来。每辆小火车有一个吨位 t t 。由于 NOI2016 即将到来,想要跟小火车正面作战的人多了起来,火车站管

2016-07-19 15:35:36 1007

原创 [hdu 2586](LCA Tarjan算法)

算法参考:http://cache.baiducontent.com/c?m=9f65cb4a8c8507ed4fece763105392230e54f73c6f888b442282c45f93130a1c187bb8e7737f0704a5932b2152f4174bea863570330620b390df883d87fdcd763bcd7a742613913717c46ed8dc3653d654

2016-07-16 16:49:49 877

原创 动态区间第k小 分块 O(nlogn*sqrt(nlogn))

代码:#include<iostream>#include<string.h>#include<stdio.h>#include<algorithm>#include<cmath>using namespace std;int n,q;struct node{ int x,y;}a[100005];int b[100008];int L[8005],R[8005];in

2016-06-14 19:33:41 1149

原创 单调栈应用

题意大概让算t秒每一秒的最短路和,每条边每秒dis++;dp算距离dis[i][j]:1到i点走j条边的最短路O(n(n+ m)); 单调栈维护个上凸; 等差数列n^2求解; 代码:#include<iostream>#include<stdio.h>#include<string.h>#include<queue>#include<vector>using namespace st

2016-06-13 18:30:42 1011

原创 【poj 2976】 Dropping tests 二分(分数优化)

题目:http://poj.org/problem?id=2976Dropping testsTime Limit: 1000MS Memory Limit: 65536K Total Submissions: 9121 Accepted: 3194 DescriptionIn a certain course, you take n tests. If you get ai out of

2016-06-01 18:42:37 3181 1

原创 【poj 3150】Cellular Automaton 矩阵

题目:http://poj.org/problem?id=3150Cellular Automaton 矩阵乘法+二分 Cellular AutomatonTime Limit: 12000MS Memory Limit: 65536K Total Submissions: 3544 Accepted: 1428 Case Time Limit: 2000MS DescriptionA

2016-06-01 18:33:05 3141

原创 【poj 3164】Command Network 最小树形图

题目:http://poj.org/problem?id=3164Command NetworkTime Limit: 1000MS Memory Limit: 131072K Total Submissions: 16037 Accepted: 4623 DescriptionAfter a long lasting war on words, a war on arms finally

2016-06-01 15:17:16 1199

原创 【poj 3159】Candies 差分约束+spfa(stack)

题目:http://poj.org/problem?id=3159CandiesTime Limit: 1500MS Memory Limit: 131072K Total Submissions: 28008 Accepted: 7728 DescriptionDuring the kindergarten days, flymouse was the monitor of his cla

2016-05-31 10:33:51 830

原创 【poj 2983】Is the Information Reliable? 差分约束

题目:http://poj.org/problem?id=2983Is the Information Reliable? Time Limit: 3000MS Memory Limit: 131072K Total Submissions: 12535 Accepted: 3943 DescriptionThe galaxy war between the Empire Draco an

2016-05-30 21:33:06 3481 1

原创 [poj 1201]Intervals 差分约束

题目:http://poj.org/problem?id=1201Intervals Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 24502 Accepted: 9317 DescriptionYou are given n closed, integer intervals [ai, bi] and n integ

2016-05-30 20:36:07 3556

原创 [poj 3342]Party at Hali-Bula 树形dp

题目链接:http://poj.org/problem?id=3342 Party at Hali-BulaTime Limit: 2000MS Memory Limit: 65536K Total Submissions: 5997 Accepted: 2140 DescriptionDear Contestant,I’m going to have a party at my vill

2016-05-30 15:24:47 3001

原创 1619: [Usaco2008 Nov]Guarding the Farm 保卫牧场 搜索

题目:http://www.lydsy.com/JudgeOnline/problem.php?id=1619 1619: [Usaco2008 Nov]Guarding the Farm 保卫牧场 Time Limit: 5 Sec Memory Limit: 64 MB Submit: 694 Solved: 306 [Submit][Status][Discuss] Descri

2016-05-17 19:59:49 2766

原创 bzoj1618: [Usaco2008 Nov]Buying Hay 购买干草 完全背包

题目:http://www.lydsy.com/JudgeOnline/problem.php?id=1618 1618: [Usaco2008 Nov]Buying Hay 购买干草 Time Limit: 5 Sec Memory Limit: 64 MB Submit: 939 Solved: 481 [Submit][Status][Discuss] Description约翰

2016-05-17 19:56:52 2860

原创 [bzoj 1617]: [Usaco2008 Mar]River Crossing渡河问题 dp

题目:http://www.lydsy.com/JudgeOnline/problem.php?id=16171617: [Usaco2008 Mar]River Crossing渡河问题 Time Limit: 5 Sec Memory Limit: 64 MB Submit: 867 Solved: 627 [Submit][Status][Discuss] DescriptionF

2016-05-17 19:54:14 2822

原创 【bzoj1617】: [Usaco2008 Mar]River Crossing渡河问题 dp

题目:http://www.lydsy.com/JudgeOnline/problem.php?id=16171617: [Usaco2008 Mar]River Crossing渡河问题 Time Limit: 5 Sec Memory Limit: 64 MB Submit: 867 Solved: 627 [Submit][Status][Discuss] DescriptionF

2016-05-17 16:48:55 1446

原创 【bzoj 1616】: [Usaco2008 Mar]Cow Travelling游荡的奶牛 dp

题目:http://www.lydsy.com/JudgeOnline/problem.php?id=16161616: [Usaco2008 Mar]Cow Travelling游荡的奶牛 Time Limit: 5 Sec Memory Limit: 64 MB Submit: 1033 Solved: 569 [Submit][Status][Discuss] Descriptio

2016-05-17 14:31:28 909

原创 BZOJ 1615: [Usaco2008 Mar]The Loathesome Hay Baler麻烦的干草打包机 bfs

题目:http://www.lydsy.com/JudgeOnline/problem.php?id=16151615: [Usaco2008 Mar]The Loathesome Hay Baler麻烦的干草打包机 Time Limit: 5 Sec Memory Limit: 64 MB Submit: 741 Solved: 296 [Submit][Status][Discuss]

2016-05-17 14:04:53 921

原创 【BZOJ 1614】: [Usaco2007 Jan]Telephone Lines架设电话线 spfa+二分

题目:http://www.lydsy.com/JudgeOnline/problem.php?id=16141614: [Usaco2007 Jan]Telephone Lines架设电话线 Time Limit: 5 Sec Memory Limit: 64 MB Submit: 1321 Solved: 566 [Submit][Status][Discuss] Descripti

2016-05-17 10:31:25 859

原创 【bzoj 1604】: [Usaco2008 Open]Cow Neighborhoods 奶牛的邻居 set+并查集

题目:http://www.lydsy.com/JudgeOnline/problem.php?id=16041604: [Usaco2008 Open]Cow Neighborhoods 奶牛的邻居 Time Limit: 5 Sec Memory Limit: 64 MB Submit: 783 Solved: 305 [Submit][Status][Discuss] Descri

2016-05-17 09:42:20 873

原创 [bzoj 1613]: [Usaco2007 Jan]Running贝茜的晨练计划 dp

题目:http://www.lydsy.com/JudgeOnline/problem.php?id=1613 1613: [Usaco2007 Jan]Running贝茜的晨练计划 Time Limit: 5 Sec Memory Limit: 64 MB Submit: 1509 Solved: 731 [Submit][Status][Discuss] Description奶牛

2016-05-16 21:15:28 4475

原创 [BZOJ1612][Usaco2008 Jan]Cow Contest奶牛的比赛 dfs

题目:http://www.lydsy.com/JudgeOnline/problem.php?id=1612 1612: [Usaco2008 Jan]Cow Contest奶牛的比赛 Time Limit: 5 Sec Memory Limit: 64 MB Submit: 924 Solved: 613 [Submit][Status][Discuss] DescriptionF

2016-05-16 19:22:12 3901 1

原创 【bzoj 1611】 [Usaco2008 Feb]Meteor Shower流星雨 bfs

题目:http://www.lydsy.com/JudgeOnline/problem.php?id=1611 1611: [Usaco2008 Feb]Meteor Shower流星雨 Time Limit: 5 Sec Memory Limit: 64 MB Submit: 1272 Solved: 557 [Submit][Status][Discuss] Description

2016-05-16 16:40:39 3724

原创 【bzoj 1610: [Usaco2008 Feb]Line连线游戏】 枚举

题目:http://www.lydsy.com/JudgeOnline/problem.php?id=1610 1610: [Usaco2008 Feb]Line连线游戏 Time Limit: 5 Sec Memory Limit: 64 MB Submit: 1798 Solved: 808 [Submit][Status][Discuss] DescriptionFarmer J

2016-05-16 14:42:58 812

原创 [bzoj1609]: [Usaco2008 Feb]Eating Together麻烦的聚餐 递推

题目:http://www.lydsy.com/JudgeOnline/problem.php?id=16091609: [Usaco2008 Feb]Eating Together麻烦的聚餐 Time Limit: 10 Sec Memory Limit: 64 MB Submit: 1315 Solved: 792 [Submit][Status][Discuss] Descript

2016-05-16 14:32:47 832

原创 [bzoj 1607] [Usaco2008 Dec]Patting Heads 轻拍牛头 筛数

题目:http://www.lydsy.com/JudgeOnline/problem.php?id=1607 1607: [Usaco2008 Dec]Patting Heads 轻拍牛头 Time Limit: 3 Sec Memory Limit: 64 MB Submit: 1654 Solved: 874 [Submit][Status][Discuss] Descripti

2016-05-16 13:59:16 1218

原创 【bzoj 1606】 [Usaco2008 Dec]Hay For Sale 购买干草 01背包

1606: [Usaco2008 Dec]Hay For Sale 购买干草 Time Limit: 5 Sec Memory Limit: 64 MB Submit: 978 Solved: 735 [Submit][Status][Discuss] Description约翰遭受了重大的损失:蟑螂吃掉了他所有的干草,留下一群饥饿的牛.他乘着容量为C(1≤C≤50000)个单位的马车,

2016-05-16 11:24:11 3599

原创 [bzoj1603]: [Usaco2008 Oct]打谷机 搜索

题目:http://www.lydsy.com/JudgeOnline/problem.php?id=1603 1603: [Usaco2008 Oct]打谷机 Time Limit: 5 Sec Memory Limit: 64 MB Submit: 801 Solved: 615 [Submit][Status][Discuss] DescriptionFarmer John有一个

2016-05-16 09:43:23 848

原创 bzoj1602: [Usaco2008 Oct]牧场行走 暴力dfs

题目:http://www.lydsy.com/JudgeOnline/problem.php?id=1602 1602: [Usaco2008 Oct]牧场行走 Time Limit: 5 Sec Memory Limit: 64 MB Submit: 1682 Solved: 867 [Submit][Status][Discuss] DescriptionN头牛(2<=n<=10

2016-05-16 09:41:08 804

原创 [bzoj1601]: [Usaco2008 Oct]灌水牧场行走 最小生成树

题目:http://www.lydsy.com/JudgeOnline/problem.php?id=1602 1602: [Usaco2008 Oct]牧场行走 Time Limit: 5 Sec Memory Limit: 64 MB Submit: 1678 Solved: 865 [Submit][Status][Discuss] DescriptionN头牛(2<=n<=10

2016-05-16 09:37:05 761

原创 [bzoj 1600]建造栅栏 递推

题目:http://www.lydsy.com/JudgeOnline/problem.php?id=1600 1600: [Usaco2008 Oct]建造栅栏 Time Limit: 5 Sec Memory Limit: 64 MB Submit: 1132 Solved: 683 [Submit][Status][Discuss] Description勤奋的Farmer Jo

2016-05-16 08:45:57 719

原创 【点分治总结】

点分治教程:例题 给定一棵带权树,显然共有N*(N-1)/2条边,问:第k小的边边长多长? N<=10000.题解: 这道题直接上手做实在是太难了,需要逐步拆分。 首先,问题是第k小的边的边长,这个问题不好解,但是转换一下问题,二分第k小的边长T,然后判断这棵树中<=T的路径有多少条,这个能稍微好做一下,至少变成了一个统计性问题。 二分后题目变成: 给定一棵带权树,显然共有N*(N-1)

2016-05-13 21:22:51 5304 2

c++ iostream 教程 PPT

C++ solution is a set of classes defined in the iostream and fstream header files.

2018-03-15

网络流Dinic

网络流Dinic

2016-02-01

空空如也

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

TA关注的人

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