Description 题目描述 Recently, you have found your interest in string theory. Here is an interesting question about strings. You are given a string S of length n consisting of the first k lowercase letters. You are required to find two non-empty substrin…
题目链接:fzu 1913 Easy Comparison 题目大意:给出一个字符串,计算与它按照字典序排序排列后的字符串有多少个位置不同. 解题思路:水体,sort一下,然后遍历一遍就好. #include <stdio.h> #include <string.h> #include <algorithm> using namespace std; const int N = 105; char str[N], tmp[N]; int main () { int ca…
P1603 斯诺登的密码 题目描述 2013年X月X日,俄罗斯办理了斯诺登的护照,于是他混迹于一架开往委内瑞拉的飞机.但是,这件事情太不周密了,因为FBI的间谍早已获悉他的具体位置--但这不是最重要的--最重要的是如果要去委内瑞拉,那么就要经过古巴,而经过古巴的路在美国的掌控之中. 丧心病狂的奥巴马迫降斯诺登的飞机,搜查时却发现,斯诺登杳无踪迹.但是,在据说是斯诺登的座位上,发现了一张纸条.纸条由纯英文构成:Obama is a two five zero.(以"."结束输出,只有6个…