心路历程 $r l=r$的串若为A串且贡献为正即可加入,对于每一个B的位置预处理,时间复杂度$O(nlog_n+(r l)n+q)$ $r l 2000$后缀自动机+线段树合并,倍增找到点,跳endpos,跳的次数不会太多 SOL 数据有点特别啊~ $r l\in[51,2000]$和 2000做法 ...
分类:
其他好文 时间:
2020-04-01 13:15:21
阅读次数:
68
D. Carousel 题意:给一个n(2e5)个点的环,每个点上有一个数字ai,现在要求你再给每个点一个值bi,使得不存在相邻的两个点他们ai不同,bi相同,问bi最少取几个值。 思路:如果所有ai都相同,bi只取一个即可。如果存在ai不同的情况,则至少取两个bi,如果环是偶数长度,那么可以121 ...
分类:
其他好文 时间:
2020-03-31 21:22:10
阅读次数:
66
一、流程控制概述 三大流程控制语句:顺序、选择、循环 1)顺序:从上往下依次执行 2)选择:if ,if-else,多重 if结构,嵌套if,switch,根据条件执行对应的内容 3)循环结构: -while循环 -do-while循环 -for循环 -break语句 -continue语句 二、w ...
分类:
编程语言 时间:
2020-03-31 12:23:17
阅读次数:
84
1、集合输出在之前我们利用了toString()及get()方法对集合进行了输出,其实那都不是集合的标准输出,集合输出有四种方式:Iterator、ListIterator、Enumeration、foreach。(1)Iterator(迭代输出)在jdk1.5之前,在Collection接口中就有 ...
分类:
其他好文 时间:
2020-03-30 21:22:06
阅读次数:
77
You have an array of . Each log is a space delimited string of words. For each log, the first word in each log is an alphanumeric identifier . Then, e ...
分类:
编程语言 时间:
2020-03-30 09:46:15
阅读次数:
93
小说阅读器 启动模块bin/start.py 1 import os 2 import sys 3 4 BASE_PATH=os.path.dirname(os.path.dirname(__file__)) 5 sys.path.append(BASE_PATH) 6 7 8 from core ...
分类:
其他好文 时间:
2020-03-30 09:44:06
阅读次数:
107
/* dp[i][j][k]表示到了第i颗子弹,cd1=j,cd2=k 的最优解 */ #include<bits/stdc++.h> using namespace std; #define N 1005 int cd1,cd2,n,b[N],dp[5][105][105]; int solve( ...
分类:
其他好文 时间:
2020-03-28 18:05:56
阅读次数:
61
割边(Bridge) 模板 cpp vector ans; vector e[maxn]; void dfs(int u,int fa) { dep[u] = dep[fa] + 1; for(int v:e[u]) { if(v==fa) continue; if(!dep[v]) { dfs(v ...
分类:
移动开发 时间:
2020-03-28 00:45:52
阅读次数:
107
> Coral.> Hello year three.> In this lesson we will continue our underwater theme by practicing how to draw coral.> Many of you may have seen the cora ...
分类:
其他好文 时间:
2020-03-27 19:46:06
阅读次数:
113
解决方法:敲git rebase 然后按提示执行就行了,如果rebase 发生冲突的话,则修改,修改完后git add -u filename,然后git rebase --continue ,直到没有冲突为止。不需要commit 。最后再上code(参考链接 参考链接2)出现问题的原因:在本地分支 ...
分类:
其他好文 时间:
2020-03-27 17:06:30
阅读次数:
108