A. Prime Permutation 题目连接: http://www.codeforces.com/contest/123/problem/A Description You are given a string s, consisting of small Latin letters. Let's denote the length of the string as |s|. The characters in the string are numbered starting from…
You are given n k-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 by the same rule in all integers. Input The first line cont…
B. Rectangle and Square 题目连接: http://codeforces.com/contest/135/problem/B Description Little Petya very much likes rectangles and especially squares. Recently he has received 8 points on the plane as a gift from his mother. The points are pairwise di…
time limit per test 1 second memory limit per test 64 megabytes input standard input output standard output One hot summer day Pete and his friend Billy decided to buy a watermelon. They chose the biggest and the ripest one, in their opinion. After t…