Submission #19704

#TimeUsernameProblemLanguageResultExecution timeMemory
19704panda959595동전 (kriii4_E)C++98
0 / 100
0 ms1716 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...