http://codeforces.com/problemset/problem/124/B Description You are given nk-digit integers. You have to rearrange the digits in the integers so that the difference between the largest and the smallest number was minimum. Digits should be rearranged b…
反向思维,先求数组中不用处理的元素个数,再用n减去这个数,得到结果. #include <iostream> #include <cstring> #define maxn 200000+10 using namespace std; int n; int a[maxn],b[maxn]; int visit[maxn]; int main (){ while (cin>>n){ int flag,temp; int ans=maxn; memset (visit,,s…
Codeforces Round #485 (Div. 2) E. Petr and Permutations 题目连接: http://codeforces.com/contest/987/problem/E Description Petr likes to come up with problems about randomly generated data. This time problem is about random permutation. He decided to gene…
题目链接:http://codeforces.com/contest/340/problem/E E. Iahub and Permutations time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Iahub is so happy about inventing bubble sort graphs that he's sta…
E. Alphabet Permutations time limit per test: 1 second memory limit per test: 512 megabytes input: standard input output: standard output You are given a string s of length n, consisting of first k lowercase English letters. We define a c-repeat o…
C. Iahub and Permutations time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Iahub is so happy about inventing bubble sort graphs that he's staying all day long at the office and writing permu…
转载请注明出处: http://www.cnblogs.com/fraud/ ——by fraud Iahub and Permutations Iahub is so happy about inventing bubble sort graphs that he's staying all day long at the office and writing permutations. Iahubina is angry that she is no more import…