终于结束的起点

额,本以为暴力过不去,qwq。。竟然过去了。。。

// luogu-judger-enable-o2
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cstring>
using namespace std;
int n,k,a,b,i;
int main()
{
    cin>>n;
    a=0;
    b=1;
    for(i=1;;i++)
    {
        int c=a+b;
        a=b;
        b=c;
        b%=n;
        if(a==0&&b==1)
            break;
    }
    cout<<i;
}

很简单了,就是暴力。。。

猜你喜欢

转载自www.cnblogs.com/Shen-Yu/p/9903536.html