自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 LeetCode 84. Largest Rectangle in Histogram

题目链接:https://leetcode.com/problems/largest-rectangle-in-histogram/description/https://www.youtube.com/watch?v=VNbkzsnllsU&t=369sclass Solution {public: int largestRectangleArea(vector<int>...

2018-02-25 14:09:00 103

原创 普通线段树模板(做题用)

https://github.com/rsy56640/rsy_little_lib/tree/master/library_for_algorithm/SegmentTree指针实现class SegmentTree { class SegmentTreeNode { public: int start, end, val; Segm...

2018-02-23 21:36:05 189

原创 。。。

更新了win10,,VS VAX直接炸了...

2018-02-23 11:19:03 112

原创 线段树 原理及模板

代码模板: https://github.com/rsy56640/rsy_little_lib/tree/master/library_for_algorithm/SegmentTree线段树原理:对于一个给定程度的区间 lll,我们递归地定义: 区间 lll 的线段树为: 其根节点表示区间 lll;将其区间分为近似2段 l1,l2l1,l2l_1,l_2,左子树为区间 l1l1l...

2018-02-21 21:58:43 246

原创 LintCode 207. 区间求和 II

题目链接:http://www.lintcode.com/zh-cn/problem/interval-sum-ii/#class Solution { class SegmentTreeNode { public: int start, end, sum; SegmentTreeNode *left, *right; SegmentTreeNode(int start, int...

2018-02-21 11:30:27 248

原创 LeetCode 452 Minimum Number of Arrows to Burst Balloons

题目链接:https://leetcode.com/problems/minimum-number-of-arrows-to-burst-balloons/description/注:下面给的这个不能AC,因为有一组数据是INT_MIN。。把第一个人工记录就好了。贴这个是因为风格比较标准。(略微改了一下,现在可以AC)class Solution {public: int findMinArr...

2018-02-20 12:06:26 154

原创 POJ 1836 Alignment - (DP)

题目链接:http://poj.org/problem?id=1836#include <stdio.h> #include <vector> #include <algorithm>using namespace std;//POJ 1836 Alignmentint main() { int n; scanf("%d", &n...

2018-02-19 19:25:12 150

原创 POJ 1276 Cash Machine - (DP)

题目链接:http://poj.org/problem?id=1276一开始tle,后来看了多重背包优化成0-1背包,复杂度从O(V\sumM_i)变成O(V\sumlogM_i)#include <stdio.h> #include <vector> #include <algorithm>using namespace std;//POJ 1...

2018-02-18 23:45:02 157

原创 POJ 1837 Balance - (DP)

题目链接:http://poj.org/problem?id=1837#include <stdio.h> #include <vector> using namespace std;//POJ 1837 Balanceconst int MAX = 15001;int dp[21][MAX]; //dp[i][j]表示放前i个砝码,力矩为j的总方法数...

2018-02-18 19:30:28 198

原创 抽象代数笔记2——群

CSDN前端有毒,Latex写出来排版全乱 ………………………………………………………………………………………………. 群的定义: 设 GGG 是一个非空集合,“ooo” 是 GGG 上的二元代数运算,称为乘法。 如果下列条件成立,则称 GGG 对 它的乘法“ooo”构成一个群(Group)。 1. 乘法“ooo”满足结合律。 2. 对乘法“ooo”, GGG 中有一个左幺元 eee。...

2018-02-13 18:32:10 3038

原创 抽象代数笔记1——半群

本来想在知乎上写,后来想想,算了,拉低平均水平。。。在知乎上找到一个不错的抽代笔记: https://zhuanlan.zhihu.com/c_119426147?topic=%E6%8A%BD%E8%B1%A1%E4%BB%A3%E6%95%B0 可以参考。我参考的是哈工大的近世代数课程和代数学引论。 开始没啥写的,就罗列一些概念吧: (S, o) 代数系统, 其中o是二元代数运...

2018-02-11 14:36:08 4608

原创 POJ 3436 ACM Computer Factory - (网络流)

题目链接:http://poj.org/problem?id=3436一直WA,把queue换成stack突然AC,,,,,很迷当然POJ还是不支持C++ 11,std::move()无法编译#include <stdio.h> #include <vector> #include <queue> using namespace std;//PO...

2018-02-10 23:02:46 170

原创 网络流模板——矩阵实现

没有I/O操作,flow[][], cap[][]记录了网络矩阵node[]记录了  相连的点path[]记录了  增广路径上进入的点通过BFS搜索增广路径,然后通过path[]倒着更新。#include <stdio.h> #include <vector> #include <queue> using namespace std;//POJ ...

2018-02-10 13:49:16 510

原创 网络流模板——链表实现

没有I/O操作,vector<Edge> edges存储所有边node[]记录了  相连边的序号和方向path[]记录了  增广路径上入边序号和方向通过BFS搜索增广路径,然后通过path[]倒着更新。#include <stdio.h> #include <vector> #include <queue> using namespace...

2018-02-10 12:51:12 287

原创 POJ 1459 Power Network——(网络流入门)

POJ 1459 Power Network题目链接:http://poj.org/problem?id=1459I/O坑爹。。一开始的想法:理论虽然简单,实现起来怀疑人生。问题主要在于用什么模型存储网络,并且可以快速读写(这是核心问题)。用矩阵存储一直TLE,后来一直想用map,但是感觉还是不行,最后还是换成链表了。第一次写的,用矩阵存储。一直TLE,我以为矩阵费时间,,后来发现神tm居然控制台...

2018-02-10 12:28:07 193

空空如也

空空如也

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

TA关注的人

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