submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s941524914
p02233
C
#include <iostream> using namespace std; typedef unsigned long long ull; auto fib(ull const n) -> ull { return ( n == 0 || n == 1 ) ? 1 : fib( n - 2 ) + fib( n - 1 ); } int main() { ull n; cin >> n; cout << fib( n ) << endl; }
main.c:1:10: fatal error: iostream: No such file or directory 1 | #include <iostream> | ^~~~~~~~~~ compilation terminated.
s359279251
p02233
C
k
main.c:1:1: error: expected '=', ',', ';', 'asm' or '__attribute__' at end of input 1 | k | ^~
s887737635
p02233
C
#include <iostream> using namespace std; int main() { int a=1,b=1,n; cin>>n; for (int i=0; i<n-1; i++) { swap(a,b); a+=b; } cout<<a<<endl; }
main.c:1:10: fatal error: iostream: No such file or directory 1 | #include <iostream> | ^~~~~~~~~~ compilation terminated.
s563458601
p02233
C++
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s011892727
p02233
C++
w#include <stdio.h> int fib(int); int fibo[45]; int main(){ int n,i; for(i=0;i<45;i++)fibo[i]=-1; scanf("%d",&n); printf("%d\n",fib(n)); return 0; } int fib(int n){ if(n==0 || n==1)return fibo[n]=1; if(fibo[n]!=-1)return fibo[n]; return fibo[n]=fib(n-1)+fib(n-2); }
a.cc:1:2: error: stray '#' in program 1 | w#include <stdio.h> | ^ a.cc:1:1: error: 'w' does not name a type 1 | w#include <stdio.h> | ^ a.cc: In function 'int main()': a.cc:7:3: error: 'scanf' was not declared in this scope 7 | scanf("%d",&n); | ^~~~~ a.cc:8:17: error: 'fib' was not d...
s082858951
p02233
C++
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s028536963
p02233
C++
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s192067528
p02233
C++
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s240291434
p02233
C++
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s351323123
p02233
C++
#include<stdio.h> int fib(int n){ if(n == 0 || n == 1) return 1; else return fib(n-1)+fib(n-2); } int main() { int n; scanf("%d",&n); //n = fib(n); printf("%d\n",fib(n); return 0; }
a.cc: In function 'int main()': a.cc:18:23: error: expected ')' before ';' token 18 | printf("%d\n",fib(n); | ~ ^ | )
s029901229
p02233
C++
#ifndef _GLIBCXX_NO_ASSERT #include <cassert> #endif #include <cctype> #include <cerrno> #include <cfloat> #include <ciso646> #include <climits> #include <clocale> #include <cmath> #include <csetjmp> #include <csignal> #include <cstdarg> #include <cstddef> #include <cstdio> #include <cstdlib> #include <cstring> #includ...
a.cc: In function 'int fibonacci(int)': a.cc:196:14: error: reference to 'list' is ambiguous 196 | return list[n] = 1; | ^~~~ In file included from /usr/include/c++/14/list:65, from a.cc:44: /usr/include/c++/14/bits/stl_list.h:633:11: note: candidates are: 'template<class _Tp...
s404202490
p02233
C++
#ifndef _GLIBCXX_NO_ASSERT #include <cassert> #endif #include <cctype> #include <cerrno> #include <cfloat> #include <ciso646> #include <climits> #include <clocale> #include <cmath> #include <csetjmp> #include <csignal> #include <cstdarg> #include <cstddef> #include <cstdio> #include <cstdlib> #include <cstring> #includ...
a.cc: In function 'int fibonacci(int, std::vector<int>&)': a.cc:202:29: error: too few arguments to function 'int fibonacci(int, std::vector<int>&)' 202 | return list[n] = fibonacci(n-1) + fibonacci(n-2); | ~~~~~~~~~^~~~~ a.cc:188:5: note: declared here 188 | int fibonacci( int n , vector...
s035933521
p02233
C++
=
a.cc:1:1: error: expected unqualified-id before '=' token 1 | = | ^
s938433168
p02233
C++
#include <iostream> using namespace std; int main() { int n; int dp[45]; // 初期化 dp[0] = 1; dp[1] = 1; //入力 cin >> n; // DP for(int i = 2; i <= n; i++) dp[i] = dp[i-1] + dp[i-2]; // 出力 cout << fib(n) << endl; return 0; }
a.cc: In function 'int main()': a.cc:20:11: error: 'fib' was not declared in this scope 20 | cout << fib(n) << endl; | ^~~
s373102458
p02233
C++
a
a.cc:1:1: error: 'a' does not name a type 1 | a | ^
s511435312
p02233
C++
a
a.cc:1:1: error: 'a' does not name a type 1 | a | ^
s428970713
p02233
C++
#include <iostream> using namespace std; int fib(int n){ if(n<0){ return 0; } if(n==1||n==2){ return 0 } return fib(n-1)+fib(n-2); } int main(){ int n; cin << n ; cout <<fib(n)<<endl; }
a.cc: In function 'int fib(int)': a.cc:11:13: error: expected ';' before '}' token 11 | return 0 | ^ | ; 12 | } | ~ a.cc: In function 'int main()': a.cc:19:7: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<cha...
s772243583
p02233
C++
#include <iostream> using namespace std; int fib(int n){ if(n<0){ return 0; } if(n==1||n==2){ return 0; } return fib(n-1)+fib(n-2); } int main(){ int n; cin << n ; cout <<fib(n)<<endl; }
a.cc: In function 'int main()': a.cc:19:7: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int') 19 | cin << n ; | ~~~ ^~ ~ | | | | | int | std::istream {aka std::basic_istream<char>} a.cc:19:7: note: candidate: 'ope...
s858131114
p02233
C++
#include <iostream> using namespace std; int A[128] int fib(int n){ A[0] =1 for(int i=1;i<n;++i){ A[i] =A[i-1]; if(i>2)A[i]+=A[i-2]; if(i>3)A[i]+=A[i-3]; } return A[n-1]; } int main(){ int n; cin >> n ; cout <<fib(n)<<endl; }
a.cc:6:1: error: expected initializer before 'int' 6 | int fib(int n){ | ^~~ a.cc: In function 'int main()': a.cc:20:10: error: 'fib' was not declared in this scope 20 | cout <<fib(n)<<endl; | ^~~
s977435587
p02233
C++
#include <iostream> using namespace std; int A[128]; int fib(int n){ A[0] =1; A[1] =2 for(int i=2;i<44;++i){ A[i] =A[i-1]; if(i>1)A[i]+=A[i-2]; } return A[n-1]; } int main(){ int n; cin >> n ; cout <<fib(n)<<endl; }
a.cc: In function 'int fib(int)': a.cc:8:10: error: expected ';' before 'for' 8 | A[1] =2 | ^ | ; 9 | for(int i=2;i<44;++i){ | ~~~ a.cc:9:15: error: 'i' was not declared in this scope 9 | for(int i=2;i<44;++i){ | ^
s144805519
p02233
C++
#include<iostream> #include<string> #include<vector> #include<cstdio> #include<sstream> #include<algorithm> #include<cmath> #include<map> using namespace std; dp[50]; int main(){ int n; cin>>n; dp[0]=1,dp[1]=1; for(int i=2;i<=n;i++)dp[i]=dp[i-1]+dp[i-2]; cout<<dp[n]<<endl; return 0; }
a.cc:10:1: error: 'dp' does not name a type 10 | dp[50]; | ^~ a.cc: In function 'int main()': a.cc:14:9: error: 'dp' was not declared in this scope 14 | dp[0]=1,dp[1]=1; | ^~
s583205239
p02233
C++
#include <iostream> using namespace std; int fib(int n) { if(n==1) return 1; else if(n==2) return 2; else return fib(n-1) + fib(n-2); } int main(void){ int n; cin >> n cout << fib(n) << endl; return 0; }
a.cc: In function 'int main()': a.cc:13:13: error: expected ';' before 'cout' 13 | cin >> n | ^ | ; 14 | cout << fib(n) << endl; | ~~~~
s681958919
p02233
C++
fibonacci :: Int -> Int fibonacci = fibo (1, 1) 2 where fibo :: (Int, Int) -> Int -> Int -> Int fibo (pp, prev) pos n | n < 2 = 1 | pos >= n = pp + prev | otherwise = fibo (prev, pp+prev) (pos+1) n main :: IO () main = do n <- readLn putStrLn $ show $ fibonacci n
a.cc:1:1: error: 'fibonacci' does not name a type 1 | fibonacci :: Int -> Int | ^~~~~~~~~
s174130003
p02233
C++
import java.util.Scanner; import java.util.ArrayList; import java.util.Stack; class Main{ public static void main(String[] args){ Solve s = new Solve(); s.solve(); } } class Solve{ Solve(){} int[] memo; void solve(){ Scanner in = new Scanner(System.in); memo = new int[45]; int n = in.nextInt();...
a.cc:2:1: error: 'import' does not name a type 2 | import java.util.Scanner; | ^~~~~~ a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:3:1: error: 'import' does not name a type 3 | import java.util.ArrayList; | ^~~~~~ a.cc:3:1: note: C++20 'import' only available with '-fmodule...
s294066054
p02233
C++
require 'matrix' def fib(n) a = Matrix[[1, 1], [1, 0]] return (a**(n+1))[1, 0] end puts fib(gets.to_i)
a.cc:1:9: warning: multi-character literal with 6 characters exceeds 'int' size of 4 bytes 1 | require 'matrix' | ^~~~~~~~ a.cc:1:1: error: 'require' does not name a type 1 | require 'matrix' | ^~~~~~~
s585085999
p02233
C++
def fib(n): if n <= 1: return n return fib(n - 1) + fib(n - 2) n = int(strip(raw_input())) print fib(n)
a.cc:1:1: error: 'def' does not name a type 1 | def fib(n): | ^~~
s883777892
p02233
C++
#include <iostream> #include <vector> #define eol '\n' using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(0); vector<int> list(N,0); list[0] = list[1] = 1; int n; cin >> n; for (int i = 2; i <= n; i++) { list[i] = list[i-1] + list[i-2]; } cout << list[n] << eol; ...
a.cc: In function 'int main()': a.cc:10:20: error: 'N' was not declared in this scope 10 | vector<int> list(N,0); | ^
s308501605
p02233
C++
// -*- mode:c++; coding:utf-8; c-basic-offset:2; -*- // ALDS1_10_A: Fibonacci Number #include <algorithm> #include <cstdio> #define NDEBUG #include <cassert> class Fibonnacci { static const unsigned int N = 44u; unsigned int n_; unsigned long* f_; public: Fibonnacci(unsigned int n = N) : n_(std::max(1, n)) ...
a.cc: In constructor 'Fibonnacci::Fibonnacci(unsigned int)': a.cc:16:47: error: no matching function for call to 'max(int, unsigned int&)' 16 | Fibonnacci(unsigned int n = N) : n_(std::max(1, n)) | ~~~~~~~~^~~~~~ In file included from /usr/include/c++/14/algorithm:60, ...
s786784516
p02233
C++
#include<iostream> using namespace std; typedef long long hyper hyper fib(int n) { if(n < 2) return 1; if(n == 2) return 2; if(n == 3) return 3; return 3 * fib(n - 2) + fib(n - 4); } int main() { int n; cin >> n; cout << fib(n) << endl; return 0; }
a.cc:6:1: error: expected initializer before 'hyper' 6 | hyper fib(int n) | ^~~~~ a.cc: In function 'int main()': a.cc:18:13: error: 'fib' was not declared in this scope 18 | cout << fib(n) << endl; | ^~~
s594075551
p02233
C++
// fibonacci number. #include<stdio.h> int main() { int n; long long A[45]; scanf("%d", &n); A[0] = 1; A[1] = 1; for(int i = 2; i <= n; i++) A[i] = A[i - 1] + A[i - 2]; printf("%d\n", A[n]; return 0; }
a.cc: In function 'int main()': a.cc:11:24: error: expected ')' before ';' token 11 | printf("%d\n", A[n]; | ~ ^ | )
s077882723
p02233
C++
#include<iostream> using namespace std; int fib(int n,int F[]){ if(n==0||n==1){ return F[n]=1; } if(F[n]!=-1){ return F[n]; } return F[n]=fib(n-1) + fib(n-2); } int main(){ int n; cin>>n; int F[n]; for(int i=0;i<n;i++){ F[i]=-1; } cout<<fib(n)<<endl;...
a.cc: In function 'int fib(int, int*)': a.cc:11:24: error: too few arguments to function 'int fib(int, int*)' 11 | return F[n]=fib(n-1) + fib(n-2); | ~~~^~~~~ a.cc:4:5: note: declared here 4 | int fib(int n,int F[]){ | ^~~ a.cc:11:35: error: too few arguments to functi...
s259787314
p02233
C++
#include <cstdio> #include <iostream> using namespace std; int Fibonatch(int result[], int num) { int ret = result[num]; if (ret != 0) { if (num > 1) { ret = Fibonatch(num - 1) + Fibonatch(num - 2); } else { ret = 1; } result[num] = ret; } ...
a.cc: In function 'int Fibonatch(int*, int)': a.cc:11:33: error: invalid conversion from 'int' to 'int*' [-fpermissive] 11 | ret = Fibonatch(num - 1) + Fibonatch(num - 2); | ~~~~^~~ | | | int a.c...
s501584364
p02233
C++
#include <cstdio> #include <iostream> using namespace std; int Fibonatch(int result[], int num) { int ret = result[num]; if (ret != 0) { if (num > 1) { ret = Fibonatch(result, num - 1) + Fibonatch(result, num - 2); } else { ret = 1; } result[num]...
a.cc: In function 'int main()': a.cc:28:5: error: 'result' was not declared in this scope 28 | result = Fibonatch(ret, num); | ^~~~~~
s259408809
p02233
C++
#include <cstdio> #include <iostream> using namespace std; #if 0 int Fibonatch(int result[], int num) { int ret = result[num]; if (ret == 0) { if (num > 1) { ret = Fibonatch(result, num - 1) + Fibonatch(result, num - 2); } else { ret = 1; } resul...
a.cc: In function 'int main()': a.cc:56:5: error: 'scnaf' was not declared in this scope; did you mean 'scanf'? 56 | scnaf("%d", &num); | ^~~~~ | scanf
s201279800
p02233
C++
#include <iostream> using namespace std; int fib(int n) { if (n >= 0) { if (n <= 1) return 1; return fib(n - 1) + fib(n - 2); } } int main(void) { int n; scanf_s("%d", &n); printf("%d", fib(n)); }
a.cc: In function 'int main()': a.cc:13:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 13 | scanf_s("%d", &n); | ^~~~~~~ | scanf a.cc: In function 'int fib(int)': a.cc:9:1: warning: control reaches end of non-void function [-Wreturn-type] 9 | } ...
s309152280
p02233
C++
include <iostream> using namespace std; int fib(int n) { if (n <= 1) return 1; return fib(n-1) + fib(n-2); } int main() { int i = 0; cin >> i; cout << fib(i) << endl; }
a.cc:1:1: error: 'include' does not name a type 1 | include <iostream> | ^~~~~~~ a.cc: In function 'int main()': a.cc:13:5: error: 'cin' was not declared in this scope 13 | cin >> i; | ^~~ a.cc:14:5: error: 'cout' was not declared in this scope 14 | cout << fib(i) << endl; | ...
s698173646
p02233
C++
#include <iostream> using namespace std; int ans[45] = 0; int fib(int n) { if (n <= 1) return 1; int a = ans[n]; if (a) return a; a = fib(n-1) + fib(n-2); ans[n] = a; return a; } int main() { int i = 0; cin >> i; cout << fib(i) << endl; }
a.cc:5:15: error: array must be initialized with a brace-enclosed initializer 5 | int ans[45] = 0; | ^
s965613632
p02233
C++
#include<iostream> int F[100]; // ??????????????? int main() { int n; F[0] = 1; F[1] = 1; for (int i=2; i<45; ++i) { // ??????????????? F[i] = F[i-2]+F[i-1]; } cin>>n; cout<<F[n]; }
a.cc: In function 'int main()': a.cc:12:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 12 | cin>>n; | ^~~ | std::cin In file included from a.cc:1: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Linked to standard i...
s576232717
p02233
C++
#include <iostream> int F[100]; // ??????????????? int main() { int n; F[0] = 1; F[1] = 1; for (int i=2; i<45; ++i) { // ??????????????? F[i] = F[i-2]+F[i-1]; } cin>>n; cout<<F[n]; }
a.cc: In function 'int main()': a.cc:12:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 12 | cin>>n; | ^~~ | std::cin In file included from a.cc:1: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Linked to standard i...
s353541976
p02233
C++
#include <iostream> int F[100]; // ??????????????? int main() { int n; F[0] = 1; F[1] = 1; for (int i=2; i<45; ++i) { // ??????????????? F[i] = F[i-2]+F[i-1]; } cin>>n; cout<<F[n]; }
a.cc: In function 'int main()': a.cc:12:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 12 | cin>>n; | ^~~ | std::cin In file included from a.cc:1: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Linked to standard i...
s932742914
p02233
C++
#include <iostream> int F[100]; int main() { int n; F[0] = 1; F[1] = 1; for (int i=2; i<45; ++i) { // ??????????????? F[i] = F[i-2]+F[i-1]; } cin>>n; cout<<F[n]; }
a.cc: In function 'int main()': a.cc:12:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 12 | cin>>n; | ^~~ | std::cin In file included from a.cc:1: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Linked to standard i...
s723005238
p02233
C++
#include<iostream> using namespace std; int fib(int n) { int F[50]; if(n<=1) return 1; for(i = 2 ; i < =n; i++) { F[i] = F[i-1] + F[i-2]; } return F[n]; } int main() { int n; cin>>n; cout<<fib(n)<<endl; return 0; }
a.cc: In function 'int fib(int)': a.cc:7:9: error: 'i' was not declared in this scope 7 | for(i = 2 ; i < =n; i++) | ^ a.cc:7:21: error: expected primary-expression before '=' token 7 | for(i = 2 ; i < =n; i++) | ^
s698135907
p02233
C++
#include<iostream> using namespace std; int fib(int n) { int F[50]; if(n<=1) return 1; for(int i = 2 ; i < =n; i++) { F[i] = F[i-1] + F[i-2]; } return F[n]; } int main() { int n; cin>>n; cout<<fib(n)<<endl; return 0; }
a.cc: In function 'int fib(int)': a.cc:7:25: error: expected primary-expression before '=' token 7 | for(int i = 2 ; i < =n; i++) | ^
s284143838
p02233
C++
#include <iostream> #include <vector> #include <stack> #include <queue> using namespace std; int main(){ int n; cin >> n; int f1 = 1; int f2 = 1; int f3 = 0; for (int i = 2; i <= n; ++i){ f3 = f1 + f2; f1 = f2; f2 = f3; } if (n == 1){ cout << 1 << endl; return; } if (n == 2){ cout << 2 << endl;...
a.cc: In function 'int main()': a.cc:22:17: error: return-statement with no value, in function returning 'int' [-fpermissive] 22 | return; | ^~~~~~ a.cc:26:17: error: return-statement with no value, in function returning 'int' [-fpermissive] 26 | return; ...
s870185584
p02233
C++
#include <iostream> int fib(int n){ if ( n == 1 || n == 0){ return 1; } return fib(n-1) + fib(n - 2); } std::cout<<fib<<std::endl;
a.cc:10:6: error: 'cout' in namespace 'std' does not name a type 10 | std::cout<<fib<<std::endl; | ^~~~ In file included from a.cc:1: /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~
s667946115
p02233
C++
#include <iostream> int fib(int n){ if ( n == 1 || n == 0){ return 1; } return fib(n-1) + fib(n - 2); } int fib = 0; std::cin>>fib; std::cout<<fib(n)<<std::endl;
a.cc:10:5: error: 'int fib' redeclared as different kind of entity 10 | int fib = 0; | ^~~ a.cc:3:5: note: previous declaration 'int fib(int)' 3 | int fib(int n){ | ^~~ a.cc:11:6: error: 'cin' in namespace 'std' does not name a type 11 | std::cin>>fib; | ^~~ In file included fro...
s436585907
p02233
C++
# -*- coding: utf-8 -*- def main(): def _fibonacci(n,cache): if n in cache: return cache[n] elif n == 0 or n == 1: ret = 1 cache[n] = ret return ret else: ret = _fibonacci(n - 1, cache) + _fibonacci(n - 2, cache) cache...
a.cc:1:3: error: invalid preprocessing directive #- 1 | # -*- coding: utf-8 -*- | ^ a.cc:3:1: error: 'def' does not name a type 3 | def main(): | ^~~ a.cc:19:5: error: expected unqualified-id before 'return' 19 | return _fibonacci(N,cache) | ^~~~~~
s019055467
p02233
C++
#coding: UTF-8 s = input() h = s/3600 s = s%3600 m = s/60 s = s%60 print str(h) + ":" + str(m) + ":" + str(s)
a.cc:1:2: error: invalid preprocessing directive #coding 1 | #coding: UTF-8 | ^~~~~~ a.cc:3:1: error: 's' does not name a type 3 | s = input() | ^
s353527948
p02233
C++
def main(): n = int(input()) dp = [0] * 100 dp[0] = 1 dp[1] = 1 for i in range(2, len(dp)): dp[i] = dp[i - 1] + dp[i - 2] print(dp[n]) if __name__ == '__main__': main()
a.cc:13:16: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes 13 | if __name__ == '__main__': | ^~~~~~~~~~ a.cc:3:1: error: 'def' does not name a type 3 | def main(): | ^~~
s912653212
p02233
C++
#include <iostream> using namespace std; int fib(int n); int main() { int n; //??\??? cin >> n; //?????? cout << fib(n) << endl; return 0; } int fib(int n){ /* ??????1 */ if(n==0||n==1) return 1; else if(memo[n]!=0){ return memo[n]; }else{ return memo[n]=fib(n-1)+fib(n-...
a.cc: In function 'int fib(int)': a.cc:22:11: error: 'memo' was not declared in this scope 22 | else if(memo[n]!=0){ | ^~~~
s772948534
p02233
C++
#icnlude <iostream> using namespace std; int fib(int n); int memo[45]; int main(){ int n; cin >> n; cout << fib(n) << endl; } int fib(int n){ if(n == 0){ return 1; }else if(n == 1){ return 1; }else if(memo[n] != 0){ return memo[n]; }else{ return memo[n] = fib(n-1) + fib(n-2); } }
a.cc:1:2: error: invalid preprocessing directive #icnlude; did you mean #include? 1 | #icnlude <iostream> | ^~~~~~~ | include a.cc: In function 'int main()': a.cc:12:3: error: 'cin' was not declared in this scope 12 | cin >> n; | ^~~ a.cc:1:1: note: 'std::cin' is defined in header '<iostr...
s253578580
p02233
C++
#include <iostream> using namespace std; int fib(int n); int main() { int n; int dp[45]; //????????? /* ??????3-1 */ dp[0]=1; /* ??????3-2 */ dp[1]=1; //??\??? cin >> n; //DP for (int i = 2; i <= n; i++) { /* ??????3-3 */ d@[i]=dp[i-1]+dp[i-2]; } /...
a.cc:22:8: error: stray '@' in program 22 | d@[i]=dp[i-1]+dp[i-2]; | ^ a.cc: In function 'int main()': a.cc:22:7: error: 'd' was not declared in this scope 22 | d@[i]=dp[i-1]+dp[i-2]; | ^
s055704033
p02233
C++
#include <iostream> using namespace std; int fib(int n); int main() { int n; int dp[45]; //????????? /* ??????3-1 */ dp[0] = 1; /* ??????3-2 */ dp[1] = 1 //??\??? cin >> n; //DP for (int i = 2; i <= n; i++) { /* ??????3-3 */ dp[i] = dp[i-1] + dp[i-2]; ...
a.cc: In function 'int main()': a.cc:15:14: error: expected ';' before 'cin' 15 | dp[1] = 1 | ^ | ; ...... 18 | cin >> n; | ~~~
s110114206
p02233
C++
using namespace std; int dp[44]; int fib(int n) { if (dp[n] != -1)return dp[n]; int res; if (n == 0 || n == 1) { res = 1; } else { res = fib(n - 1) + fib(n - 2); } dp[n] = res; return res; } int main() { for (int i = 0; i < 44; i++) { dp[i] = -1; } int n; cin >> n; cout << fib(n); return 0; }
a.cc: In function 'int main()': a.cc:25:9: error: 'cin' was not declared in this scope 25 | cin >> n; | ^~~ a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' +++ |+#include <iostream> 1 | using namespace std; a.cc:26:9: ...
s962289196
p02233
C++
#include<iostream> using namespace std; int main(){ int n; cin >> n; int fn[50]; fn[0] = fn[1] = 1; for(int i = 2; i <= n; i++) fn[i] = fn[i - 1] + fn[i - 2]; cout << fn[n] << end; return 0 }
a.cc: In function 'int main()': a.cc:11:17: error: no match for 'operator<<' (operand types are 'std::basic_ostream<char>' and '<unresolved overloaded function type>') 11 | cout << fn[n] << end; | ~~~~~~~~~~~~~~^~~~~~ In file included from /usr/include/c++/14/iostream:41, from a.cc:1: /usr...
s009187580
p02233
C++
#include<iostream> using namespace std; int main(){ int n; cin >> n; int fn[50]; fn[0] = fn[1] = 1; for(int i = 2; i <= n; i++) fn[i] = fn[i - 1] + fn[i - 2]; cout << fn[n] << end; return 0 }
a.cc: In function 'int main()': a.cc:10:17: error: no match for 'operator<<' (operand types are 'std::basic_ostream<char>' and '<unresolved overloaded function type>') 10 | cout << fn[n] << end; | ~~~~~~~~~~~~~~^~~~~~ In file included from /usr/include/c++/14/iostream:41, from a.cc:1: /usr...
s155837650
p02233
C++
#include<iostream> using namespace std; int main(){ int n; cin >> n; int fn[50]; fn[0] = fn[1] = 1; for(int i = 2; i <= n; i++) fn[i] = fn[i - 1] + fn[i - 2]; cout << fn[n] << end; } return 0 }
a.cc: In function 'int main()': a.cc:11:17: error: no match for 'operator<<' (operand types are 'std::basic_ostream<char>' and '<unresolved overloaded function type>') 11 | cout << fn[n] << end; | ~~~~~~~~~~~~~~^~~~~~ In file included from /usr/include/c++/14/iostream:41, from a.cc:1: /usr...
s007282772
p02233
C++
#include<iostream> using namespace std; int main(){ int n; cin >> n; int fn[50]; fn[0] = fn[1] = 1; for(int i = 2; i <= n; i++) fn[i] = fn[i - 1] + fn[i - 2]; } cout << fn[n] << end; return 0; }
a.cc:11:3: error: 'cout' does not name a type 11 | cout << fn[n] << end; | ^~~~ a.cc:13:3: error: expected unqualified-id before 'return' 13 | return 0; | ^~~~~~ a.cc:14:1: error: expected declaration before '}' token 14 | } | ^
s390814482
p02233
C++
#include<iostream> using namespace std; int main(){ int n; cin >> n; int fn[50]; fn[0] = fn[1] = 1; for(int i = 2; i <= n; i++) fn[i] = fn[i - 1] + fn[i - 2]; cout << fn[n] << endl; } return 0; }
a.cc:13:1: error: expected unqualified-id before 'return' 13 | return 0; | ^~~~~~ a.cc:14:1: error: expected declaration before '}' token 14 | } | ^
s263162891
p02233
C++
#include <cstdio> using namespace std; int F[50]; int fibonacci(int n) { if (n==0||n==1) { return F[n] = 1; } if (F[n] != -1) { return F[n]; } return F[n] = fibonacci(n-1) + fibonacci(n-2); } int int main (void) { int N, i; for(i = 0 ; i < 50 ; i ++ ) { F[i] = -1...
a.cc:16:1: error: two or more data types in declaration of 'main' 16 | int | ^~~
s364475233
p02233
C++
#include <stdlib.h> #include <stdio.h> int fib(int n){ int i; int a[25]; a[0]=a[1]=1; for(i=2;i<n;i++){ a[i]=a[i-1]+a[i-2]; } return a[i]; } int main(){ int x; scanf("%d",&n); x=fib(n); printf("%d",x); return 0; }
a.cc: In function 'int main()': a.cc:17:13: error: 'n' was not declared in this scope 17 | scanf("%d",&n); | ^
s948079956
p02233
C++
#include<iostream> using namespce std; int main() { int n,i; int a[25]; cin >> n; for(i=0;i<n;i++){ cin >> a[i]; } }
a.cc:2:7: error: expected nested-name-specifier before 'namespce' 2 | using namespce std; | ^~~~~~~~ a.cc: In function 'int main()': a.cc:8:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 8 | cin >> n; | ^~~ | std::cin In file included fro...
s788477407
p02233
C++
#include<iostream> using namespce std; int main() { int n,i; int a[44]; cin >> n; a[0]=1; a[1]=1; for(i=2;i<n;i++){ a[i]=a[i-1]+a[a-2]; } cout << a[n-1]<<endl; }
a.cc:2:7: error: expected nested-name-specifier before 'namespce' 2 | using namespce std; | ^~~~~~~~ a.cc: In function 'int main()': a.cc:8:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 8 | cin >> n; | ^~~ | std::cin In file included fro...
s165545823
p02233
C++
#include<iostream> using namespce std; int main() { int n,i; int a[44]; cin >> n; a[0]=1; a[1]=1; for(i=2;i<n;i++){ a[i]=a[i-1]+a[i-2]; } cout << a[n-1]<<endl; }
a.cc:2:7: error: expected nested-name-specifier before 'namespce' 2 | using namespce std; | ^~~~~~~~ a.cc: In function 'int main()': a.cc:8:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 8 | cin >> n; | ^~~ | std::cin In file included fro...
s346504270
p02233
C++
#include<stdio.h> #define N 45 int main(){ int i,n,F[N]; F[0]=F[1]=1; for(i=2;i<N;i++){ F[i]=F[i-1]+F[i-2]; } scanf("%d",&n); printf("%d\n",a[n]); return 0; }
a.cc: In function 'int main()': a.cc:14:15: error: 'a' was not declared in this scope 14 | printf("%d\n",a[n]); | ^
s371803519
p02233
C++
#include <iostream> using namespace std; int num; int main(void) { cin >> num; int array[num] = {}; array[0] = 1 && array[1] = 1; for (int i= 2; i <= num; i++) array[i] = array[i - 1] + array[i - 2]; cout << array[num] << endl; }
a.cc: In function 'int main()': a.cc:8:18: error: lvalue required as left operand of assignment 8 | array[0] = 1 && array[1] = 1; | ~~^~~~~~~~~~~
s250874815
p02233
C++
import std.algorithm; import std.array; import std.conv; import std.math; import std.range; import std.stdio; import std.string; import std.typecons; T read(T)() { return readln.chomp.to!T; } T[] reads(T)() { return readln.split.to!(T[]); } alias readint = read!int; alias readints = reads!int; /// n 番目のフィボナッチ数を求める //...
a.cc:1:1: error: 'import' does not name a type 1 | import std.algorithm; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:2:1: error: 'import' does not name a type 2 | import std.array; | ^~~~~~ a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:3:1...
s679253327
p02233
C++
using namespace std; int main() { int input; cin >> input; int first = 1; int second = 1; for (int i = 2; i < input; ++i) { int third = first + second; first = second; second = thid; } cout << second; return 0; }
a.cc: In function 'int main()': a.cc:6:5: error: 'cin' was not declared in this scope 6 | cin >> input; | ^~~ a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' +++ |+#include <iostream> 1 | using namespace std; a.cc:14:18: erro...
s671257509
p02233
C++
#include <iostream> using namespace std; int main() { int input; cin >> input; int first = 1; int second = 1; for (int i = 2; i < input; ++i) { int third = first + second; first = second; second = thid; } cout << second; return 0; }
a.cc: In function 'int main()': a.cc:16:18: error: 'thid' was not declared in this scope; did you mean 'third'? 16 | second = thid; | ^~~~ | third
s074063475
p02233
C++
#include <stdio.h> fi(int a) { return (a == 0 || a == 1) ? 1 : fi(a - 1) + fi(a - 2); } int main(void) { int n; scanf("%d", &n); printf("%d\n", fi(n)); return 0; }
a.cc:3:1: error: ISO C++ forbids declaration of 'fi' with no type [-fpermissive] 3 | fi(int a) { | ^~
s846086428
p02233
C++
#include <stdio.h> #define rep(i, n) for(int i = 0; i < n; ++i) int f[50]; void fi(int a) { f[a] = f[a - 2] + f[a - 1]; } int main(void) { int n; scanf("%d", &n); rep(i, 50) f[i] = 0; f[0] = 1, f[1] = 1; for(int i = 2; i < 50; ++i) fi(i); printf("%d\n", f[a]); return 0; }
a.cc: In function 'int main()': a.cc:15:20: error: 'a' was not declared in this scope 15 | printf("%d\n", f[a]); | ^
s875744621
p02233
C++
import numpy as np import sys def fib(n): if (n == 0): return 1 elif (n == 1): return 1 else : return fib(n - 1) + fib(n - 2) if __name__ == "__main__": n = input("input number: ") n = int(n) #print(type(n)) print(fib(n))
a.cc:15:6: error: invalid preprocessing directive #print 15 | #print(type(n)) | ^~~~~ a.cc:1:1: error: 'import' does not name a type 1 | import numpy as np | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
s038805464
p02233
C++
import numpy as np import sys f = [-1 for i in range(45)] f[0] = f[1] = 1 def fib(n): global f for i in range(2,n+1): f[i] = f[i - 1] + f[i - 2] #print(i,f[i]) return f[n] if __name__ == "__main__": n = input("input number: ") n = int(n) #print(type(n)) print(fib(n))
a.cc:10:10: error: invalid preprocessing directive #print 10 | #print(i,f[i]) | ^~~~~ a.cc:16:6: error: invalid preprocessing directive #print 16 | #print(type(n)) | ^~~~~ a.cc:1:1: error: 'import' does not name a type 1 | import numpy as np | ^~~~~~ a.cc:1:1: note:...
s347277054
p02233
C++
f = [-1 for i in range(45)] f[0] = f[1] = 1 def fib(n): global f for i in range(2,n+1): f[i] = f[i - 1] + f[i - 2] #print(i,f[i]) return f[n] if __name__ == "__main__": n = input("input number: ") n = int(n) #print(type(n)) print(fib(n))
a.cc:9:10: error: invalid preprocessing directive #print 9 | #print(i,f[i]) | ^~~~~ a.cc:15:6: error: invalid preprocessing directive #print 15 | #print(type(n)) | ^~~~~ a.cc:2:1: error: 'f' does not name a type 2 | f = [-1 for i in range(45)] | ^
s394844381
p02233
C++
f = [-1 for i in range(45)] f[0] = f[1] = 1 def fib(n): global f for i in range(2,n+1): f[i] = f[i - 1] + f[i - 2] #print(i,f[i]) return f[n] if __name__ == "__main__": n = input("input number: ") n = int(n) #print(type(n)) print(fib(n))
a.cc:9:10: error: invalid preprocessing directive #print 9 | #print(i,f[i]) | ^~~~~ a.cc:15:6: error: invalid preprocessing directive #print 15 | #print(type(n)) | ^~~~~ a.cc:2:1: error: 'f' does not name a type 2 | f = [-1 for i in range(45)] | ^
s799552213
p02233
C++
#include <iostream> #include <vector> #include <string> #include <cmath> #include <set> #include <algorithm> #include <array> #include <complex> #include <utility> #include <map> #include <inttypes.h> int main(){ int N; std::cin >> N; F[0]=F[1]=1; for(int i=2;i<=N;i++){ F[i]=F[i-1]+F[i-2]; ...
a.cc: In function 'int main()': a.cc:18:5: error: 'F' was not declared in this scope 18 | F[0]=F[1]=1; | ^
s297236278
p02233
C++
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s602309193
p02233
C++
#include<stdio.h> #include(sys/time.h> static double gettime(){ struct timeval tv ={0}; gettimeofday(&tv,NULL); return(tv,tv-sec*1000.0)+(tv.tv_usec/1000.0); } long long fibo(int n){ if(n==0||n==1)retrn 0; return fibo(n-1)+fibo(n-2); } int main(void){ printf("fibo(40)=%lld\n",fibo(40)); return(0); }
a.cc:2:9: error: #include expects "FILENAME" or <FILENAME> 2 | #include(sys/time.h> | ^ a.cc: In function 'double gettime()': a.cc:4:24: error: variable 'gettime()::timeval tv' has initializer but incomplete type 4 | struct timeval tv ={0}; | ^~ a.cc:5:9: error...
s291605204
p02233
C++
#include<stdio.h> #include<sys/time.h> static double gettime(){ struct timeval tv ={0}; gettime(&tv,NULL); return(tv,tv-sec*1000.0)+(tv.tv_usec/1000.0); } long long fibo(int n){ long long fibodp[200]; fibodp[0]=1; fibodp[1]=1; for(int i=2; i<=n,i++){ fibodp[n]=fibodp[n-1]+fibodp[n-2]; } return fibodp[n]; ...
a.cc: In function 'double gettime()': a.cc:7:16: error: too many arguments to function 'double gettime()' 7 | gettime(&tv,NULL); | ~~~~~~~^~~~~~~~~~ a.cc:5:15: note: declared here 5 | static double gettime(){ | ^~~~~~~ a.cc:8:22: error: 'sec' was not declared in this sc...
s039807723
p02233
C++
#include<iostream> using namespace std; int main() { int N; cin >> N; int F[50]; F[0] = F[1], for (int i = 2; i <= N; i++) { F[i] = F[i - 1] + F[i - 2]; } cout << F[N] << endl; return 0; }
a.cc: In function 'int main()': a.cc:12:3: error: expected primary-expression before 'for' 12 | for (int i = 2; i <= N; i++) { | ^~~ a.cc:12:19: error: 'i' was not declared in this scope 12 | for (int i = 2; i <= N; i++) { | ^
s600546527
p02233
C++
#include<iostream> using namespace std; int main() { int n; //入力 cin >> n; //出力 cout << fib(n) << endl; return 0; } int fib(int n){ if(n==0 || n == 1){ return 1; }else{ return fib(n-1) + fib(n-2); } }
a.cc: In function 'int main()': a.cc:12:11: error: 'fib' was not declared in this scope 12 | cout << fib(n) << endl; | ^~~
s337487914
p02233
C++
#include<iostream> using namespace std; int fib(int n); int main() { int n; //入力 cin >> n; //出力 cout << fib(n) << endl; return 0; } int fib(int n){ memo[1000] = {0}; if(n==0 || n == 1){ return 1; }else if(memo[n] != 0){ return memo[n]; }else{ return memo[n] = memo[n-1] + memo[n-2]...
a.cc: In function 'int fib(int)': a.cc:20:3: error: 'memo' was not declared in this scope 20 | memo[1000] = {0}; | ^~~~
s834234657
p02233
C++
#include<iostream> using namespace std; int fib(int n); int memo[45]; int main() { int n; //入力 cin >> n; //出力 cout << fib(n) << endl; return 0; } int fib(int n){ if(n==0 || n == 1){ return 1; }else if(memo[n] != 0){ return memo[n]; } }else{ return memo[n] = fib(n-1) + fib(n-2); } ...
a.cc:24:4: error: expected unqualified-id before 'else' 24 | }else{ | ^~~~ a.cc:27:1: error: expected declaration before '}' token 27 | } | ^ a.cc: In function 'int fib(int)': a.cc:24:3: warning: control reaches end of non-void function [-Wreturn-type] 24 | }else{ | ^
s091529869
p02233
C++
#include<iostream> using namespace std; int fib(int n); int memo[45]; int main(){ int n; cin >> n; cout << fib(n) << endl; retrun 0; } int bib(int n){ if(n==0){ return 1; }else if(n==1){ return 1; else if(memo[n] !=0){ return memo[n]; }else{ return memo[n]=fib(n-1]+fib(n-2); ...
a.cc: In function 'int main()': a.cc:11:3: error: 'retrun' was not declared in this scope 11 | retrun 0; | ^~~~~~ a.cc: In function 'int bib(int)': a.cc:20:5: error: expected '}' before 'else' 20 | else if(memo[n] !=0){ | ^~~~ a.cc:18:17: note: to match this '{' 18 | }else if(n==1){ ...
s163955684
p02233
C++
#include<iostream> using namespace std; int fib(int n); int memo[45]; int main(){ int n; cin >> n; cout << fib(n) << endl; retrun 0; } int bib(int n){ if(n==0){ return 1; }else if(n==1){ return 1; } else if(memo[n] !=0){ return memo[n]; }else{ return memo[n]=fib(n-1]+fib(n-...
a.cc: In function 'int main()': a.cc:11:3: error: 'retrun' was not declared in this scope 11 | retrun 0; | ^~~~~~ a.cc: In function 'int bib(int)': a.cc:24:29: error: expected ')' before ']' token 24 | return memo[n]=fib(n-1]+fib(n-2); | ~ ^ | ...
s062398793
p02233
C++
#include<iostream> using namespace std; int fib(int n); int memo[45]; int main(){ int n; cin >> n; cout << fib(n) << endl; retrun 0; } int fib(int n){ if(n==0){ return 1; }else if(n==1){ return 1; } else if(memo[n] !=0){ return memo[n]; }else{ return memo[n]=fib(n-1]+fib(n-2); ...
a.cc: In function 'int main()': a.cc:11:3: error: 'retrun' was not declared in this scope 11 | retrun 0; | ^~~~~~ a.cc: In function 'int fib(int)': a.cc:24:27: error: expected ')' before ']' token 24 | return memo[n]=fib(n-1]+fib(n-2); | ~ ^ | ...
s160108059
p02233
C++
#include<iostream> using namespace std; int fib(int n); int memo[45]; int main(){ int n; cin >> n; cout << fib(n) << endl; retrun 0; } int fib(int n){ if(n==0){ return 1; }else if(n==1){ return 1; } else if(memo[n] !=0){ return memo[n]; }else{ return memo[n]=fib(n-1)+fib(n-2); ...
a.cc: In function 'int main()': a.cc:11:3: error: 'retrun' was not declared in this scope 11 | retrun 0; | ^~~~~~
s063588715
p02233
C++
#include<iostream> using namespace std; int fib(int n); int memo[45]; int main(){ int n; cin >> n; cout << fib(n) << endl; retrun 0; } int fib(int n){ if(n == 0){ return 1; }else if(n == 1){ return 1; } else if(memo[n] != 0){ return memo[n]; }else{ return memo[n]= fib(n-1) + fib(...
a.cc: In function 'int main()': a.cc:11:3: error: 'retrun' was not declared in this scope 11 | retrun 0; | ^~~~~~
s611989116
p02233
C++
#include <iostream> using namespace std; int fib(int n); int main() { int n; int dfep[45]; dp[0] = 1; dp[1] = 1; cin >> n; for(int i = 2; i <= n; i++) { dp[i] = dp[i-1] + dp[i-2]; } cout << dp[n] << dp << endl; return 0; }
a.cc: In function 'int main()': a.cc:11:1: error: 'dp' was not declared in this scope; did you mean 'dfep'? 11 | dp[0] = 1; | ^~ | dfep
s710667196
p02233
C++
#include<iostream> using namespace std; int fib(int n); int memo[45]; int main(){ int n; cin >> n; cout << fib(n) << endl; retrun 0; } int fib(int n){ if(n == 0){ return 1; }else if(n == 1){ return 1; }else if(memo[n] != 0){ return memo[n]; }else{ return memo[n]= fib(n-1) + fib(n-2...
a.cc: In function 'int main()': a.cc:11:3: error: 'retrun' was not declared in this scope 11 | retrun 0; | ^~~~~~
s064013272
p02233
C++
#include <iostream> using namespace std; int fib(int n); int main() { int n; int dfep[45]; dp[0] = 1; dp[1] = 1; cin >> n; for(int i = 2; i <= n; i++) { dp[i] = dp[i-1] + dp[i-2]; } cout << dp[n] << endl; return 0; }
a.cc: In function 'int main()': a.cc:11:1: error: 'dp' was not declared in this scope; did you mean 'dfep'? 11 | dp[0] = 1; | ^~ | dfep
s217351887
p02233
C++
#inclue<stdio> #include<stream> using namespace std; int fibo(int x) { int a; if ( x == 0 ) return 1; if ( x == 1 ) return 1; a = fibo(x-1) + fibo(x-2); return a; } int main() { int x, y; cin >> x; y = fibo(x); cout << y << endl; return 0; }
a.cc:1:2: error: invalid preprocessing directive #inclue; did you mean #include? 1 | #inclue<stdio> | ^~~~~~ | include a.cc:2:9: fatal error: stream: No such file or directory 2 | #include<stream> | ^~~~~~~~ compilation terminated.
s748226410
p02233
C++
#inclue<stdio> #include<stream> using namespace std; int fibo(int x) { int a; if ( x == 0 ) return 1; if ( x == 1 ) return 1; a = fibo(x-1) + fibo(x-2); return a; } int main() { int x, y; cin >> x; y = fibo(x); cout << y << endl; return 0; }
a.cc:1:2: error: invalid preprocessing directive #inclue; did you mean #include? 1 | #inclue<stdio> | ^~~~~~ | include a.cc:2:9: fatal error: stream: No such file or directory 2 | #include<stream> | ^~~~~~~~ compilation terminated.
s194204023
p02233
C++
#include<stdio> #include<stream> using namespace std; int fibo(int x) { int a; if ( x == 0 ) return 1; if ( x == 1 ) return 1; a = fibo(x-1) + fibo(x-2); return a; } int main() { int x, y; cin >> x; y = fibo(x); cout << y << endl; return 0; }
a.cc:1:9: fatal error: stdio: No such file or directory 1 | #include<stdio> | ^~~~~~~ compilation terminated.
s955598447
p02233
C++
#include<stdio.h> #include<stream> using namespace std; int fibo(int x) { int a; if ( x == 0 ) return 1; if ( x == 1 ) return 1; a = fibo(x-1) + fibo(x-2); return a; } int main() { int x, y; cin >> x; y = fibo(x); cout << y << endl; return 0; }
a.cc:2:9: fatal error: stream: No such file or directory 2 | #include<stream> | ^~~~~~~~ compilation terminated.
s318756674
p02233
C++
#include<stdio.h> #include<iostream> using namespace std; int fibo(int x) { int a; if ( x == 0 ) return 1; if ( x == 1 ) return 1; a = fibo(x-1) + fibo(x-2); return a; } int main() { int x, y; int F[50]; F[0] = F[1] = 1; for ( i = 2; i < 50; i++ ) F[i] = F[i-1] + F[i-2]; cin >> x; cout << F[x] ...
a.cc: In function 'int main()': a.cc:17:9: error: 'i' was not declared in this scope 17 | for ( i = 2; i < 50; i++ ) F[i] = F[i-1] + F[i-2]; | ^
s720202810
p02233
C++
#include<stdio.h> #include<iostream> using namespace std; int main() { int x, y; int F[50]; F[0] = F[1] = 1; for ( i = 2; i < 50; i++ ) F[i] = F[i-1] + F[i-2]; cin >> x; cout << F[x] << endl; return 0; }
a.cc: In function 'int main()': a.cc:9:9: error: 'i' was not declared in this scope 9 | for ( i = 2; i < 50; i++ ) F[i] = F[i-1] + F[i-2]; | ^
s679116426
p02233
C++
class RecursiveFibonacci:public Fibonacci{ public: virtual int calc(int x); }; int RecursiveFibonacci::calc(int x){ if(x == 0){ return 0; }else if(x == 1){ return 1; }else{ return calc(x - 1) + calc(x - 2); } }
a.cc:1:42: error: expected class-name before '{' token 1 | class RecursiveFibonacci:public Fibonacci{ | ^
s521219872
p02233
C++
#include <iostream> using namespace std; int main() { void fibonacci_1(const int count , int data[]) { data[0] = 1; if(count == 1) return; data[1] = 1; for( int i = 2; i < count ; i++) { data[i] = data[i-1]+data[i-2]; } } return 0;
a.cc: In function 'int main()': a.cc:5:56: error: a function-definition is not allowed here before '{' token 5 | void fibonacci_1(const int count , int data[]) { | ^ a.cc:14:18: error: expected '}' at end of input 14 | return 0; |...
s002069391
p02233
C++
void fibonacci_1(const int count , int data[]) { data[0] = 1; if(count == 1) return; data[1] = 1; for( int i = 2; i < count ; i++) { data[i] = data[i-1]+data[i-2]; } }
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status