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…
Equal Rectangles time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output You are given 4n4n sticks, the length of the ii-th stick is aiai. You have to create nn rectangles, each rectangle will con…
题目链接: http://codeforces.com/problemset/problem/268/E E. Playlist time limit per test 1 secondmemory limit per test 256 megabytes 问题描述 Manao's friends often send him new songs. He never listens to them right away. Instead, he compiles them into a play…