#include<bits/stdc++.h> using namespace std; string s; unsigned long long l; unsigned long long a,b,c; unsigned long long stroll(string ss) { unsigned long long x=0; for(int i=0;i<s.length();i++) { x=x*10+(int)(s[i]-48); } return x; } int main() { ios_base::sync_with_stdio(0); cin>>s; l=stroll(s); int dl=1; unsigned long long l2=l; while(l2>0) { dl=dl*10; l2=l2/10; } a=b=1;c=2; unsigned long long mod=1000000000000000000LL; for(int i=1;i<1500000;i++) { if(a%dl==l){cout<<"150000000000000000000"<<i<<"\n";return 0;} a=b; b=c; c=(a+b)%mod; // cout<<i<<" "<<a<<"\n"; } cout<<"NIE"; }
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | #include<bits/stdc++.h> using namespace std; string s; unsigned long long l; unsigned long long a,b,c; unsigned long long stroll(string ss) { unsigned long long x=0; for(int i=0;i<s.length();i++) { x=x*10+(int)(s[i]-48); } return x; } int main() { ios_base::sync_with_stdio(0); cin>>s; l=stroll(s); int dl=1; unsigned long long l2=l; while(l2>0) { dl=dl*10; l2=l2/10; } a=b=1;c=2; unsigned long long mod=1000000000000000000LL; for(int i=1;i<1500000;i++) { if(a%dl==l){cout<<"150000000000000000000"<<i<<"\n";return 0;} a=b; b=c; c=(a+b)%mod; // cout<<i<<" "<<a<<"\n"; } cout<<"NIE"; } |