<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel><title><![CDATA[constbh的博客]]></title><description><![CDATA[]]></description><link>https://blog.csdn.net/constbh</link><language>zh-cn</language><generator>https://blog.csdn.net/</generator><copyright><![CDATA[Copyright &copy; constbh]]></copyright><item><title><![CDATA[【无标题】]]></title><link>https://blog.csdn.net/constbh/article/details/124431531</link><guid>https://blog.csdn.net/constbh/article/details/124431531</guid><author>constbh</author><pubDate>Tue, 26 Apr 2022 16:42:00 +0800</pubDate><description><![CDATA[LRU的实现
#include&lt;queue&gt;
#include&lt;iostream&gt;
#include&lt;list&gt;
#include&lt;unordered_map&gt;
using namespace std;

class LRUCache {
public:
    list&lt;pair&lt;int,int&gt; &gt;que;
    unordered_map&lt;int, list&lt;pair&lt;int,int&gt; &gt;::ite]]></description><category></category></item><item><title><![CDATA[【无标题】]]></title><link>https://blog.csdn.net/constbh/article/details/124430412</link><guid>https://blog.csdn.net/constbh/article/details/124430412</guid><author>constbh</author><pubDate>Tue, 26 Apr 2022 16:09:44 +0800</pubDate><description><![CDATA[岛屿数量
#include&lt;iostream&gt;
using namespace std;

