自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(13)
  • 收藏
  • 关注

原创 读书笔记

内容

2020-06-10 00:00:47 91 1

原创 最优前缀编码

#include<cstdio>#include<cstdlib>#include<cstring>#include<algorithm>using namespace std;#define n 8 //叶子数目#define m 2*n-1 //树中结点总数typedef struct { //结点类型 double weight; //结点的权值 int parent, lchild,

2020-05-19 21:54:18 248

原创 贪心

#include<iostream>#include<iomanip>#include <algorithm>#include <vector>using namespace std;class Action {private: int id; int begin_time; int end_time;public: Actio...

2020-04-28 21:12:18 81

原创 lcs

#include <iostream>#include <string>#include <vector>using namespace std;//算法2:f(B, i, j)输出最长子串void OutPutLCS(vector<vector<int>> &B, string X, int X_len, int Y_...

2020-04-28 21:11:13 101

原创 投资问题

#include<iostream>#include<vector> using namespace std; int main() { int m, n;//m元钱,n项投资 int i, j;//循环辅助变量 int tmp_m,tmp_F=0;//tem_m代表给第i个项目投入的钱数 0<=tmp<=j;tmp_F代表一次循环中的钱数...

2020-04-14 19:22:16 83

原创 选第k大的分治算法

/* * 问题描述:从N个数中,选出第k小(排序后排在第k个位置)的元素。 * * 选择问题法程序 * */ #include <stdio.h>#include <stdlib.h>#include <time.h> #define N 7 void getData(int [], int);void result_output(i...

2020-04-07 18:21:03 237

原创 最近对问题

代码引入#include <iostream>#include<iomanip>#include<cmath>using namespace std;struct point{ int x,y;};int Partition(point r[], int first, int end){ //划分 ...

2020-03-31 13:20:47 100

原创 实验四

二分归并排序#include <stdio.h>#include <stdlib.h>#include <assert.h>#include <string.h> //分组归并void _Merge(int *a, int begin1, int end1, int begin2, int end2, int *tmp){ int ...

2020-03-24 20:20:48 76

原创 遍历搜索

代码`#include<algorithm>#include<iostream>#include<stdio.h>#include<vector>#include<cmath>#include<string.h>#include<map>using namespace std;const int ...

2020-03-17 20:21:58 413

原创 最短路问题

大意:给我们一张图,让我们用Floyd去找出从某一点出发到某一点的最短路近问题

2020-03-09 21:27:42 86

原创 关于最小路的板子

问题引入,让我们建立一个最小生成树首先是通过prim算法。#include<iostream>//Prim算法的简单实现(最小生成树的最小生成路径)#include<cstdio>#include<cstring>#define inf (0x3f3f3f3f)using namespace std;const int maxn = 100 + 1...

2020-03-02 18:22:55 67

原创 今日A,D题解

Pie首先题目意思是有n种蛋糕,每个半径告诉你,要分给f+1个人,要求每个人分的体积一样,让我们求最大的体积。思路:从已有的pie中进行二分,面积为0-S[n-1] (最大的那块那块面积),然后每一次导入的mid值进行check判断是否满足条件,然后用一个count进行计数,如果最后的count>=f+1,即可可行。#include <iostream>#include ...

2020-02-06 13:27:59 129

原创 线段树初级进阶

线段树专题第一道题是来自codeforces的438D,题目的题意是给你一个初始化的数组,然后给你几种操作,如果操作码为1的时候计算区间【l,r】的区间和,然后操作码为2时,将区间【l,r】之间的数字进行取摸,如果操作码为3的时候将位置为k的数字改成x。初步一看就能很快想到线段树,用线段树维护我们的树,唯一的难点在我们对区间取摸的操作,如果反复取摸会出现t的情况,那我们怎么优美的暴...

2020-01-15 15:55:55 153

空空如也

空空如也

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

TA关注的人

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