转载请注明出处: http://www.cnblogs.com/fraud/          ——by fraud A. SwapSort time limit per test    1 second memory limit per test      256 megabytes input      standard input output      standard output In this problem your goal is to sort an array consis…
http://codeforces.com/contest/489 Problems     # Name     A SwapSort standard input/output 1 s, 256 MB    x2668 B BerSU Ball standard input/output 1 s, 256 MB    x2659 C Given Length and Sum of Digits... standard input/output 1 s, 256 MB    x2261 D U…
题目链接:http://codeforces.com/contest/489 A:SwapSort In this problem your goal is to sort an array consisting of n integers in at most n swaps. For the given array find the sequence of swaps that makes the array sorted in the non-descending order. Swaps…
http://codeforces.com/contest/489/problem/E E. Hiking time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output A traveler is planning a water hike along the river. He noted the suitable rest points…
http://codeforces.com/problemset/problem/489/D D. Unbearable Controversy of Being time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Tomash keeps wandering off and getting lost while he is wal…
http://codeforces.com/problemset/problem/489/C C. Given Length and Sum of Digits... time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output You have a positive integer m and a non-negative integer …
http://codeforces.com/problemset/problem/489/B B. BerSU Ball time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output The Berland State University is hosting a ballroom dance in celebration of its 1…
http://codeforces.com/problemset/problem/489/A A. SwapSort time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output In this problem your goal is to sort an array consisting of n integers in at most …
题意:求该死的菱形数目.直接枚举两端的点.平均意义每一个点连接20条边,用邻接表暴力计算中间节点数目,那么中间节点任选两个与两端可组成的菱形数目有r*(r-1)/2. 代码: #include<iostream> #include<cstdio> #include<cmath> #include<map> #include<cstring> #include<algorithm> #define rep(i,a,b) for(int…
B. BerSU Ball time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output The Berland State University is hosting a ballroom dance in celebration of its 100500-th anniversary! n boys and m girls are al…