class Solution {
public:
    int vis[305][305];
    void dfs(int i,int j,int l,int w,vector&lt;vector&lt;char&gt;&gt;&amp; grid) {
        if (i&lt;0||i&gt;=l || j&lt;0||j&gt;=w) return ;
        if (vis[]]></description><category></category></item><item><title><![CDATA[【无标题】]]></title><link>https://blog.csdn.net/constbh/article/details/124429979</link><guid>https://blog.csdn.net/constbh/article/details/124429979</guid><author>constbh</author><pubDate>Tue, 26 Apr 2022 15:59:35 +0800</pubDate><description><![CDATA[重新排列日志文件
#include&lt;iostream&gt;
#include&lt;vector&gt;
#include&lt;string&gt;
using namespace std;
bool cmp(const string a,const string b) {
    int aNumberCount = 0;
    string tmpa = "";
    string tmpb = "";
    string titleA = "";
    string titleB =]]></description><category></category></item><item><title><![CDATA[leetcode Median of Two Sorted Arrays python]]></title><link>https://blog.csdn.net/constbh/article/details/79232202</link><guid>https://blog.csdn.net/constbh/article/details/79232202</guid><author>constbh</author><pubDate>Thu, 01 Feb 2018 19:08:21 +0800</pubDate><description><![CDATA[对于两个已排序的数组，在o(n+m)的时间内就可以按序存储在一个大数组里面，这里学习python语法，记录代码．
class Solution:
    def findMedianSortedArrays(self, nums1, nums2):
        """
        :type nums1: List[int]
        :type nums2: List[int]
]]></description><category></category></item><item><title><![CDATA[leetcode　Longest Substring Without Repeating Characters　python]]></title><link>https://blog.csdn.net/constbh/article/details/79213676</link><guid>https://blog.csdn.net/constbh/article/details/79213676</guid><author>constbh</author><pubDate>Wed, 31 Jan 2018 10:06:17 +0800</pubDate><description><![CDATA[学习ｐｙｔｈｏｎ语法，用ｐｙ写发尺取
学习了ｐｔｈｏｎ中的ｍａｐ

要注意特判空字符串

class Solution:
    def lengthOfLongestSubstring(self, s):
        """
        :type s: str
        :rtype: int
        """
        dict  = {}
       ]]></description><category></category></item><item><title><![CDATA[codeforces913C(贪心)]]></title><link>https://blog.csdn.net/constbh/article/details/79124231</link><guid>https://blog.csdn.net/constbh/article/details/79124231</guid><author>constbh</author><pubDate>Sun, 21 Jan 2018 23:49:04 +0800</pubDate><description><![CDATA[退役了好久没写题，今天晚上睡不着写一发．
这题仔细一想其实不难，按照每个位的性价比排序，然后安最便宜的枚举，然后假设比当前位低的位不用，只需要买这一位就行（二进制就这样，而且题目说可以比给定的值大），更新答案．
一发ＡＣ　，中间因为变量定义出了问题，调了一会儿
#include
#include
using namespace std;
const int maxn = 35;
typede]]></description><category></category></item><item><title><![CDATA[hdu4435(思维)]]></title><link>https://blog.csdn.net/constbh/article/details/78652904</link><guid>https://blog.csdn.net/constbh/article/details/78652904</guid><author>constbh</author><pubDate>Tue, 28 Nov 2017 11:07:52 +0800</pubDate><description><![CDATA[There are n cities in M^3's empire. M^3 owns a palace and a car and the palace resides in city 1. One day, she wants to travel around all the cities from her palace and finally back to her home. Howev]]></description><category></category></item><item><title><![CDATA[vijos1094(差分约束系统)]]></title><link>https://blog.csdn.net/constbh/article/details/78597166</link><guid>https://blog.csdn.net/constbh/article/details/78597166</guid><author>constbh</author><pubDate>Tue, 21 Nov 2017 21:27:49 +0800</pubDate><description><![CDATA[描述
给出一有向图，图中每条边都被标上了关系运算符‘’,‘=’。现在要给图中每个顶点标上一个大于等于0,小于等于k的某个整数使所有边上的符号得到满足。若存在这样的k，则求最小的k，若任何k都无法满足则输出NO。
例如下表中最小的k为2。
结点1>结点2
结点2>结点3
结点2>结点4
结点3=结点4
如果存在这样的k，输出最小的k值；否则输出‘NO’。
格式
输入格式
共二行，]]></description><category></category></item><item><title><![CDATA[codeforces892C]]></title><link>https://blog.csdn.net/constbh/article/details/78566999</link><guid>https://blog.csdn.net/constbh/article/details/78566999</guid><author>constbh</author><pubDate>Sat, 18 Nov 2017 10:12:04 +0800</pubDate><description><![CDATA[昨天晚上写这个题综测挂了，没有特判全是１的情况．
/*************************************************************************
	> File Name: cf3.cpp
	> Author: 
	> Mail: 
	> Created Time: 2017年11月18日 星期六 09时55分17秒
 ***********]]></description><category></category></item><item><title><![CDATA[newcoder世界上最可爱的珂朵莉]]></title><link>https://blog.csdn.net/constbh/article/details/78565393</link><guid>https://blog.csdn.net/constbh/article/details/78565393</guid><author>constbh</author><pubDate>Fri, 17 Nov 2017 21:21:28 +0800</pubDate><description><![CDATA[题目描述

我永远喜欢珂朵莉~！ 
有两个长为n的序列a[i]与b[i] 
你可以把任意不多于x个a序列中的数变成y 
你可以把所有序列b中的数减去一个非负数t 
你可以把a序列和b序列分别任意打乱 
要求对于1 满足a[i] >= b[i] 
求t的最小值 



输入描述:
第一行三个数n,x,y
之后一行n个数表示a序列
之后一行n个数表示b序列
输出描述:
一]]></description><category></category></item><item><title><![CDATA[newcoder猴子吃香蕉]]></title><link>https://blog.csdn.net/constbh/article/details/78565338</link><guid>https://blog.csdn.net/constbh/article/details/78565338</guid><author>constbh</author><pubDate>Fri, 17 Nov 2017 21:18:32 +0800</pubDate><description><![CDATA[题目描述

有n只猴子，第i只猴子每过xi小时会连续吃香蕉yi小时。猴子从第二次开始每次休息结束后这只猴子连续吃香蕉的时间会增加zi小时。

给定n只猴子，每一只的xi，yi，zi，以及时间t，求在前t小时中，所有猴子共吃了多少小时。


 对于一只猴子来说是这样的：
从第1小时开始： 
休息xi小时( 1 -> xi ) 
吃yi小时( xi + 1 -> xi + yi )]]></description><category></category></item><item><title><![CDATA[codeforces888E（折半二分）]]></title><link>https://blog.csdn.net/constbh/article/details/78514606</link><guid>https://blog.csdn.net/constbh/article/details/78514606</guid><author>constbh</author><pubDate>Sun, 12 Nov 2017 20:21:36 +0800</pubDate><description><![CDATA[把序列分为前一半和后一半，然后壮压得出两部分数字可以得到的所有和，存在两个vector里，然后枚举第一个vector中的数字，二分查找第二部分满足条件的最大值，然后更新最大值。
#include
#include
#include
using namespace std;
typedef long long ll;
vectorg1,g2;
ll num[40],t[40];
int main(]]></description><category></category></item><item><title><![CDATA[热爱工作的蒜蒜（带限制最短路）]]></title><link>https://blog.csdn.net/constbh/article/details/78346708</link><guid>https://blog.csdn.net/constbh/article/details/78346708</guid><author>constbh</author><pubDate>Wed, 25 Oct 2017 21:05:19 +0800</pubDate><description><![CDATA[众所周知，蒜蒜是一名热爱工作的好员工，他觉得时间就是金钱，做事情总是争分夺秒。
这天晚上，蒜蒜一个人去吃晚饭。不巧的是，吃完饭以后就开始下雨了，蒜蒜并没有带雨伞出来。但是蒜蒜热爱工作，工作使他快乐，他要尽快赶回去写代码。
蒜蒜的公司在中关村，中关村这边地形复杂，有很多天桥、地下通道和马路交错在一起。其中，地下通道是可以避雨的，天桥和马路都没办法避。可以把中关村抽象成为 
nnn
 个点的地]]></description><category></category></item><item><title><![CDATA[uvalive5713(次小生成树)]]></title><link>https://blog.csdn.net/constbh/article/details/78308944</link><guid>https://blog.csdn.net/constbh/article/details/78308944</guid><author>constbh</author><pubDate>Sun, 22 Oct 2017 11:36:43 +0800</pubDate><description><![CDATA[先求出最小生成树，然后n^2枚举两个点，在两个点之间连一条边，就形成了一个环，然后求出两点间人数的和除以那个环在树上的边的最大边，更新最大值．求最大权值边可以用熟练剖分．复杂度n^2logn．
#include 
#include 
#include 
#include
#include 
using namespace std;
#define Del(a,b) memset(a,b,size]]></description><category></category></item><item><title><![CDATA[vijos1412(第k优背包)]]></title><link>https://blog.csdn.net/constbh/article/details/78247964</link><guid>https://blog.csdn.net/constbh/article/details/78247964</guid><author>constbh</author><pubDate>Mon, 16 Oct 2017 11:31:44 +0800</pubDate><description><![CDATA[求第Ｋ优的背包．然后选前Ｋ大的价值求和
/*************************************************************************
	> File Name: vijos1059.cpp
	> Author: 
	> Mail: 
	> Created Time: 2017年10月16日 星期一 10时33分45秒
 **********]]></description><category></category></item><item><title><![CDATA[vijos1843（货车运输）]]></title><link>https://blog.csdn.net/constbh/article/details/78236346</link><guid>https://blog.csdn.net/constbh/article/details/78236346</guid><author>constbh</author><pubDate>Sat, 14 Oct 2017 19:43:28 +0800</pubDate><description><![CDATA[每个货车可以运输的最大货物量就是起点到终点的某一条路径上的最小权值，为了使运输量最大，那就是选一条路使得这条路上的最小权值边最大。
于是想到最大生成树，然后就是树上查询两点之间路径上的最小值，熟练剖分可以解。
#include 
#include 
#include 
#include 
using namespace std;
#define Del(a,b) memset(a,b,size]]></description><category></category></item><item><title><![CDATA[poj3867(2-sat)]]></title><link>https://blog.csdn.net/constbh/article/details/78207481</link><guid>https://blog.csdn.net/constbh/article/details/78207481</guid><author>constbh</author><pubDate>Wed, 11 Oct 2017 19:38:29 +0800</pubDate><description><![CDATA[题目大意：
                 给了N个点和M条边，每个点的权值可以是0可以是1，M条边有一个边权和一个操作，问是否存在一个点权赋值方式，满足m条边的两个端点的权值通过该边的操作和该边的权值相等。挑战上经典的2-sat问题。
列出一个真值表，看着建图就行了。
#include
#include
#include
#include
using namespace std;
con]]></description><category></category></item><item><title><![CDATA[hdu3622（二分&2-sat）]]></title><link>https://blog.csdn.net/constbh/article/details/78186670</link><guid>https://blog.csdn.net/constbh/article/details/78186670</guid><author>constbh</author><pubDate>Mon, 09 Oct 2017 20:55:46 +0800</pubDate><description><![CDATA[二分答案，若距离冲突（dist【i】【j】
代码来自匡斌
/*
HDU 3622
题意:给n对炸弹可以放置的位置(每个位置为一个二维平面上的点),
每次放置炸弹是时只能选择这一对中的其中一个点,每个炸弹爆炸
的范围半径都一样,控制爆炸的半径使得所有的爆炸范围都不相
交(可以相切),求解这个最大半径.
     首先二分最大半径值,然后2-sat构图判断其可行性,对于每
     两队位置(u,]]></description><category></category></item><item><title><![CDATA[codeforces730J（费用流）]]></title><link>https://blog.csdn.net/constbh/article/details/78184245</link><guid>https://blog.csdn.net/constbh/article/details/78184245</guid><author>constbh</author><pubDate>Mon, 09 Oct 2017 16:49:58 +0800</pubDate><description><![CDATA[每个人与源点连一条边，流量是1，费用为0.
每个人与编程队那个点连一条边，流量是p，费用为-a[i];
每个人与运动队那个点连一条边，流量是s，费用为-b[i];
编程队与运动队向汇点连一条边，流量分别为，p，s。费用为0；
最大值就是 最小费用的取反。
然后遍历边数组，流量不为0 的边并且起点是1-n的，终点是运动队就是运动队的人，是编程队就是编程队的人。
#include
#inc]]></description><category></category></item><item><title><![CDATA[codeforces 869E(哈希&二维树状数组)]]></title><link>https://blog.csdn.net/constbh/article/details/78184181</link><guid>https://blog.csdn.net/constbh/article/details/78184181</guid><author>constbh</author><pubDate>Mon, 09 Oct 2017 16:46:34 +0800</pubDate><description><![CDATA[把每个子矩阵哈希一下，增加操作就是树状数组加，删除就是减，然后判断连通时就是判断两个点的hash值是否相等。
#include
#include
#include
#include
using namespace std;
int n,m,q;
long long tree[2505][2505];
typedef pair P;
map,long long>mp;
int lowbit(int]]></description><category></category></item></channel></rss>