#include <iostream>
#include <algorithm>
#include <utility>
using namespace std;
int main()
{
long long int n, k;
cin >> n >> k;
long long a = 1, b = 1;
long long ret = 2;
if (n == 0)
{
cout << 0 << " " << 1;
return 0;
}
else if (n == 1)
{
cout << 1 << " "<<0;
return 0;
}
else if (n == 2)
{
cout << 1 << " " << 1 << endl;
return 0;
}
for (long long i = 3; i <= n; i++)
{
ret = a + b;
a = b;
b = ret;
}
cout << ret << " " << a << endl;
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
1000 ms |
1668 KB |
Program timed out |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Halted |
0 ms |
0 KB |
- |