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. 正版STLINK使用注意

    原文:https://blog.csdn.net/xinghuanmeiying/article/details/78026561 盗版的TVCC是3.3v,可以只用1,7,9,12 正版的TVCC是 ...

  2. idea右键没有svn选项

    然后apply,当然也可以只是某些指定的文件夹.project就是当前项目,包括所有的module.

  3. awk 实战

    awk 一些好玩的用法.有什么不错的点子可以留言,发挥出awk牛逼功能 分离mac地址 ifconfig wlan0 | grep eth | awk '{n=split($2,arr,": ...

  4. mysql-5.7 通过apt或者yum安装方式

    此文章仅记录使用apt-get安装mysql. 通过以下命令安装MySQL: shell> sudo apt-get install mysql-server 这将安装MySQL服务器的包,以及 ...

  5. MongoDB操作集

    官网 https://www.mongodb.com/download-center#community 基本资料: http://www.runoob.com/mongodb/mongodb-int ...

  6. 学号 20175201张驰 《Java程序设计》第7周学习总结

    学号 20175201张驰 <Java程序设计>第7周学习总结 教材学习内容总结 第八章 String类能有效地处理字符序列信息,它的常用方法有: public int length()可 ...

  7. 【Pattern】-NO.150.Pattern.1 -【Pattern UML】

    Style:Mac Series:Java Since:2018-09-10 End:2018-09-10 Total Hours:1 Degree Of Diffculty:5 Degree Of ...

  8. 配置成功java11后安装eclipse失败

    前提是 1.java是成功配置的, 2.看清楚32bit,还是64bit,需要一致 THEN 方法一:去安装java11之前的版本,正确配置环境 方法二:java11中没有jre(不打紧).所以需要直 ...

  9. 极致21点开发DAY3

    今天完成的主要任务是活动窗口的显示与关闭,以及领取金币的逻辑.用到了数据持久化技术.我想记录的主要是领取金币的逻辑. 领取金币算法:如果今天没有领取金币,即可领取,否则什么都不做. 一句话描述足矣,但 ...

  10. 用mongols轻松打造websocket应用

    用websocket做聊天系统是非常合适的. mongols是一个运行于linux系统之上的开源c++库,可轻松开启一个websocket服务器. 首先,build一个websocket服务器. #i ...