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…
题目链接:http://codeforces.com/problemset/problem/632/C C. The Smallest String Concatenation time limit per test 3 seconds memory limit per test 256 megabytes input standard input output standard output You're given a list of n strings a1, a2, ..., an. Y…
[Educational Codeforces Round 16]E. Generate a String 试题描述 zscoder wants to generate an input file for some programming competition problem. His input is a string consisting of n letters 'a'. He is too lazy to write a generator so he will manually ge…
题目链接: http://codeforces.com/problemset/problem/710/E E. Generate a String time limit per test 2 secondsmemory limit per test 512 megabytes 问题描述 zscoder wants to generate an input file for some programming competition problem. His input is a string co…
C. The Smallest String Concatenation 题目连接: http://www.codeforces.com/contest/632/problem/C Description You're given a list of n strings a1, a2, ..., an. You'd like to concatenate them together in some order such that the resulting string would be lex…
F. Bear and Fair Set 题目连接: http://www.codeforces.com/contest/628/problem/F Description Limak is a grizzly bear. He is big and dreadful. You were chilling in the forest when you suddenly met him. It's very unfortunate for you. He will eat all your coo…
Generate a String 题目链接: http://codeforces.com/contest/710/problem/E Description zscoder wants to generate an input file for some programming competition problem. His input is a string consisting of n letters 'a'. He is too lazy to write a generator s…
http://codeforces.com/contest/954/problem/I 给你两个串s,p,求上一个串的长度为|p|的所有子串和p的差距是多少,两个串的差距就是每次把一个字符变成另一个字符的最小次数,字符最大到f 很明显,如果知道每两个串对应地方不相同的字符就能通过dfs/dsu解出来,那么如何快速的找到所有对应的不匹配的地方呢, 我们先单独考虑两个不同的字符,比如abada中取a,cba中取c,用二进制1代表选取的字符表示就是10101,100,我们用fft来加速这一过程 1 2…
You're given a list of n strings a1, a2, ..., an. You'd like to concatenate them together in some order such that the resulting string would be lexicographically smallest. Given the list of strings, output the lexicographically smallest concatenation…
https://codeforces.com/contest/1140/problem/C 题意 每首歌有\(t_i\)和\(b_i\)两个值,最多挑选m首歌,使得sum(\(t_i\))*min(\(b_i\))最大 题解 假如最小的\(b_i\)确定了,那么拿得越多越好 枚举最小的\(b_i\)然后取剩下最大的\(t_i\) 两种做法 1.从\(b_i\)大向小扫,这样用优先队列维护最大的那些\(t_i\)(丢弃最小的) 2.用两个优先队列模拟 代码 //做法1 #include<bits/…