Submission #19704

# Submission time Handle Problem Language Result Execution time Memory
19704 2016-02-25T04:44:57 Z panda959595 동전 (kriii4_E) C++
0 / 100
0 ms 1716 KB
#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
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 -
# Verdict Execution time Memory Grader output
1 Halted 0 ms 0 KB -