http://acm.hdu.edu.cn/showproblem.php?pid=1516 Problem Description String Distance is a non-negative integer that measures the distance between two strings. Here we give the definition. A transform list is a list of string, where each string, except…
C. Bear and String Distance time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Limak is a little polar bear. He likes nice strings - strings of length n, consisting of lowercase English letter…
CF 628C 题目大意:给定一个长度为n(n < 10^5)的只含小写字母的字符串,以及一个数d,定义字符的dis--dis(ch1, ch2)为两个字符之差, 两个串的dis为各个位置上字符的dis之和,求和给定的字符串的dis为d的字符串,若含有多个则输出任意一个,不存在输出-1 解题思路:简单贪心,按顺序往后,对每一个字符,将其变为与它dis最大的字符(a或者z),d再减去相应的dis, 一直减到d为0,剩余的字母则不变直接输出.若一直到最后一位d仍然大于0,则说明不存在,输出-1. /…
HDU 3374 String Problem (KMP+最大最小表示) String Problem Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1602    Accepted Submission(s): 714 Problem Description Give you a string with length N, you c…
C. Bear and String Distance 题目连接: http://www.codeforces.com/contest/628/problem/C Description Limak is a little polar bear. He likes nice strings - strings of length n, consisting of lowercase English letters only. The distance between two letters is…
C. Bear and String Distance time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Limak is a little polar bear. He likes nice strings — strings of length n, consisting of lowercase English letter…
(string process, fgets, scanf, neat utilization of switch clause) simple problem, simple code. #include <cstdio> #include <algorithm> #define MAXLEN 22 char password[MAXLEN]; int main() { //freopen("input.txt","r",stdin); i…
http://acm.hdu.edu.cn/showproblem.php?pid=4712 Hamming Distance Time Limit: 6000/3000 MS (Java/Others)    Memory Limit: 65535/65535 K (Java/Others)Total Submission(s): 797    Accepted Submission(s): 284 Problem Description (From wikipedia) For binary…
String Problem Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 2706    Accepted Submission(s): 1140 Problem Description Give you a string with length N, you can generate N strings by left shift…
Hamming Distance Time Limit: 6000/3000 MS (Java/Others)    Memory Limit: 65535/65535 K (Java/Others) Problem Description (From wikipedia) For binary strings a and b the Hamming distance is equal to the number of ones in a XOR b. For calculating Hammi…