您当前的位置: 首页 > 

对方正在debug

暂无认证

  • 3浏览

    0关注

    399博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

2019牛客暑期多校训练营(第七场)

对方正在debug 发布时间:2019-08-12 21:39:10 ,浏览量:3

A String

题意:给一个01串,把该串划分,使得每个子串都是所在串形成的环中字典序最小的。 题解:把01串中以1、0分界处都拆开,对拆分出来的子串我们再两两比对,可以合并则合并。队友AC代码

#include
#define LL long long
#define ms0(x) memset(x,0,sizeof(x))
#define ms-1(x) memset(x,-1,sizeof(x))
bool vis[300];
using namespace std;
int pos[300];
string save[300];
struct node{
    string str;
    int num_0;
    int num_1;
    node(string a):str(a)
    {
        num_0=0;int j=0;
        for(;j(const node & tmp)const{
        string tmp1,tmp2;
        tmp1=str+tmp.str;
        tmp2=tmp.str+str;
        return tmp1>t;string str;
    while(t--)
    {
        cin>>str;
        pos[0]=-1;
        memset(vis,0,sizeof(vis));
        int cnt=1;
        for(int j=0;j            
关注
打赏
1664895754
查看更多评论
0.0422s