TOJ 2749 Absent Substrings】的更多相关文章

描述 Given a string of symbols, it’s natural to look it over and see what substrings are present. In this problem, you are given a string and asked to consider what substrings are absent. Of course, a given string has finite length and therefore only f…
Consider the string s to be the infinite wraparound string of "abcdefghijklmnopqrstuvwxyz", so s will look like this: "...zabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcd....". Now we have another string p. Your job is to find…
Consider the string s to be the infinite wraparound string of "abcdefghijklmnopqrstuvwxyz", so s will look like this: "...zabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcd....". Now we have another string p. Your job is to find…
TOJ 2776题目链接http://acm.tju.edu.cn/toj/showp2776.html 这题其实就是考虑的周全性...  贡献了好几次WA, 后来想了半天才知道哪里有遗漏.最大的问题就是, 当零头是13的时候, 不一定前面的光盘都刻录到最大值.比如29,16这种情况, 如果前面的刻录最大值,这样就需要3个盘,而最少的却是 2个就够了,(15,14) 即可:知道这种情况,这题基本就可以了: 注意一下这几个数据: 13 15 输出为2 29 16 输出为2 这条题目看起来很容易,但…
Description String analysis often arises in applications from biology and chemistry, such as the study of DNA and protein molecules. One interesting problem is to find how many substrings are repeated (at least twice) in a long string. In this proble…
Codeforces Round #258 (Div. 2) Count Good Substrings D. Count Good Substrings time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output We call a string good, if after merging all the consecutive eq…
题目 Source http://acm.hust.edu.cn/vjudge/problem/19225 Description The Hamming distance between two strings of the same length is defined as the number of positions at which the corresponding characters are different. For example, the Hamming distance…
Description Given a string, we need to find the total number of its distinct substrings. Input T- number of test cases. T<=20; Each test case consists of one string, whose length is <= 50000 Output For each test case output one number saying the num…
题意:由a和b构成的字符串,如果压缩后变成回文串就是Good字符串.问一个字符串有几个长度为偶数和奇数的Good字串. 分析:可知,因为只有a,b两个字母,所以压缩后肯定为..ababab..这种形式,所以是good substrings,那么首尾字符肯定相同,于是就好搞了. 用:odd[0],odd[1]分别记录奇数位置上出现的a和b的个数,even[0],even[1]分别记录偶数位置上的a,b个数. 那么到一个奇数点时,奇数长度的子串个数应该加上奇数位置的该字符的个数,偶数长度的应该加上偶…
[root@centos02 bin]# ./startup.sh Cannot find ./catalina.sh The file is absent or does not have execute permission This file is needed to run this program [root@centos02 bin]# ll -h startup.sh -rwxrwxrwx. 1 root root 1.9K Nov 3 2014 startup.sh [root@…