描述

We say a stringis beautiful if it has the equal amount of 3 or more continuous letters (inincreasing order.)

Here are someexample of valid beautiful strings: "abc", "cde","aabbcc", "aaabbbccc".

Here are someexample of invalid beautiful strings: "abd", "cba","aabbc", "zab".

Given a stringof alphabets containing only lowercase alphabets (a-z), output "YES"if the string contains a beautiful sub-string, otherwise output "NO".

输入

The first linecontains an integer number between 1 and 10, indicating how many test cases arefollowed.

For each testcase: First line is the number of letters in the string; Second line is thestring. String length is less than 10MB.

输出

For each testcase, output a single line "YES"/"NO" to tell if the stringcontains a beautiful sub-string.

提示

Huge input. SlowIO method such as Scanner in Java may get TLE.

样例输入

4

3

abc

4

aaab

6

abccde

3

abb

样例输出

YES

NO

YES

NO

时间限制:8000ms

单点时限:1000ms

内存限制:256MB

描述

You are given atxt file, which is performance logs of a single-threaded program.

Each line hasthree columns as follow:

[Function Name][TimeStamp] [Action]

[FunctionName]is a string of length between 1~255

[TimeStamp]format is hh:mm:ss

Valid values for"Action" column are START or END, marking the start or end of afunction call.

Each functionwill only be called once.

Output thedepth-first traversal result of the call graph with the total time of eachfunction call. However, sometimes the performance log isn't correct and at thattime you just need to output "Incorrect performance log".

输入

The input onlycontains 1 case, first line is a positive number N representing the number oflogs(1 <= N <= 20000), then there are N lines in next, each line is thelog info containing [Function Name] [TimeStamp] [Action], [Function Name] is astring, you can assume the [Function Name] is distinct and the length between1~255.

输出

Output thedepth-first traversal result of the call graph with the total time of eachfunction call for the correct performance, or output "Incorrectperformance log".

提示

A call graph isa directed graph that represents calling relationships between subroutines in acomputer program.

Call graph forthe sample input is shown as below:

Another sampletest case.

Sample Input

Sample Output

8
FuncA 00:00:01 START
FuncB 00:00:02 START
FuncC 00:00:03 START
FuncA 00:00:04 END
FuncB 00:00:05 END
FuncD 00:00:06 START
FuncD 00:00:07 END
FuncC 00:00:08 END

Incorrect performance log

样例输入

8

FuncA 00:00:01 START

FuncB 00:00:02 START

FuncC 00:00:03 START

FuncC 00:00:04 END

FuncB 00:00:05 END

FuncD 00:00:06 START

FuncD 00:00:07 END

FuncA 00:00:08 END

样例输出

FuncA 00:00:07

FuncB 00:00:03

FuncC 00:00:01

FuncD 00:00:01

窗体顶端

EmacsNormalVim

时间限制:10000ms

单点时限:1000ms

内存限制:256MB

描述

We define thematching contents in the strings of strA and strB as common substrings of thetwo strings. There are two additional restrictions on the common substrings.

The firstrestriction here is that every common substring's length should not be less than3.  For example:

strA: abcdefghijklmn
strB: ababceghjklmn

The matchingcontents in strA and strB are substrings ("abc", "jklmn").Note that though "e" and "gh" are common substrings of strAand strB, they are not matching content because their lengths are less than 3.

The secondrestriction is that the start indexes of all common substrings should bemonotone increasing. For example:

strA: aaabbbbccc
strB: aaacccbbbb

The matchingcontents in strA and strB are substrings ("aaa", "bbbb").Note that though "ccc" is common substring of strA and strB and haslength greater than 3, the start indexes of ("aaa", "bbbb","ccc") in strB are (0, 6, 3), which is not monotone increasing.

输入

Two lines. Thefirst line is strA and the second line is strB. Both strA and strB are oflength less than 2100.

输出

The length ofmatching contents (the sum of the lengths of the common substrings).

样例输入

abcdefghijklmn

ababceghjklmn

样例输出

8

时间限制:10000ms

单点时限:1000ms

内存限制:256MB

描述

Finally, youcome to the interview room. You know that a Microsoft interviewer is in theroom though the door is locked. There is a combination lock on the door. Thereare N rotators on the lock, each consists of 26 alphabetic characters, namely,'A'-'Z'. You need to unlock the door to meet the interviewer inside. There is anote besides the lock, which shows the steps to unlock it.

Note: There areM steps totally; each step is one of the four kinds of operations shown below:

Type1: CMD1 i j X: (i and j are integers, 1 <= i <= j <= N; X is a character,within 'A'-'Z')

This is asequence operation: turn the ith to the jth rotators to character X (the leftmost rotator is defined as the 1st rotator)

For example: ABCDEFG => CMD 1 2 3 Z => AZZDEFG

Type2: CMD2 i j K: (i, j, and K are all integers, 1 <= i <= j <= N)

This is asequence operation: turn the ith to the jth rotators up K times ( if characterA is turned up once, it is B; if Z is turned up once, it is A now. )

For example: ABCDEFG => CMD 2 2 3 1 => ACDDEFG

Type3: CMD3 K: (K is an integer, 1 <= K <= N)

This is aconcatenation operation: move the K leftmost rotators to the rightmost end.

For example: ABCDEFG => CMD 3 3 => DEFGABC

Type4: CMD4 i j(i, j are integers, 1 <= i <= j <= N):

This is arecursive operation, which means:

If i > j:

DoNothing

Else:

CMD4 i+1 j

CMD2 i j 1

For example: ABCDEFG => CMD 4 2 3 => ACEDEFG

输入

1st line: 2 integers, N, M ( 1 <= N <= 50000, 1 <= M <= 50000 )

