E. A Simple Task 题目连接: http://www.codeforces.com/contest/558/problem/E Description This task is very simple. Given a string S of length n and q queries each query is on the format i j k which means sort the substring consisting of the characters from…
CF1239B The World Is Just a Programming Task 题目描述 定义一个括号序列s是优秀的,当且仅当它是以下几种情况的一种: 1.|s|=0 2.s='('+t+')',其中t是优秀的 3.s=t1+t2,其中t1.t2都是优秀的 一个括号序列的价值为将它看成一个循环串,从多少个位置切开,能切出循环串. 给出一个长度为\(n\)的括号序列,你可以交换其中两个位置的括号(这两个位置可以相等),问最大价值及方案. 输出任意一种方案均正确.\(n\leq 3\tim…
A. Vicious Keyboard time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Tonio has a keyboard with only two letters, "V" and "K". One day, he has typed out a string s with only t…