AtCoder Beginner Contest 006

Submission #1675722

Source codeソースコード

#include <bits/stdc++.h>
using namespace std;

int memo[1000010];

int trib(int n){
  if (n <= 1) return 1;
  if (memo[n] != 0) return memo[n];
  return trib(n - 1) + trib(n - 2) + trib(n - 3);
}

int main(){
  int n;
  cin >> n;
  cout >> trib(n) % 10007 << endl;
  return 0;
}

Submission

Task問題 B - トリボナッチ数列
User nameユーザ名 aximov
Created time投稿日時
Language言語 C++14 (GCC 5.4.1)
Status状態 CE
Score得点 -
Source lengthソースコード長 294 Byte
File nameファイル名
Exec time実行時間 -
Memory usageメモリ使用量 -

Compiler messageコンパイルメッセージ

./Main.cpp: In function ‘int main()’:
./Main.cpp:15:8: error: no match for ‘operator>>’ (operand types are ‘std::ostream {aka std::basic_ostream<char>}’ and ‘int’)
cout >> trib(n) % 10007 << endl;
^
./Main.cpp:15:8: note: candidate: operator>>(int, int) <built-in>
./Main.cpp:15:8: note: no known conversion for argument 1 from ‘std::ostream {aka std::basic_ostream<char>}’ to ‘int’
In file included from /usr/include/c++/5/string:53:0,
from /usr/include/c++/5/bits/locale_classes.h:40,
from /usr/include/c++/5/bits/ios_base.h:41,
from /usr/include/c++/5/ios:42,
from /usr/include/c++/5/istream:38,
from /usr/include/c++/5/sstream:38,
from /usr/include/c++/5/complex:45,
from /usr/include/c++/5/ccomplex:38,
from /usr/include/x86_64-linux-gnu/c++/5/bits/stdc++.h:52,
from ./Main.cpp:1:
/usr/include/c++/5/bits/basic_string.tcc:1437:5: note: candidate: templ...

Test case