#include <string>
#include <cmath>
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <list>
#include <stdio.h>
#include <string.h>
using namespace std;
int main()
{
int n;
cin >> n;
int me[250][2], you[250][2];
me[0][0] = 1;
me[0][1] = 0;
you[0][0] = 0;
you[0][1] = 1;
for (int i = 1; i < n; i++)
{
me[i][0] = me[i - 1][0];
me[i][1] = you[i - 1][0];
you[i][0] = me[i - 1][1] + you[i - 1][0] + you[i - 1][1];
you[i][1] = me[i - 1][0] + me[i - 1][1] + you[i - 1][1];
me[i][0] %= 1000000007;
me[i][1] %= 1000000007;
you[i][0] %= 1000000007;
you[i][1] %= 1000000007;
}
cout << me[n - 1][0] + me[n - 1][1] << endl;
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
1716 KB |
Output is correct |
2 |
Correct |
0 ms |
1716 KB |
Output is correct |
3 |
Correct |
0 ms |
1716 KB |
Output is correct |
4 |
Correct |
0 ms |
1716 KB |
Output is correct |
5 |
Correct |
0 ms |
1716 KB |
Output is correct |
6 |
Incorrect |
0 ms |
1716 KB |
Output isn't correct |
7 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Halted |
0 ms |
0 KB |
- |