码迷,mamicode.com
首页 > 其他好文 > 详细

cf 1004 B. Sonya and Exhibition

时间:2019-01-22 21:47:49      阅读:148      评论:0      收藏:0      [点我收藏+]

标签:print   clu   地方   space   col   namespace   span   color   最大   

这破题题目背景一大堆,吓死我了。然而出现在这种地方一定很简单。于是考虑对于每一段都取最优解,01交替取值,这样对于奇数长度还是偶数长度的子段x*y都最接近最大值

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,m;
    scanf("%d%d",&n,&m);
    for(int i=1;i<=m;i++)
    {
        int x,y;
        scanf("%d%d",&x,&y);
    }
    int flag=0;
    for(int i=1;i<=n;i++)
    {
        printf("%d",flag);
        flag^=1;
    }
}

 

cf 1004 B. Sonya and Exhibition

标签:print   clu   地方   space   col   namespace   span   color   最大   

原文地址:https://www.cnblogs.com/lishengkangshidatiancai/p/10306007.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!