您当前的位置: 首页 > 

钟钟终

暂无认证

  • 0浏览

    0关注

    233博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

8/12 最小表示法+牛客月赛

钟钟终 发布时间:2022-08-13 01:03:01 ,浏览量:0

P1368 【模板】最小表示法

用途:求出最小同构串 思路: 1.破环成链,长度扩大为2倍 2.利用三个指针控制,分类跳转,及时淘汰不满足题意 选项。

#include
#define endl '\n'
#define re register
using namespace std;
const int N=7e5+10;
const int inf=0x3f3f3f3f;
int n;
int s[N];
int get_min(int s[]) //找出最小同构串
{
    for(int i=1;is[i];
    int k=get_min(s);

    for(int i=k;i>y;
        node tmp={x*m+y,x*m+y};
        int p=lower_bound(g+1,g+cnt+1,tmp)-g;
        if(p>cnt)
            cout            
关注
打赏
1664378814
查看更多评论
0.0387s