Problem hidden
|This problem was hidden by Editorial Board member probably because it has incorrect language|version or invalid test data, or description of the problem is not clear.|

RGB7607 - Фибаноччийн гишүүний цифр

F0=1, F1=1, Fn=Fn-1+Fn-2 томьёо өгөгдсөн бол n-р гишүүний нэгжийн цифрийг ол.

Input

Натурал тоо өгөгдөнө. 1<=n<=1000.

Output

Fn-ий сүүлийн цифр.

Example

Input: 

7

Output:

1


Нэмсэн:Bataa
Огноо:2013-01-24
Хугацааны хязгаарлалт:1s
Эх кодын хэмжээний хязгаарлалт:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Програмчлалын хэлүүд:ADA95 ASM32 BASH BF C NCSHARP CSHARP C++ 4.3.2 CPP C99 CLPS LISP sbcl LISP clisp D ERL FORTRAN HASK ICON ICK JAVA JS-RHINO JULIA LUA NEM NICE OCAML PAS-GPC PAS-FPC PERL PHP PIKE PRLG-swi PYTHON PYPY3 PYTHON3 RUBY SCALA SCM guile ST TCL WHITESPACE

hide comments
2022-06-09 06:33:52
ygd aldaa zaagaad bdg llr ve llar chn
2022-04-21 03:48:34
minii buruu yu chinii buruu yu
2022-04-02 07:50:45
zuv yman deer alda zagaa shagad
2022-01-27 16:17:17
ygd alda zagad bga pizda ve
2021-01-14 06:20:06
#include <iostream>

using namespace std;

int main(){
int n, i;
long long a[1005];
cin >> n;
a[0]=1;
a[1]=1;
a[2]=2;

for(i=2; i<=n; i++){
a[i] = (a[i - 1] + a[i - 2]) % 10;
}
cout << a[n];
}
2020-11-07 05:17:26
#iasdfncludadsge<csdfgtddfsgio>
indfsgt sdfgmainfdgd(dfgsfg) {
indfgt a[10sdfg01],n;
a[sdaf0]=sdf1;
a[dsf1dsfas]=dsaf1;
scanf("%d",&n);
for(int i=2;i<=n;i++){
a[i]=a[i-1]+a[i-2];
a[i]=a[i]%10;
}

prasdfintfdsafasdf("%ddfsadf",a[nsdfa]);
}
2019-11-20 12:13:37
#include <iostream>
using namespace std;
int main() {
long long a[1010], n={0};
scanf("%d",&n);
a[0]=1;
a[1]=1;
for(int i=2;i<=n;i++){
a[i]=a[i-1]+a[i-2];
a[i]=a[i]%10;
}
printf("%d",a[n]);
}
2019-06-14 12:44:47
yu ni bolohgui bgaag helj uguuch pls
#include<iostream>
using namespace std;
main()
{long long a[1000],b,n,k,i,j;
cin>>n;
a[-2]=1;a[-1]=0;
for(k=0;k<=n;k++){a[k]=a[k-1]+a[k-2];b=a[k];
}
cout<<b%10;

}
2019-04-03 05:55:55
#include<bits/stdc++.h>
using namespace std;

int main()
{
long long e,i,n,a[1010];
scanf("%lld",&n);
a[0]=1;
a[1]=1;
for(i=2;i<=n;i++)
{

a[i]=a[i-1]+a[i-2];
e=a[n]%10;
}
printf("%lld",e);
}
2019-03-15 03:22:22
#include<bits/stdc++.h>
using namespace std;
int e,i,n,f[100];
int main()
{
scanf("%d",&n);
1<=n<=1000;
f[0]=1;
f[1]=1;
for(i=2;i<=n;i++)
f[i]=f[i-1]+f[i-2];
e=f[n]%10;
printf("%d",e);
return 0;
}
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.