http://codeforces.com/contest/723/problem/C 题目是给出一个序列 a[i]表示第i个歌曲是第a[i]个人演唱,现在选出前m个人,记b[j]表示第j个人演唱歌曲的数量, 现在你可以改变a[]这个数组,使得前m个人的演唱歌曲的数量的最小值最大. 很明显对于前m个人,每个人唱了多少首是很容易统计出来的,只需要对<=m的人进行统计即可,不用统计>m的,这样的话数组只需开到2000即可. 对于后面的人,可以改变,优先改变前m个人中演唱歌曲最小的那个,这个可以用优…
PS_B:阿洗吧!B题卧槽数组开了250... PS_D:D题主要挂在了50*50口算得了250,数组开小,然后一开始还错了.= =哎,以后对于数据范围还是注意一点: 卧槽,这场可真二百五了... A题: 水~ #include<cstdio> #include<iostream> #include<string.h> #include<algorithm> using namespace std; const int N=1010; int sum; in…
A. Inna and Choose Options time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output There always is something to choose from! And now, instead of "Noughts and Crosses", Inna choose a very unusu…
Brain's Photos 题目链接: http://codeforces.com/contest/707/problem/A Description Small, but very brave, mouse Brain was not accepted to summer school of young villains. He was upset and decided to postpone his plans of taking over the world, but to becom…
C. Polycarp at the Radio time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Polycarp is a music editor at the radio station. He received a playlist for tomorrow, that can be represented as a…
A. The New Year: Meeting Friends 水 #include <set> #include <map> #include <stack> #include <queue> #include <cstdio> #include <vector> #include <cstring> #include <iostream> #include <algorithm> using…
A. The New Year: Meeting Friends time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output There are three friend living on the straight line Ox in Lineland. The first friend lives at the point x1, t…
A - The New Year: Meeting Friends 水 #include<iostream> #include<algorithm> using namespace std; int main() { int a,b,c; cin>>a>>b>>c; cout<<max(a,max(b,c)) - min(a,min(b,c)) <<endl; ; } B - Text Document Analysis…
A. Vasya and Football 题目连接: http://codeforces.com/contest/493/problem/A Description Vasya has started watching football games. He has learned that for some fouls the players receive yellow cards, and for some fouls they receive red cards. A player wh…
题目链接:http://codeforces.com/contest/723/problem/D 题意:给定n*m小大的字符矩阵.'*'表示陆地,'.'表示水域.然后湖的定义是:如果水域完全被陆地包围则称为湖. 海的定义:如果水域与任何一个边界的水域有连通则陈伟海.现在要求填一些湖使得最后湖的数量恰好等于K.输出最小要填多少个单位的'.'水域和最终填完之后的字符矩阵. 思路:水题.注意本题的连通是四个方向[上下左右],然后dfs每一个连通块,对于每个连通块我们维护2个值:水域的数目和连通块属于海…