codeforces 518A. Vitaly and Strings】的更多相关文章

A. Vitaly and Strings time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Vitaly is a diligent student who never missed a lesson in his five years of studying in the university. He always does…
题意:给定两个相同长度的字符串,让你找出一个字符串,字典序在两都之间. 析:这个题当时WA了好多次,后来才发现是这么水,我们只要把 s 串加上,然后和算数一样,该进位进位,然后再和 t 比较就行. 代码如下: #include <iostream> #include <cstdio> #include <algorithm> #include <vector> #include <set> #include <cstring> #in…
A. Vitaly and Strings time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Vitaly is a diligent student who never missed a lesson in his five years of studying in the university. He always does…
Vitaly and Strings time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Vitaly is a diligent student who never missed a lesson in his five years of studying in the university. He always does his…
题目链接:Codeforces 385B Bear and Strings 记录下每一个bear的起始位置和终止位置,然后扫一遍记录下来的结构体数组,过程中用一个变量记录上一个扫过的位置,用来去重. #include <iostream> #include <cstdio> #include <cstring> using namespace std; const int MAX_N = 5000 + 100; char str[MAX_N]; struct Node…
题目链接:Codeforces 482C Game with Strings 题目大意:给定N个字符串,如今从中选定一个字符串为答案串,你不知道答案串是哪个.可是能够通过询问来确定, 每次询问一个位置上字符为多少. 如今你询问的每一个位置的概率是同样的,(问过的位置不会再问).求询问次数的期 望. 解题思路:由于字符串长度不会大于20.所以用二进制表示询问了哪些位置.C[s]即为询问s的位置能够确定多少个字 符串. 这步不能通过枚举s,然后推断处理,复杂度为o(2^20 * 20 * 50),太…
Vitaly is a diligent student who never missed a lesson in his five years of studying in the university. He always does his homework on time and passes his exams in time. During the last lesson the teacher has provided two strings s and t to Vitaly. T…
time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output Today on a lecture about strings Gerald learned a new definition of string equivalency. Two strings a and b of equal length are called equivalen…
Alyona and Strings 题目链接: http://acm.hust.edu.cn/vjudge/contest/121333#problem/D Description After returned from forest, Alyona started reading a book. She noticed strings s and t, lengths of which are n and m respectively. As usual, reading bored Aly…
正反两遍扩展KMP,维护公共长度为L时.出如今最左边和最右边的位置. . .. 然后枚举推断... E. Martian Strings time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output During the study of the Martians Petya clearly understood that the Mart…