This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |