http://codeforces.com/contest/1016

A.

没想到这个也会TLE,太粗心了

B.

暴力就好了,多情况讨论又出错...

思路跟我一样的解法  

为什么我做了那么多讨论,原因是没注意这个: 标记 最后一个字符,同时注意 l+m-3.

特殊情况就

vis 0000011111111111112

s1  abaccabaacabacabacca      红色的地方是 l 和 r ,为了防止在 l 处计数多了就得 l + m - 3

s2  abacca

  1. we[s+m-1]++;
  2. we[r-1]-we[l+m-3]

string类的find()函数总结

 string::size_type pos=;
while((pos=s1.find(s2,pos))!=string::npos)
{
vis[pos+]=pos+;
pos++;
}

KMP解法

 

Educational Codeforces Round 48 (Rated for Div. 2)的更多相关文章

  1. Educational Codeforces Round 48 (Rated for Div. 2) CD题解

    Educational Codeforces Round 48 (Rated for Div. 2) C. Vasya And The Mushrooms 题目链接:https://codeforce ...

  2. Educational Codeforces Round 48 (Rated for Div. 2) B 1016B Segment Occurrences (前缀和)

    B. Segment Occurrences time limit per test 2 seconds memory limit per test 256 megabytes input stand ...

  3. Educational Codeforces Round 48 (Rated for Div. 2)异或思维

    题:https://codeforces.com/contest/1016/problem/D 题意:有一个 n * m 的矩阵, 现在给你 n 个数, 第 i 个数 a[ i ] 代表 i 这一行所 ...

  4. Educational Codeforces Round 48 (Rated for Div. 2)——A. Death Note ##

    A. Death Note time limit per test 2 seconds memory limit per test 256 megabytes input standard input ...

  5. Educational Codeforces Round 48 (Rated for Div. 2)G. Appropriate Team

    题意:求满足条件的(i,j)对数:\(gcd(v,a_i)=x,lcm(v,a_j)=y\) 题解:\(x|a_i,a_j|y\),\(x|y\),考虑质因子p,假设a_i中p次数为a,x中次数为b, ...

  6. Educational Codeforces Round 48 (Rated for Div. 2) D 1016D Vasya And The Matrix (构造)

    D. Vasya And The Matrix time limit per test 2 seconds memory limit per test 256 megabytes input stan ...

  7. 【Educational Codeforces Round 48 (Rated for Div. 2) C】 Vasya And The Mushrooms

    [链接] 我是链接,点我呀:) [题意] 在这里输入题意 [题解] 显然在没有一直往右走然后走到头再往上走一格再往左走到头之前. 肯定是一直在蛇形走位.. 这个蛇形走位的答案贡献可以预处理出来.很容易 ...

  8. 【Educational Codeforces Round 48 (Rated for Div. 2) D】Vasya And The Matrix

    [链接] 我是链接,点我呀:) [题意] 告诉你每一行.每一列的异或和. 让你求出一个符合要求的原矩阵. [题解] 显然应该有 a1^a2^....^an = b1^b2^....^bn 也即两边同时 ...

  9. [Educational Codeforces Round 81 (Rated for Div. 2)]E. Permutation Separation(线段树,思维,前缀和)

    [Educational Codeforces Round 81 (Rated for Div. 2)]E. Permutation Separation(线段树,思维,前缀和) E. Permuta ...

随机推荐

  1. mongodb 性能

    mongo 性能:http://www.mongoing.com/docs/tutorial/optimize-query-performance-with-indexes-and-projectio ...

  2. FSPageContentView这个库需要修改源码才能用,否则有黑屏bug

    去掉 - (instancetype)initWithFrame:(CGRect)frame childVCs:(NSArray *)childVCs parentVC:(UIViewControll ...

  3. 微信小程序样式旋转

    相关文档:http://www.w3school.com.cn/cssref/pr_transform.asp index.wxss文件 注意:如果是web前端,要注意浏览器的兼容性 .x1{ wid ...

  4. ant安装报错:ANT_HOME is set incorrectly or ant could not be located. Please set ANT_HOME.

    后来发现问题原因是没有设置classpath,或者是\的原因: 正确配置如下:  ANT_HOME:D:\ant\apache-ant-1.10.5 CLASSPATH: %ANT_HOME%\lib ...

  5. Spring Boot(二):Spring-Data-JPA操作数据库( Hibernate)增删改查

    一.Maven使用3.3.9版本或以上,选择Binary 版本 二.添加spring-data-jpa和数据库依赖,以oracle为例 三.添加连接数据库配置 四.新建model自动生成数据库表(不用 ...

  6. 405 Method Not Allowed error with PUT or DELETE Request on IIS Server

    昨天手贱去一台服务器上装了Webdav. 一开始以为这个报错是跨域问题, 最近一直遇到用自动的publish发布到FTP出问题也就没想到是Webdav的问题 而且这东西装了还不能删除 处理办法 IIS ...

  7. 马永亮(马哥) linux视频2018年版

    视频试看地址: 百度云链接: https://pan.baidu.com/s/1q4DV62DiFbBT8t63CapLJA  提取码: h5e4 资料收集于网络,如有侵权,告知后删除

  8. MongoDB系列----uupdate和数组

    db.collection.update( criteria, objNew, upsert, multi ) criteria : update的查询条件,类似sql update查询内where后 ...

  9. CentOS 7.5 安装 Python3.7

    1.安装开发者工具 yum -y groupinstall "Development Tools" 2.安装Python编译依赖包 yum -y install openssl-d ...

  10. PeopleSoft translate value 排序

    这个function 可以对record.field 的dropdownlist 排序,也可以把描述前边加个数字.但是有时候用户不接受.所以调用这个方法是比较好的选择. Function Order_ ...