• Two Sum

    Two Sum Two Sum Given an array of integers, return indices of the two numbers such that they add up to a specific target.You may assume that each input would have exactly one solution, and you may not use the same element twice. Example: Given nums...

    2019-08-16 07:49:10 iOSPSmacAVHTTPS<theCOMHTTPexit

  • 洛谷 P2894 [USACO08FEB]酒店Hotel

    洛谷 P2894 [USACO08FEB]酒店Hotel 目录 题目 思路 $Code$ 题目 戳 思路 $BSS$ $Code$ #includeiostream#includecstring#includestring#includealgorithm#includecstdio#define MAXN 500001using namespace std;int n,m;struct node{ int l,r,lmax,maxx,rmax,len,lazy;...

    2019-08-16 07:49:01 iOS酒店<思路POST

  • luogu1368 工艺

    luogu1368 工艺 题目链接 思路 \(SAM\) 练手题,将原串重复一遍插入到 \(SAM\) 中,然后贪心走长度为n的一个路径即可。 不用担心会直接走到终点,根据 \(SAM\) 的构造方式可以发现会先走到前面的路径。 代码 /** @Author: wxyww* @Date: 2019-07-11 11:09:25* @Last Mo...

    2019-08-16 07:48:49 IEiOStim<代码方式思路POST插入长度

  • DFS(四):剪枝策略

    DFS(四):剪枝策略 顾名思义,剪枝就是通过一些判断,剪掉搜索树上不必要的子树。在采用DFS算法搜索时,有时候我们会发现某个结点对应的子树的状态都不是我们要的结果,这时候我们没必要对这个分支进行搜索,砍掉这个子树,就是剪枝。 在DFS搜索算法中,剪枝策略就是...

    2019-08-16 07:48:31 定义wordIEiOSPStim<the函数

  • HelloWorld! C++纠错版

    HelloWorld! C++纠错版 例题: 1 #includeiostream 2 3 int main() 4 { 5 cout " HelloWorel! " ; 6 return 0 ; 7 } 1 #include iostream 2 using namespace std; 3 int main() // c++ programs start by executing the function main 4 { 5 cout " HelloWorld!\n " end...

    2019-08-16 07:48:26 文件定义去掉后缀iOSC++VC++<the代码函数

  • bzoj3676 回文串

    bzoj3676 回文串 题目链接 思路 看到回文串,自然就会想到 。 还要求子串长度。那就用 \(SAM\) 。 所以每次用manacher找到一个回文串,都在 \(SAM\) 上查询其出现次数。 在 \(SAM\) 上查询的时候,肯定不能暴力找。先找到当前回文串的结束位置。然后用倍增法往上跳。一...

    2019-08-16 07:48:24 IEiOStim<代码思路POST查询长度Span

  • Codevs 3981 动态最大子段和

    Codevs 3981 动态最大子段和 目录 题目 思路 详细讲解 $Code$ 题目 戳 思路 求$bss$的板子 详细讲解 $\text{To be continued}$ $Code$ #includeiostream#includecstdio#includecstring#includealgorithm#includecstdio#define MAXN 200000using namespace std;long lon...

    2019-08-16 07:48:19 iOS<动态continue思路POST

  • c++ erase 中的坑

    c++ erase 中的坑 先看一段正常的代码 #include iostream #include string using namespace std; int main() { string str = " 123456789 " ; str.erase(str.begin() + 2 , str.end() - 2 ); cout str; return 0 ;} 移除中间的一段字符 很好的发挥了作用 然后改了一下...

    2019-08-16 07:48:13 2345iOSC++<代码字符串删除程序POST错误

  • kuangbin专题 专题一 简单搜索 Fire Game FZU - 2150

    kuangbin专题 专题一 简单搜索 Fire Game FZU - 2150 题目链接:https://vjudge.net/problem/FZU-2150 题意: . '代表火无法烧着的地方, # 表示草,火可以烧着。选择任意两个 # (可以两个都选同一个 # ),火会蔓延,每过1个时间消耗,向四周蔓延。问:能不能把草全...

    2019-08-16 07:48:12 IEiOSPS简单搜索HTTPS<NET.NET代码函数

  • 洛谷 P3373 【模板】线段树 2

    洛谷 P3373 【模板】线段树 2 目录 题目 思路 $Code$ 题目 戳 思路 乘法优先(说了和没说一样,qwq) $Code$ #includeiostream#includecstring#includecstdio#includestring#includealgorithm#define LL long long#define MAXN 100001using namespace std;LL n,m,mod;s...

    2019-08-16 07:48:09 iOS<思路POST