-
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...
-
洛谷 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;...
-
luogu1368 工艺
luogu1368 工艺 题目链接 思路 \(SAM\) 练手题,将原串重复一遍插入到 \(SAM\) 中,然后贪心走长度为n的一个路径即可。 不用担心会直接走到终点,根据 \(SAM\) 的构造方式可以发现会先走到前面的路径。 代码 /** @Author: wxyww* @Date: 2019-07-11 11:09:25* @Last Mo...
-
DFS(四):剪枝策略
DFS(四):剪枝策略 顾名思义,剪枝就是通过一些判断,剪掉搜索树上不必要的子树。在采用DFS算法搜索时,有时候我们会发现某个结点对应的子树的状态都不是我们要的结果,这时候我们没必要对这个分支进行搜索,砍掉这个子树,就是剪枝。 在DFS搜索算法中,剪枝策略就是...
-
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...
-
bzoj3676 回文串
bzoj3676 回文串 题目链接 思路 看到回文串,自然就会想到 。 还要求子串长度。那就用 \(SAM\) 。 所以每次用manacher找到一个回文串,都在 \(SAM\) 上查询其出现次数。 在 \(SAM\) 上查询的时候,肯定不能暴力找。先找到当前回文串的结束位置。然后用倍增法往上跳。一...
-
Codevs 3981 动态最大子段和
Codevs 3981 动态最大子段和 目录 题目 思路 详细讲解 $Code$ 题目 戳 思路 求$bss$的板子 详细讲解 $\text{To be continued}$ $Code$ #includeiostream#includecstdio#includecstring#includealgorithm#includecstdio#define MAXN 200000using namespace std;long lon...
-
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 ;} 移除中间的一段字符 很好的发挥了作用 然后改了一下...
-
kuangbin专题 专题一 简单搜索 Fire Game FZU - 2150
kuangbin专题 专题一 简单搜索 Fire Game FZU - 2150 题目链接:https://vjudge.net/problem/FZU-2150 题意: . '代表火无法烧着的地方, # 表示草,火可以烧着。选择任意两个 # (可以两个都选同一个 # ),火会蔓延,每过1个时间消耗,向四周蔓延。问:能不能把草全...
-
洛谷 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...
IDC资讯: 主机资讯 注册资讯 托管资讯 vps资讯 网站建设
网站运营: 建站经验 策划盈利 搜索优化 网站推广 免费资源
网络编程: Asp.Net编程 Asp编程 Php编程 Xml编程 Access Mssql Mysql 其它
服务器技术: Web服务器 Ftp服务器 Mail服务器 Dns服务器 安全防护
软件技巧: 其它软件 Word Excel Powerpoint Ghost Vista QQ空间 QQ FlashGet 迅雷
网页制作: FrontPages Dreamweaver Javascript css photoshop fireworks Flash
