Task: | Torni |
Sender: | Ender |
Submission time: | 2020-09-26 16:57:35 +0300 |
Language: | C++ (C++11) |
Status: | READY |
Result: | 0 |
group | verdict | score |
---|---|---|
#1 | WRONG ANSWER | 0 |
#2 | WRONG ANSWER | 0 |
#3 | WRONG ANSWER | 0 |
test | verdict | time | group | |
---|---|---|---|---|
#1 | WRONG ANSWER | 0.01 s | 1, 2, 3 | details |
#2 | WRONG ANSWER | 0.01 s | 2, 3 | details |
#3 | WRONG ANSWER | 0.01 s | 3 | details |
Code
#include <bits/stdc++.h> #define ll long long int using namespace std; int M = 1e9+7; ll k[101010]; ll f(int a) { if(k[a]) return k[a]; if(a<0) return 0; k[a] = (6*f(a-1))%M; k[a] = (k[a]-(7*f(a-2)))%M; return k[a]; } int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int n; cin >> n; k[0] = 1; k[1] = 2; k[2] = 8; cout << f(n) << "\n"; return 0; }
Test details
Test 1
Group: 1, 2, 3
Verdict: WRONG ANSWER
input |
---|
10 1 2 3 4 ... |
correct output |
---|
2 8 34 148 650 ... |
user output |
---|
1086296 |
Test 2
Group: 2, 3
Verdict: WRONG ANSWER
input |
---|
100 1 2 3 4 ... |
correct output |
---|
2 8 34 148 650 ... |
user output |
---|
-706285041 |
Test 3
Group: 3
Verdict: WRONG ANSWER
input |
---|
100 996306 650655 896240 821967 ... |
correct output |
---|
87350005 606189151 122595036 193572715 227926807 ... |
user output |
---|
-706285041 |