Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- std::ifstream f("siruri2.in");
- std::ofstream g("siruri2.out");
- long long divi(long long n)
- {
- long long d=2, p, P=1;
- while(n>1)
- {
- p=0;
- while(n%d==0)
- {
- p++;
- n/=d;
- }
- if(p)
- P*=(p+1);
- d++;
- if(d*d>n)
- d=n;
- }
- return P;
- }
- long long ogl(long long n)
- {
- long long xo=0;
- while(n)
- {
- xo = xo * 10 + n%10;
- n/=10;
- }
- return xo;
- }
- int main()
- {
- int T, n;
- long long a=1, b=1, c=0;
- f >> T >> n;
- if(n<=2)
- g<<1<<" "<<1;
- else if(T == 1)
- {
- for(int i=3;i<=n; i++)
- {
- c=a+b;
- a=b;
- b=c;
- }
- g<<c<<" "<<divi(c);
- }
- else if(T == 2)
- {
- for(int i=3;i<=n; i++)
- {
- c=a+b;
- a=b;
- b=ogl(c);
- }
- g<<c<<" "<<divi(c);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement