您当前的位置: 首页 > 

对方正在debug

暂无认证

  • 4浏览

    0关注

    399博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

Codeforces Round #572 (Div. 2)

对方正在debug 发布时间:2019-07-13 13:39:02 ,浏览量:4

题目链接:http://codeforces.com/contest/1189

A. Keanu Reeves

给一个01串,让你切成多个串,使得每个串0、1个数不同

#include
using namespace std;
 
int main()
{
	int n;
	char s[110];
	while(~scanf("%d",&n)){
		scanf("%s",s);
		int f0=0,f1=0;
		for(int i=0;ia[id] 题解:排序,将序列按大到小,a[n]、a[n-2]、a[n-3]、…a[1]、a[n-2],这样a[n-2]、a[n-2]、a[n-3]、…a[1]每个数,周围都有比他大的数,对于a[n],我们取邻近最大的数a[n-1]、a[n-2]和他比较。

#include
using namespace std;
const int maxn=300010;
 
int a[maxn];
int main()
{
	int n;
	while(~scanf("%d",&n)){
		for(int i=0;i            
关注
打赏
1664895754
查看更多评论
0.0397s