2nd line: astring of N characters, standing for the original status of the lock.

3rd ~ (3+M-1)thlines: each line contains a string, representing one step.

输出

One line of Ncharacters, showing the final status of the lock.

提示

Come on! Youneed to do these operations as fast as possible.

样例输入

7 4

ABCDEFG

CMD 1 2 5 C

CMD 2 3 7 4

CMD 3 3

CMD 4 1 7

样例输出

HIMOFIN

窗体底端

微软在线笔试题2015相关推荐

  1. 【前端】2015阿里前端实习生在线笔试题

    网上找的题,自己做了做. ... 2015阿里巴巴前端实习生在线笔试题 1. (单项选择)对于下列程序运行结果,符合预期的是 function f1() { console.time('time sp ...

  2. 2015某大型电商集团的前端实习生在线笔试题(无耻的拿来偷看了)

    2015某大型电商集团的前端实习生在线笔试题(嘿嘿猜猜是谁的) 1.(单项选择)对于下列程序运行结果,符合预期的是 function f1() { console.time('time span'); ...

  3. 2015年阿里巴巴校招研发工程师在线笔试题汇总

    在线笔试题汇总 卷一: 1.下面的函数中哪个是系统调用而不是库函数______?  printf  scanf  fgetc  read  print_s  scan_s 2.某足球队有四名外援,分别 ...

  4. 阿里巴巴历年在线笔试题汇总

    阿里巴巴在线笔试题汇总 2013阿里巴巴前端在线笔试题 1.现有代码如下: 2.如果你现在使用的是 Google Chrome 或 Apple Safari,如何让 input 元素在默认情况下显示 ...

  5. 中兴校招c语言在线笔试题,中兴2017校招软件在线笔试题

    硬件工程师Hardware Engineer职位 要求熟悉计算机市场行情;制定计算机组装计划;能够选购组装需要的硬件设备,并能合理配置.安装计算机和外围设备;安装和配置计算机软件系统;保养硬件和外围设 ...

  6. 顺丰科技2018校园招聘在线笔试题

    今天做了顺丰科技的在线笔试题,选择题方面感觉考得很基础,有数据结构.编译原理方面的题目,以及设计模式的题目.编译原理的内容基本忘记了,设计模式也没有进行深入的学习,所以这两块大的并不是太好.再有就是排 ...

  7. 网易游戏2016校园招聘数据挖掘研究员在线笔试题和答案

    刚做完网易在线笔试题,感触最深的地方是,虽然题目形式和ACM题目相似,但是内容更偏向于实际应用.总共有四个题目,第一个题目属于字符串匹配类型,难度较低,第二个题目是模拟SQL语句的输出,第三个题目是K ...

  8. 腾讯2016实习招聘(西安)部分在线笔试题

    腾讯2016实习招聘(西安)部分在线笔试题 2016年4月3日晚腾讯实习招聘(西安)技术类部分在线笔试题整理,方便学习交流. 第一部分:不定项选择题 1. 以下javascript代码执行的结果是? ...

  9. 2014阿里巴巴WEB前端实习生在线笔试题

    2014年3月31日晚,我怀着略微忐忑的心情(第一次在线笔试^_^!!)进行了笔试,阿里巴巴的笔试题共有10道,几乎包含了Web前端开发的各个方面,有程序题.有叙述题,时间非常紧张,只完成了大概6道题 ...

  10. 「笔试题」最近做了一个招银网络科技Java岗位在线笔试题,给有需要的朋友了解学习一下!

    编程题一 大概意思是,给一段字符串,然后统计该字符串中相同字符个数,并以字符串+该字符串个数组合排列成新的字符串.如输入" sssdhibdhidhi " ,需要返回结果 &quo ...

最新文章

  1. MyBatis 实际使用案例-Mapper.xml 映射配置文件【重点】
  2. java高性能阻塞队列,Linux c/c   后台开发组建之:高性能阻塞队列
  3. 采用lamp架构搭建discuz论坛
  4. 手机网页转换为html文件,怎么在手机上打开HTML文件
  5. P6097-[模板]子集卷积
  6. node.js 爬虫入门总结
  7. linux怎么杀掉mpd进程,linux怎么样安装mpd进程管理器
  8. 数据从mysql迁移至oracle时知识点记录(一)
  9. 轻量级网络模型之EfficientNet
  10. selenium+testng+reprotng+ant配置
  11. response对象设置返回状态_爬虫代理之设置
  12. 自己动手写操作系统(高清图书+源代码)分享
  13. matlab对一个数组进行补零,matlab 输出 整数 补0
  14. linux恢复树莓派内存卡容量,找回树莓派SD卡剩余空间
  15. GLASS数据的批量下载(以植被覆盖度FVC为例)
  16. 修改用户密码命令linux,linux下passwd命令设置修改用户密码 - Alanf - 博客园
  17. SQLException:no opration allowed after statement closed问题排查
  18. Android 视频播放 界面变形处理
  19. Linux C/C++ 共享库so的搜索路径和顺序
  20. 怎么上传云班课的计算机作业,云班课怎么交作业_云班课作业提交教程_3DM手游...

热门文章

  1. IDEA 设置类注释模板
  2. 线性混合效应模型Linear Mixed-Effects Models的部分折叠Gibbs采样
  3. oppoa5降级教程_OPPO A5官方原版固件rom系统刷机包升级包下载A.12版
  4. 前端性能分析探索-天眼浏览器监控
  5. Linux Vim 退出命令
  6. python查找相似图片或重复图片
  7. 向日葵无法远程控制打开文件软件界面显示
  8. wps 宏 禁用_WPS宏被禁用如何打开
  9. 官方免费申请许可证-VMware Fusion 12 – Personal Use License
  10. 碳足迹 carbon footprint