Submission #1443596
Source Code Expand
#include <iostream> #include <vector> #include <unordered_set> #include <unordered_map> #include <algorithm> using namespace std; using llng = long long; using vi = vector<int>; using vvi = vector<vi>; using vs = vector<string>; template<class T> using hset = unordered_set<T>; template<class Key, class T> using hmap = unordered_map<Key, T>; int main() { int N; cin >> N; vi a(100010); a[1] = a[2] = 0; a[3] = 1; for (int i=4; i<=N; i++) { a[i] = (a[i-1] + a[i-2] + a[i-3]) % 10007; } cout << a[i] << endl; return 0; }
Submission Info
Submission Time | |
---|---|
Task | B - トリボナッチ数列 |
User | hidollara |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 587 Byte |
Status | CE |
Compile Error
./Main.cpp: In function ‘int main()’: ./Main.cpp:23:15: error: ‘i’ was not declared in this scope cout << a[i] << endl; ^