#include <cstdio>
#include <iostream>
#include <algorithm>
int main()
{
int k1=k,k2=k;
int ans=k;
do
{
k1=next(n,k1);
k2=next(n,k2);
if(k2>ans)
ans=k2;
k2=next(n,k2);
if(k2>ans)
ans=k2;
}while(k1!=k2);
cout<<ans;
}
}
Floyd判圈算法
最新推荐文章于 2023-04-06 17:05:42 发布