您当前的位置: 首页 > 

对方正在debug

暂无认证

  • 2浏览

    0关注

    399博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

Codeforces Round #582 (Div. 3)

对方正在debug 发布时间:2019-09-02 19:55:19 ,浏览量:2

原题链接:http://codeforces.com/contest/1213

A - Chips Moving
#include
using namespace std;
const int maxn=110;

int n,a[maxn];
int main()
{
	while(~scanf("%d",&n)){
		int p1=0,p2=0,x;
		for(int i=1;imn) ans++;
			else mn=a[i];
		}
		printf("%d\n",ans);
	}
	return 0;
}
D2 - Equalizing by Division (hard version)(暴力/sort)

题意:给定n个数,每次操作选择一个数除2(向下取整),问要多少次操作,使得原序列有k个数相等 题解:存下每个数除2后的每个数,记录它们的出现次数,凑k个相等时的最小代价。

#include
using namespace std;
const int maxn=200010;

int n,a[maxn],x,k;
vector ve[maxn];
int vis[maxn];
int main()
{
	while(~scanf("%d%d",&n,&k)){
		memset(vis,0,sizeof(vis));
		for(int i=0;i>s2;
		string s="abc";
		do{
			string res="";
			for(int i=0;i            
关注
打赏
1664895754
查看更多评论
0.0393s