criyle/codenet-compile-errors huggingface dataset:
Language: C++

//g++ -std=gnu++14 a.cpp
//#include <bits/stdc++.h>
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <iostream>
#include <istream>
#include <iterator>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#include <tuple>
#include <iomanip>
#include <random>
#include <math.h>

using namespace std;

#define ll long long
#define rep(i, n) for(ll i = 0; i < (n); i++)
ll MOD = 1e9 + 7;
int INF = 1 << 30;
ll INFL = 1LL << 60;




int main(){
  ll N,M;
  cin >> N >> M;
  vector<ll> h(1000000);
  vector<ll> dp(1000000, 0);
  vector<ll> ok(1000000, 1);
  rep(i,M) cin >> h[i];
  rep(i,M){
    ok[h[i]] = 0;
  }
  dp[0] = 1;
  for(int i = 0;i <= N;i++){
    if(ok[i+1]) dp[i+1]%MOD += dp[i]%MOD;
    if(ok[i+2]) dp[i+2]%MOD += dp[i]%MOD;
  }
  /*
rep(i,N+1){
  cout << dp[i] << endl;
} */
  cout << dp[N]%MOD << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:44:24: error: lvalue required as left operand of assignment
   44 |     if(ok[i+1]) dp[i+1]%MOD += dp[i]%MOD;
a.cc:45:24: error: lvalue required as left operand of assignment
   45 |     if(ok[i+2]) dp[i+2]%MOD += dp[i]%MOD;
Language: C++

#include<iostream>
#include<vector>
using namespace std;
const int MOD=1000000007;
int N,M;
vector<bool> issafe;
int main(){
  cin>>N>>M;
  issafe.assign(N+1,true);
  for(int i=0; i<N; ++i){
    int a; cin>>a;
    issafe[a]=false;
  }
  vector<int> dp(N+1,0);
  
  dp[0]=1;
  if(issafe[1]) dp[1]=1;
  
  for (int n=2; n<=N; n++){
    if (issafe[n-1]) dp[n]+=dp[n-1];
    if (issace[n-2]) dp[n]+=dp[n-2];
      dp[n]%=MOD;
  }
  cout<<dp[N]<<endl;
}
    
  

Compiler output:
a.cc: In function 'int main()':
a.cc:21:9: error: 'issace' was not declared in this scope; did you mean 'isspace'?
   21 |     if (issace[n-2]) dp[n]+=dp[n-2];
      |         ^~~~~~
      |         isspace
Language: C++

#include<iostream>
#include<vector>
using namespace std;
const int MOD=1000000007;
int N,M;
vector<bool> issafe;
int main(){
  cin>>N>>M;
  issafe.assign(N+1,true);
  for(int i=0; i<N; ++i){
    int a; cin>>a;
    issafe[a]=false;
  }
  vector<int> dp(N+1,0);
  
  dp[0]=1;
  if(issafe[1]) dp[1]=1;
  
  for (int n=2; n<=N; n++){
    if (issafe[n-1]) dp[n]+=dp[n-1]
    if (issace[n-2]) dp[n]+=dp[n-2]
      dp[n]%=MOD;
  }
  cout<<dp[N]<<endl;
}
    
  

Compiler output:
a.cc: In function 'int main()':
a.cc:20:36: error: expected ';' before 'if'
   20 |     if (issafe[n-1]) dp[n]+=dp[n-1]
      |                                    ^
      |                                    ;
   21 |     if (issace[n-2]) dp[n]+=dp[n-2]
      |     ~~
Language: C++

#include<iostream>
#include<vector>
using namespace std;
const int MOD=1000000007;
int N,M;
vetor<bool> issafe;
int main(){
  cin>>N>>M;
  issafe.assign(N+1,true);
  for(int i=0; i<N; ++i){
    int a; cin>>a;
    issafe[a]=false;
  }
  vector<int> dp(N+1,0);
  
  dp[0]=1;
  if(issafe[1]) dp[1]=1;
  
  for (int n=2; n<=N; n++){
    if (issafe[n-1]) dp[n]+=dp[n-1]
    if (issace[n-2]) dp[n]+=dp[n-2]
      dp[n]%=MOD;
  }
  cout<<dp[N]<<endl;
}
    
  

Compiler output:
a.cc:6:1: error: 'vetor' does not name a type
    6 | vetor<bool> issafe;
      | ^~~~~
a.cc: In function 'int main()':
a.cc:9:3: error: 'issafe' was not declared in this scope; did you mean 'isspace'?
    9 |   issafe.assign(N+1,true);
      |   ^~~~~~
      |   isspace
a.cc:20:36: error: expected ';' before 'if'
   20 |     if (issafe[n-1]) dp[n]+=dp[n-1]
      |                                    ^
      |                                    ;
   21 |     if (issace[n-2]) dp[n]+=dp[n-2]
      |     ~~
Language: C++

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

int64_t NC(int A,vector<int64_t>&memo){
  if(A < 0){
    return 0;
  }
  // cout<<A<<endl;
  if(memo[A]!=-1)return memo[A];
  if(A < 2){
    memo[A]=1;
    return memo[A];
  }
  if(A == 2){
    memo[A]=2;
    return memo[A];
  }
  
  memo[A]= NC(A - 1,memo) + NC(A - 2,memo);
  return memo[A];
}

int main(){
  int N, M;
  cin >> N >> M;
  vector<int64_t>memo(400000,-1);
  
  vector<int> broken(M);
  for(int i = 0; i < M; i++){
    cin >> broken.at(i);
  }
  
  int64_t ans = 1;
  ans *= NC(broken.at(0) - 1,memo) % 1000000007;
  ans *= NC(N - broken.at(M - 1) - 1,memo) % 1000000007;
  for(int i = 0; i < M - 1; i++){
    ans *= NC(broken.at(i + 1) - broken.at(i) - 2,memo) % 1000000007;
    ans %= 1000000007;
  }
  
  cout << ans << endl;
}


Compiler output:
a.cc:3:13: error: '::main' must return 'int'
    3 | #define int int64_t
      |             ^~~~~~~
a.cc:24:1: note: in expansion of macro 'int'
   24 | int main(){
      | ^~~
Language: C++

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

chmin

const long INF = 1L << 60;
const int MOD = 1000000007;

int a[100010];
long dp[100010];
bool ok[100010];

int main(){
	int n, m;
	scanf("%d%d", &n, &m);
	for(int i = 0; i < m; i++) {
		scanf("%d", &a[i]);
		ok[a[i]] = true;
	}
	dp[0] = 1;
	for(int i = 0; i <= n; i++) {
		for(int j = i+1; j <= min(n, i+2); j++) {
			if(!ok[j]) dp[j] += dp[i];
			dp[i] %= MOD;
		}
	}
	printf("%ld", dp[n]);
}


Compiler output:
a.cc:4:1: error: 'chmin' does not name a type
    4 | chmin
      | ^~~~~
Language: C++

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

int main() {
  int N, M;
  cin >> N >> M;
  vector<int> A(M);
  for(int i=0; i<M; i++)
    cin >> A.at(i);
  vector(int64_t) S(N+1,-1);
  for(int i=0; i<M; i++)
    S.at(A.at(i))=0;
  S.at(0)=0;
  if(S.at(1)==-1)
    S.at(1) = 1;
  for(int i=2; i<N+1; i++) {
    if(S.at(i)==-1)
      S.at(i) = S.at(i-1)+S.at(i-2);
  }
  cout << S.at(N)%1000000007 << endl;
}
      

Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: missing template arguments before '(' token
   10 |   vector(int64_t) S(N+1,-1);
      |         ^
a.cc:10:17: error: expected primary-expression before ')' token
   10 |   vector(int64_t) S(N+1,-1);
      |                 ^
a.cc:12:5: error: 'S' was not declared in this scope
   12 |     S.at(A.at(i))=0;
      |     ^
a.cc:13:3: error: 'S' was not declared in this scope
   13 |   S.at(0)=0;
      |   ^
Language: C++

#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#include <algorithm>
#define rep(i,n) for(ll i=0;i<(n);++i)
#define all(a) (a).begin(),(a).end()
using namespace std;
using Graph = vector<vector<int>>;
typedef long long ll;
const int mod= 1e+9+7;

int main(){
    int N,M; cin>>N>>M;
    vector<bool>b(N+1,true);
    rep(i,M){
        int m; cin>>m;
        b[m]=false;
    }
    vector<ll>dp(N+1);
    dp[0]=1;
    rep(i,N){
        for(int j=i+1;j <= min(N,i+2);j++){
            if(b[j]){
                dp[j]+=dp[i];
                dp[j]%=mod;
            }
        }
    }
    cout<<dp[N]<<endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:31: error: no matching function for call to 'min(int&, ll)'
   21 |         for(int j=i+1;j <= min(N,i+2);j++){
      |                            ~~~^~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:21:31: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'})
   21 |         for(int j=i+1;j <= min(N,i+2);j++){
      |                            ~~~^~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:21:31: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   21 |         for(int j=i+1;j <= min(N,i+2);j++){
      |                            ~~~^~~~~~~
Language: C++

#include<iostream>
#include<string>
#include<algorithm>
#include<cmath>
#include<vector>
#include<list>
#include<map>
#include<numeric>
#include<iomanip>
#define REP(i,m,n) for(int i=(int)(m);i<(int)(n);i++)
#define rep(i,n) REP(i,0,n)
#define ll long long
#define int long long

using namespace std;

//最大公約数
ll gcd(ll a, ll b) {
	if (b == 0) {
		return a;
	}
	return gcd(b, a % b);
}

//最小公倍数
ll lcm(ll a, ll b) {
	return a * b / gcd(a, b);
}

//階乗
ll factorial(ll a) {
	int ans = 1;
	for (int i = 1; i <= a; i++) {
		ans *= i;
	}
	return ans;
}

signed main() {
    ll mod = 1000000007; 
	int n, m;
	cin >> n >> m;
	vector<int>hole(m);
	rep(i, m) {
		cin >> hole[i];
	}
	rep(i, m - 1) {
		if (hole[i] + 1 == hole[i + 1]) {
			cout << 0 << endl;
			return 0;
		}
	}

	int ans = 1;
	int top = hole[0] - 1;
	int	lowest = 0;
	int temp = (top - lowest);
	int x = temp % 2;//1dann
	int y = temp / 2;//2dann
	int tem = 0;
	while (y > -1) {
		tem += factorial(x+y) / (factorial(y) * factorial(x));
		y--;
		x += 2;
	}
	ans = ans * tem % mod
	tem = 0;

	REP(i, 1, m) {
		lowest = top + 2;
		top = hole[i] - 1;
		temp = (top - lowest);
		x = temp % 2;
		y = temp / 2;
		while (y > -1) {
			tem += factorial(x+y) / (factorial(y) * factorial(x));
			y--;
			x += 2;
		}
		ans = ans * tem % mod;
		tem = 0;
	}

	lowest = top + 2;
	top = n;
	temp = (top - lowest);
	x = temp % 2;
	y = temp / 2;
	while (y > -1) {
		tem += factorial(x+y) / (factorial(y) * factorial(x));
		y--;
		x += 2;
	}
	ans = ans * tem % mod;
	cout << ans << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:66:30: error: expected ';' before 'tem'
   66 |         ans = ans * tem % mod
      |                              ^
      |                              ;
   67 |         tem = 0;
      |         ~~~
Language: C++

using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(), (x).end()
#define ll long long
#define INF 1000000000000000000

int main() {
    int N, M;
    cin >> N >> M;
    vector<ll> dp(N + 1, 0);
    ll MOD = 1000000007;
    dp[0] = 0;
    vector<bool> broken(N + 1, false);
    rep(i, M) {
        int a;
        cin >> a;
        broken[a] = true;
    }

    dp[0] = 1;
    dp[1] = 1;
    for (int i = 2; i <= N; i++) {
        if (!broken[i - 1])
            dp[i] += dp[i - 1];
        if (!broken[i - 2])
            dp[i] += dp[i - 2];

        dp[i] %= MOD;
    }

    cout << dp[N] << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:5: error: 'cin' was not declared in this scope
    9 |     cin >> N >> M;
      |     ^~~
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:10:5: error: 'vector' was not declared in this scope
   10 |     vector<ll> dp(N + 1, 0);
      |     ^~~~~~
a.cc:1:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
  +++ |+#include <vector>
    1 | using namespace std;
a.cc:4:12: error: expected primary-expression before 'long'
    4 | #define ll long long
      |            ^~~~
a.cc:10:12: note: in expansion of macro 'll'
   10 |     vector<ll> dp(N + 1, 0);
      |            ^~
a.cc:12:5: error: 'dp' was not declared in this scope
   12 |     dp[0] = 0;
      |     ^~
a.cc:13:12: error: expected primary-expression before 'bool'
   13 |     vector<bool> broken(N + 1, false);
      |            ^~~~
a.cc:17:9: error: 'broken' was not declared in this scope
   17 |         broken[a] = true;
      |         ^~~~~~
a.cc:23:14: error: 'broken' was not declared in this scope
   23 |         if (!broken[i - 1])
      |              ^~~~~~
a.cc:25:14: error: 'broken' was not declared in this scope
   25 |         if (!broken[i - 2])
      |              ^~~~~~
a.cc:31:5: error: 'cout' was not declared in this scope
   31 |     cout << dp[N] << endl;
      |     ^~~~
a.cc:31:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:31:22: error: 'endl' was not declared in this scope
   31 |     cout << dp[N] << endl;
      |                      ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | using namespace std;
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i,l,r)for(ll i=(l);i<(r);i++)
#define repp(i,l,r,k)for(ll i=(l);i<(r);i+=(k))
#define INF ((1LL<<62)-(1LL<<31))
#define MOD 1000000007
int main(){
    int n,m,c=0;
    cin>>n>>m;
  	rep(i,0,m)cin>>a[i];
    ll dp[10010];
  	rep(i,0,n+1)dp[i]=0;
    dp[0]=1;
    if(m>0&&a[0]==1){
		c++;
      	dp[1]=0;
    }else dp[1]=1;
    rep(i,2,n+1){
        if(i==a[c]){
			c++;
          	dp[i]=0;
        }else{
            dp[i]+=dp[i-1]+dp[i-2];
            dp[i]%=MOD;
        }
    }
    cout<<dp[n]<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:24: error: 'a' was not declared in this scope
   11 |         rep(i,0,m)cin>>a[i];
      |                        ^
a.cc:15:13: error: 'a' was not declared in this scope
   15 |     if(m>0&&a[0]==1){
      |             ^
a.cc:20:15: error: 'a' was not declared in this scope
   20 |         if(i==a[c]){
      |               ^
Language: C++

#include <iostream>
#include<math.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)


int main() {
	int N,M;
	cin >> N>>M;

	int a[100010];
	for (int i = 0; i < M; i++)cin >> a[i];

	int dp[100010] = {0};
	
	dp[0] = 0;
	dp[1] = dp[0] + abs(dp[1] + dp[0]);
	
	for (int i = 2; i < (int)(N); i++) {
		for (int j = i; j < M; j++) {
			if (i == a[j])dp[i] = 0;
			else dp[i] = dp[i - 1] + dp[i - 2];
		}

 cout << dp[N-1]%1000000007 << endl;
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:26:2: error: expected '}' at end of input
   26 | }
      |  ^
a.cc:7:12: note: to match this '{'
    7 | int main() {
      |            ^
Language: C++

#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < (n); i++)
#define ALL(v) (v).begin(), (v).end()
using namespace std;
typedef long long ll;
typedef vector<int> v;
typedef vector<ll> vll;
typedef pair<int, int> P;
using Graph = vector<vector<int>>;
const int INF = 1001001001;
const int mINF = -1001001001;
const int mod = 1000000007;
// << fixed << setprecision(0) <<
// sort(ALL(),greater<int>());


int main() {
  ll n,m;
  cin >> n >> m;
  bool isOK[n+1]={true};
  ll a;
  for(ll i=0;i<m;i++) {
    cin >> a;
    isOK[a]=false;
  }
  sort(ALL(a));
  ll ans[n+1];
  ans[0]=1;
  ll j=0;
  for(ll i=1;i<=n;i++){
    if(!isOK[i]) {
      ans[i]=0;
      j++;
      if(j>=m) j=0; 
    } else if(i==1) {
      ans[i]=ans[i-1];
    } else if(isOK[i]) {
      ans[i]=ans[i-1]+ans[i-2];
    }
    ans[i]%=mod;
  }
  cout << ans[n] << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:3:20: error: request for member 'begin' in 'a', which is of non-class type 'll' {aka 'long long int'}
    3 | #define ALL(v) (v).begin(), (v).end()
      |                    ^~~~~
a.cc:26:8: note: in expansion of macro 'ALL'
   26 |   sort(ALL(a));
      |        ^~~
a.cc:3:33: error: request for member 'end' in 'a', which is of non-class type 'll' {aka 'long long int'}
    3 | #define ALL(v) (v).begin(), (v).end()
      |                                 ^~~
a.cc:26:8: note: in expansion of macro 'ALL'
   26 |   sort(ALL(a));
      |        ^~~
Language: C++

#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < (n); i++)
#define ALL(v) (v).begin(), (v).end()
using namespace std;
typedef long long ll;
typedef vector<int> v;
typedef vector<ll int> vll;
typedef pair<int, int> P;
using Graph = vector<vector<int>>;
const int INF = 1001001001;
const int mINF = -1001001001;
const int mod = 1000000007;
// << fixed << setprecision(0) <<
// sort(ALL(),greater<int>());


int main() {
  ll n,m;
  cin >> n >> m;
  vll a(m);
  for(ll i=0;i<m;i++) cin >> a[i];
  sort(ALL(a));
  ll ans[n+1];
  ans[0]=1;
  ll j=0;
  for(ll i=1;i<=n;i++){
    if(i==a[j]) {
      ans[i]=0;
      j++;
      if(j>=m) j=0; 
    } else if(i==1) {
      ans[i]=ans[i-1];
    } else {
      ans[i]=ans[i-1]+ans[i-2];
    }
    ans[i]%=mod;
  }
  cout << ans[n] << endl;
  return 0;
}


Compiler output:
a.cc:7:16: error: two or more data types in declaration of 'type name'
    7 | typedef vector<ll int> vll;
      |                ^~
a.cc:7:22: error: template argument 1 is invalid
    7 | typedef vector<ll int> vll;
      |                      ^
a.cc:7:22: error: template argument 2 is invalid
a.cc: In function 'int main()':
a.cc:21:31: error: invalid types 'vll {aka int}[ll {aka long long int}]' for array subscript
   21 |   for(ll i=0;i<m;i++) cin >> a[i];
      |                               ^
a.cc:3:20: error: request for member 'begin' in 'a', which is of non-class type 'vll' {aka 'int'}
    3 | #define ALL(v) (v).begin(), (v).end()
      |                    ^~~~~
a.cc:22:8: note: in expansion of macro 'ALL'
   22 |   sort(ALL(a));
      |        ^~~
a.cc:3:33: error: request for member 'end' in 'a', which is of non-class type 'vll' {aka 'int'}
    3 | #define ALL(v) (v).begin(), (v).end()
      |                                 ^~~
a.cc:22:8: note: in expansion of macro 'ALL'
   22 |   sort(ALL(a));
      |        ^~~
a.cc:27:12: error: invalid types 'vll {aka int}[ll {aka long long int}]' for array subscript
   27 |     if(i==a[j]) {
      |            ^
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <algorithm>
#include <bitset>

#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <numeric>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
#define INF 2000000000
#define rep(i,n) for(int i=0;i<(n);i++)
typedef pair<int, int> P;
const ll MOD=1000000007;
using Graph = vector<vector<int>>;

template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}



int n,m;

ll dp[100005];
vector<bool> ch(100005,true);

ll rec(int i) {
    if (i == 0) return 1;
    if (i == 1) return 1;
    if (dp[i] != -1) return dp[i];
    
    if (ch[i - 1] && ch[i - 2]) return dp[i] = (rec(i - 1) + rec(i - 2))%MOD;
    else if (ch[i - 1] && !ch[i - 2])return dp[i] = rec(i - 1);
    else if (!ch[i - 1] && ch[i - 2]) return dp[i] = rec(i - 2);
    return 0;
}

int main() {
    cin >> n >> m;
    for (int i = 0; i < m; i++) {
        int a;
        cin >> a;
        ch[a] = false;
    }
    memset(dp, -1, sizeof(dp));
    cout << rec(n) << endl;
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:64:5: error: 'memset' was not declared in this scope
   64 |     memset(dp, -1, sizeof(dp));
      |     ^~~~~~
a.cc:14:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
   13 | #include <numeric>
  +++ |+#include <cstring>
   14 | using namespace std;
Language: C++

#include <iostream>
#include <vector>
using namespace std;
const int MOD = 1000000007;
 
int N, M;
vector<bool> issafe; // issafe[v] := v が壊れていないかどうか
 
int main() {
    cin >> N >> M;
    issafe.assign(N+1, true);
    for (int i = 0; i < M; ++i) {
        int a; cin >> a;
        issafe[a] = false; // a 段目は壊れてる
    }
  
  vector<int> dp(N+1, 0);
  
  dp[0] = 1;
  if(issafe[1]) dp[1] = 1;
  
  for(int n=2; n<N+1; n++){
    if(issafe[n-1]) dp[n] += dp[n-1];
    if(issafe[n-2]) dp[n] += dp[n-2];
    dp[n] %= MOD
  }
  
  cout << dp[N] << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:17: error: expected ';' before '}' token
   25 |     dp[n] %= MOD
      |                 ^
      |                 ;
   26 |   }
      |   ~
Language: C++

#include <iostream>
#include <vector>
using namespace std;
const int MOD = 1000000007;

int N, M;
vector<bool> issafe; // issafe[v] := v が壊れていないかどうか

int main() {
    cin >> N >> M;
    issafe.assign(N+1, true);
    for (int i = 0; i < M; ++i) {
        int a; cin >> a;
        issafe[a] = false; // a 段目は壊れてる
    }
  
  vector<int> dp(N+1, 0);
  
  dp[0] = 1;
  if(issafe[1]) dp[1] = 1;
  
  for(int n=2; n<N+1; n++){
    if(issafe[n-1]) dp[n] += dp[n-1];
    if(issafe[n-2]) dp[n] += dp[n-2];
    dp[n] %= MOD
  }
  
  cout << dp[N] << endl;
  


Compiler output:
a.cc: In function 'int main()':
a.cc:25:17: error: expected ';' before '}' token
   25 |     dp[n] %= MOD
      |                 ^
      |                 ;
   26 |   }
      |   ~              
a.cc:28:25: error: expected '}' at end of input
   28 |   cout << dp[N] << endl;
      |                         ^
a.cc:9:12: note: to match this '{'
    9 | int main() {
      |            ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<int,int> pii;
 
#define mem(dp,a)       memset(dp,a,sizeof dp)
#define ninja           ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define pb(x)           push_back(x)
#define mp(x,y)         make_pair(x,y)
#define all(c)          c.begin(), c.end()
#define ff              first
#define ss              second
#define nl              '\n'
#define inf             1e9+7
 
int main()
{
	ninja
	int t; //cin>>t;
	t=1;
	while(t--)
	{
		ll n,m; cin>>n>>m;
		ll x;
		ll mod=1e9+7;
		vector<bool> broken(n+1,false);
		for(ll i=0;i<m;i++)
			{cin>>x; broken[x]=1;}

		vector<ll> dp(n+1,0);
		dp[0]=1;
		if(broken[1])dp[1]=0;
		else dp[1]=1;
		for(ll i=2;i<=n;i++){
			if(!broken[i])
			{
				dp[i]+=((d[i-1]+dp[i-2])%mod);
			}
		}
		cout<<dp[n];
	}
}



Compiler output:
a.cc: In function 'int main()':
a.cc:37:42: error: 'd' was not declared in this scope
   37 |                                 dp[i]+=((d[i-1]+dp[i-2])%mod);
      |                                          ^
Language: C++

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

const int MOD  = 1e9 + 7;

int32_t main()
{
  int n,m; cin>>n>>m;
  map<int,int> mp;
  int dp[[n + 1];
  for(int i = 0 ; i < m; i++){
  	int tm; cin>>tm;
    mp[tm] = 1;
    if(mp[tm - 1] == 1) return cout<<0,0;
  }
  dp[0] = 0;
  dp[1] = 1;
  for(int i = 2; i <= n; i++) {
    if(mp[i] == 0) continue; 
  	if(!mp[i - 1]) dp[i] += dp[i - 1];
    if(!mp[i - 2]) dp[i] += dp[i - 2];
  }
         cout<<dp[n];
  return 0;
}

Compiler output:
a.cc: In function 'int32_t main()':
a.cc:11:12: error: expected ']' before '+' token
   11 |   int dp[[n + 1];
      |            ^~
      |            ]
a.cc:11:16: warning: 'n' attribute directive ignored [-Wattributes]
   11 |   int dp[[n + 1];
      |                ^
a.cc:17:5: error: invalid types 'long long int[int]' for array subscript
   17 |   dp[0] = 0;
      |     ^
a.cc:18:5: error: invalid types 'long long int[int]' for array subscript
   18 |   dp[1] = 1;
      |     ^
a.cc:21:26: error: invalid types 'long long int[long long int]' for array subscript
   21 |         if(!mp[i - 1]) dp[i] += dp[i - 1];
      |                          ^
a.cc:21:35: error: invalid types 'long long int[long long int]' for array subscript
   21 |         if(!mp[i - 1]) dp[i] += dp[i - 1];
      |                                   ^
a.cc:22:22: error: invalid types 'long long int[long long int]' for array subscript
   22 |     if(!mp[i - 2]) dp[i] += dp[i - 2];
      |                      ^
a.cc:22:31: error: invalid types 'long long int[long long int]' for array subscript
   22 |     if(!mp[i - 2]) dp[i] += dp[i - 2];
      |                               ^
a.cc:24:18: error: invalid types 'long long int[long long int]' for array subscript
   24 |          cout<<dp[n];
      |                  ^
Language: C++

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

const int MOD  = 1e9 + 7;

int main()
{
  int n,m; cin>>n>>m;
  map<int,int> mp;
  int dp[[n + 1];
  for(int i = 0 ; i < m; i++){
  	int tm; cin>>tm;
    mp[tm] = 1;
    if(mp[tm - 1] == 1) return cout<<0,0;
  }
  dp[0] = 0;
  dp[1] = 1;
  for(int i = 2; i <= n; i++) {
    if(mp[i] == 0) continue; 
  	if(!mp[i - 1]) dp[i] += dp[i - 1];
    if(!mp[i - 2]) dp[i] += dp[i - 2];
  }
         cout<<dp[n];
  return 0;
}

Compiler output:
cc1plus: error: '::main' must return 'int'
a.cc: In function 'int main()':
a.cc:11:12: error: expected ']' before '+' token
   11 |   int dp[[n + 1];
      |            ^~
      |            ]
a.cc:11:16: warning: 'n' attribute directive ignored [-Wattributes]
   11 |   int dp[[n + 1];
      |                ^
a.cc:17:5: error: invalid types 'long long int[int]' for array subscript
   17 |   dp[0] = 0;
      |     ^
a.cc:18:5: error: invalid types 'long long int[int]' for array subscript
   18 |   dp[1] = 1;
      |     ^
a.cc:21:26: error: invalid types 'long long int[long long int]' for array subscript
   21 |         if(!mp[i - 1]) dp[i] += dp[i - 1];
      |                          ^
a.cc:21:35: error: invalid types 'long long int[long long int]' for array subscript
   21 |         if(!mp[i - 1]) dp[i] += dp[i - 1];
      |                                   ^
a.cc:22:22: error: invalid types 'long long int[long long int]' for array subscript
   22 |     if(!mp[i - 2]) dp[i] += dp[i - 2];
      |                      ^
a.cc:22:31: error: invalid types 'long long int[long long int]' for array subscript
   22 |     if(!mp[i - 2]) dp[i] += dp[i - 2];
      |                               ^
a.cc:24:18: error: invalid types 'long long int[long long int]' for array subscript
   24 |          cout<<dp[n];
      |                  ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
const long long mod=1e9+7;

int main(){
	int N,M;
	cin>>N>>M;
	
	vector<int>oks(N+1,true);
	for(int i=0;i<M;++i){
		int a;cin>>a;
		oks[a]=false;
	}
	
	vector<long long int>dp(N+1);
	dp[0]=1;
	dp[1]=1;
     for(int i=2;i<N+1;i++)
     {
     	if(oks[i])
        {
          dp[i]=dp[i-1]+dp[i-2];
          dp[i]%=mod;
	 }
  // cout<<dp[N];
	
	cout<<dp[N]<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:2: error: expected '}' at end of input
   29 | }
      |  ^
a.cc:5:11: note: to match this '{'
    5 | int main(){
      |           ^
Language: C++

#include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;++i)
#include<string>
#include<vector>
using namespace std;
typedef long long ll;
typedef pair<int, int>P;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
//max=({});
//条件式が真ならwhileの中身を回し続ける
//printf("%d\n", ans);

//pairの入力
//vector<pair<ll, ll>>work(n);
//rep(i, n) {
//	ll a, b;
//	cin >> a >> b;
//	work[i] = make_pair(a, b);
//for(auto p:mp)(mapの探索)
//printf("%.10f\n",なんちゃら)

int g[15][15];
const int INF = 1001001001;
const int dx[4] = { -1,0,1,0 };
const int dy[4] = { 0,-1,0,1 };

//最大公約数
ll gcd(ll x, ll y) {
	return y ? gcd(y, x % y) : x;
}

ll lcm(ll x, ll y) {
	if (x == 0 || y == 0)return 0;
	return (x / gcd(x, y) * y);
}

//素因数分解
vector<pair<ll, int>>factorize(ll n) {
	vector<pair<ll, int>>res;
	for (ll i = 2;i * i <= n;++i) {
		if (n % i)continue;
		res.emplace_back(i, 0);
		while (n % i == 0) {
			n /= i;
			res.back().second++;
		}
	}
	if (n != 1)res.emplace_back(n, 1);
	return res;
}

int bingo[3][3];
bool flag[3][3];
int cnt[2][105];
int h, w;
int choco[1010][1010];

int main() {
	ll n, m, INF = 1e9 + 7;
	cin >> n >> m;
	vector<ll>a(m), dp(n + 2);
	vector<bool>flag(n + 2, true);
	rep(i, m) {
		cin >> a[i];
		flag[a[i] + 1] = false;
	}
	dp[1] = 1;
	dp[0] = 0;
	for (int i = 2;i <= n+1;++i) {
		if (flag[i])dp[i] = dp[i - 1] + dp[i - 2];
	}
	ll ans = dp[n + 1] % INF;
	printf("%"d\n, ans);
	return 0;
}


Compiler output:
a.cc:74:20: error: stray '\' in program
   74 |         printf("%"d\n, ans);
      |                    ^
a.cc: In function 'int main()':
a.cc:74:16: error: unable to find string literal operator 'operator""d' with 'const char [2]', 'long unsigned int' arguments
   74 |         printf("%"d\n, ans);
      |                ^~~~
Language: C++

#include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;++i)
#include<string>
#include<vector>
using namespace std;
typedef long long ll;
typedef pair<int, int>P;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
//max=({});
//条件式が真ならwhileの中身を回し続ける
//printf("%d\n", ans);

//pairの入力
//vector<pair<ll, ll>>work(n);
//rep(i, n) {
//	ll a, b;
//	cin >> a >> b;
//	work[i] = make_pair(a, b);
//for(auto p:mp)(mapの探索)
//printf("%.10f\n",なんちゃら)

int g[15][15];
const int INF = 1001001001;
const int dx[4] = { -1,0,1,0 };
const int dy[4] = { 0,-1,0,1 };

//最大公約数
ll gcd(ll x, ll y) {
	return y ? gcd(y, x % y) : x;
}

ll lcm(ll x, ll y) {
	if (x == 0 || y == 0)return 0;
	return (x / gcd(x, y) * y);
}

//素因数分解
vector<pair<ll, int>>factorize(ll n) {
	vector<pair<ll, int>>res;
	for (ll i = 2;i * i <= n;++i) {
		if (n % i)continue;
		res.emplace_back(i, 0);
		while (n % i == 0) {
			n /= i;
			res.back().second++;
		}
	}
	if (n != 1)res.emplace_back(n, 1);
	return res;
}

int bingo[3][3];
bool flag[3][3];
int cnt[2][105];
int h, w;
int choco[1010][1010];

int main() {
	ll n, m, INF = 1e9 + 7;
	cin >> n >> m;
	vector<ll>a(m), dp(n + 1);
	vector<bool>flag(n + 1, true);
	rep(i, m) {
		cin >> a[i];
		flag[a[i]] = false;
	}
	dp[0] = 1;
	int dp[-1] = 0;
	for (int i = 1;i <= n;++i) {
		if (flag[i])dp[i] = dp[i - 1] + dp[i - 2];
	}
	ll ans = dp[n] % INF;
	cout << ans << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:69:18: error: narrowing conversion of '-1' from 'int' to 'long unsigned int' [-Wnarrowing]
   69 |         int dp[-1] = 0;
      |                  ^
a.cc:69:16: error: size '-1' of array 'dp' is negative
   69 |         int dp[-1] = 0;
      |                ^~
a.cc:69:13: error: conflicting declaration 'int dp [1]'
   69 |         int dp[-1] = 0;
      |             ^~
a.cc:62:25: note: previous declaration as 'std::vector<long long int> dp'
   62 |         vector<ll>a(m), dp(n + 1);
      |                         ^~
Language: C++

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

int mod = 1000000007;
int n_max = 100000;
int f[n_max + 1];
void intiF() {
	f[0] = 1;
	f[1] = 1;
	for (int i = 2; i < n_max + 1; i++) {
		f[i] = f[i - 1] + f[i - 2];
	}
}

int main() {
	intiF();
	int n, m;
	cin >> n >> m;
	long long result = 1;
	int x = 0;
	for (int i = 0, a; i < m; i++) {
		cin >> a;
		if (x == a) {
			cout << 0 << endl;
			return 0;
		}
		result = result * f[a - 1 - x] % mod;
		x = a + 1;
	}

	cout << result * f[n - x] % mod << endl;
}


Compiler output:
a.cc:6:13: error: size of array 'f' is not an integral constant-expression
    6 | int f[n_max + 1];
      |       ~~~~~~^~~
Language: C++

n,m = map(int,input().split())
a = [int(input()) for i in range(m)]
dp =[0,1] + [0] * n
m = 10**9+7
for i in range(2,n+2):
    if i-1 not in a:
        dp[i] = dp[i-1] + dp[i-2]
        dp[i] %= m
print(dp[-1])

Compiler output:
a.cc:1:1: error: 'n' does not name a type
    1 | n,m = map(int,input().split())
      | ^
Language: C++

#include <iostream>
using namespace std;
#define int long long

signed main(){
  int n,m;
  bool disable[100006]={};
  int cnt[100006]={};
  cin >> n >> m; // System.in 的なの
  for(int i=0;i < m; i++){
    int a;
    cin >> a;
    disable[a]=true; // a番目に印をつける、という方法で i 番目の床に穴があいているかどうかがわかる。
  }
  cnt[1] = !disable[1];
  cnt[2] = ((!disable[2])? 1 + cnt[1] : 0);
  for(int i=3; i<=n; i++){
    if(disable[i]==false){
      cnt[i]=cnt[i-1]+cnt[i-2];
      cnt[i]%=1000000007;
    }
  }
  cout << cnt[n] << endl;

Compiler output:
a.cc: In function 'int main()':
a.cc:23:26: error: expected '}' at end of input
   23 |   cout << cnt[n] << endl;
      |                          ^
a.cc:5:14: note: to match this '{'
    5 | signed main(){
      |              ^
Language: C++

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

int main() {
  long long int n, m;
  cin >> n >> m;

  vector<int>a(n + 1, true);
  for (int i = 0; i < m; i++) {
    int t;
    cin >> t;
    a[t] = false;
  }

  vector<long long int>dp(n + 1);
  dp[0] = 1;

  for (int now = 0; now < n; now++) {
    for (int next = now + 1; next <= min(n, now + 2); next++) {
      if (a[next]) {
        dp[next] += dp[now];
        dp[next] %= 1000000007;
      }
    }
  }
  cout << dp[n] << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:41: error: no matching function for call to 'min(long long int&, int)'
   19 |     for (int next = now + 1; next <= min(n, now + 2); next++) {
      |                                      ~~~^~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:19:41: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   19 |     for (int next = now + 1; next <= min(n, now + 2); next++) {
      |                                      ~~~^~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:19:41: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   19 |     for (int next = now + 1; next <= min(n, now + 2); next++) {
      |                                      ~~~^~~~~~~~~~~~
Language: C++

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

int main() {
  long long int n, m;
  cin >> n >> m;

  vector<int>a(n + 1, ture);
  for (int i = 0; i < m; i++) {
    int t;
    cin >> t;
    a[t] = false;
  }

  vector<long long int>dp(n + 1);
  dp[0] = 1;

  for (int now = 0; now < n; now++) {
    for (int next = now + 1; next <= min(n, now + 2); next++) {
      if (a[next]) {
        dp[next] += dp[now];
        dp[next] %= 1000000007;
      }
    }
  }
  cout << dp[n] << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:23: error: 'ture' was not declared in this scope
    8 |   vector<int>a(n + 1, ture);
      |                       ^~~~
a.cc:19:41: error: no matching function for call to 'min(long long int&, int)'
   19 |     for (int next = now + 1; next <= min(n, now + 2); next++) {
      |                                      ~~~^~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:19:41: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   19 |     for (int next = now + 1; next <= min(n, now + 2); next++) {
      |                                      ~~~^~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:19:41: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   19 |     for (int next = now + 1; next <= min(n, now + 2); next++) {
      |                                      ~~~^~~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
#define ALL(a)  (a).begin(),(a).end()
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
using namespace std;
typedef long long ll;
typedef pair<int, int> P;

#define MOD 1000000007


int res(int N, set<int> a, vector<int> &fib){
  if(fib.at(N) != -1) return fib.at(N);

  if(N == 1) return fib.at(N) = 1;
  if(N == 0) return fib.at(N) = 1;

  return fib.at(N) = (res(N-1, a, fib, isok) % MOD + res(N-2, a, fib, isok) %MOD) % MOD;
}

int main(){
  int N, M;
  cin >> N >> M;
  set<int> a;
  vector<int> fib(N+1, -1);
  for(int i = 0; i < M; i++){
    int aa;
    cin >> aa;
    fib.at(aa) = 0;
  }
  cout << res(N, a, fib, isok) << endl;
}


Compiler output:
a.cc: In function 'int res(int, std::set<int>, std::vector<int>&)':
a.cc:17:40: error: 'isok' was not declared in this scope
   17 |   return fib.at(N) = (res(N-1, a, fib, isok) % MOD + res(N-2, a, fib, isok) %MOD) % MOD;
      |                                        ^~~~
a.cc: In function 'int main()':
a.cc:30:26: error: 'isok' was not declared in this scope
   30 |   cout << res(N, a, fib, isok) << endl;
      |                          ^~~~
Language: C++

#include <bits/stdc++.h>
#define ALL(a)  (a).begin(),(a).end()
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
using namespace std;
typedef long long ll;
typedef pair<int, int> P;

#define MOD 1000000007


int res(int N, set<int> a, vector<int> &fib){
  if(fib.at(N) != -1) return fib.at(N);
  if(!isok.at(N)) return fib.at(N);

  if(N == 1) return fib.at(N) = 1;
  if(N == 0) return fib.at(N) = 1;

  return fib.at(N) = (res(N-1, a, fib) % MOD + res(N-2, a, fib) %MOD) % MOD;
}

int main(){
  int N, M;
  cin >> N >> M;
  set<int> a;
  vector<int> fib(N+1, -1);
  vector<bool> isok(N+1, true);
  for(int i = 0; i < M; i++){
    int aa;
    cin >> aa;
    isok.at(aa) = false;
    fib.at(aa) = 0;
  }
  cout << res(N, a, fib) << endl;
}


Compiler output:
a.cc: In function 'int res(int, std::set<int>, std::vector<int>&)':
a.cc:13:7: error: 'isok' was not declared in this scope
   13 |   if(!isok.at(N)) return fib.at(N);
      |       ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
long long n,m,x,a[100010]={1};
int main(){
	cin>>n>>m;
	for(int i=0;i<m;i++){
		cin>>x;
		a[x]=-1;
	}
	for(int i=1;i<=n;i++){
		if(a[i]!=-1){
			if(a[i-1]!=-1)
				a[i]=(a[i]+a[i-1])%1000000007;
			if(a[i-2]!=-1)
				a[i]=(a[i]+a[i-1])%1000000007;
		}
	}
	if(a[n]==-1)
		cout<<0;
	else
		cout<<a[n]%%1000000007;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:28: error: expected primary-expression before '%' token
   21 |                 cout<<a[n]%%1000000007;
      |                            ^
Language: Java



import java.util.Scanner;

public class C {
	static long fact[] = new long[300000];
	static long factInv[] = new long[300000];

	public static void main(String[] args) {
		final int MOD = 1_000_000_000 + 7;

		fact[0] = 1;
		factInv[0] = 1;
		for(int i = 0; i < fact.length - 1; i++){
			fact[i+1] = fact[i]*(i+1) % MOD; // n!(mod M)
	        factInv[i+1] = (int)(factInv[i]*repeatablePow(i+1, MOD-2, MOD) % MOD);
		}

		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		int m = sc.nextInt();

		boolean broken[] = new boolean[n + 1];

		for(int i = 0; i < m; i++){
			broken[sc.nextInt()] = true;
		}

		//2連続で壊れていたらたどり着けない
		for(int i = 1; i < n; i++){
			if(broken[i] && broken[i - 1]){
				System.out.println(0);
				return;
			}
		}

		long result[] = new long[n + 1];
		result[0] = 1;

		if(!broken[1]){
			result[1] = 1;
		}
		for(int i = 2; i <= n; i++){
			if(broken[i]){
				result[i] = 0;
			}
			else {
				result[i] = (result[i - 1] + result[i - 2])%MOD;
			}
		}

		System.out.println(result[n]);
	}
	static long repeatablePow(int x, int n, int mod){
		if(n == 0){
			return 1;
		}
		long result = repeatablePow((int)((long)x*x%mod), n/2, mod);
		if(n % 2 == 1){
			result = result*x%mod;
		}
		return result;
	}


	//今回はnが大きすぎるがa,b<=2*10^5なのでこちらを使う
//	static long combination2(int n, int b, int mod){
//		if(b == 1){
//			return n;
//		}
//
//		long result = 1;
//
//		for(int i = 1; i <= b ; i++){
//			result *= (n - i + 1);
//			result %= mod;
//		}
//
//		result *= factInv[b];
//
//		return result % mod;
//	}
	static long combination(int a, int b, int mod){ //aCbをmod計算
	    if(a == 0 && b == 0)return 1;
	    if(a < b || a < 0)return 0;

	    long tmp = factInv[a - b]* factInv[b] % mod;
	    return tmp * fact[a] % mod;
	}
}


Compiler output:
Main.java:5: error: class C is public, should be declared in a file named C.java
public class C {
       ^
1 error
Language: C++

#include <iostream>
#include <vector>
#include <map>
#define rep(i, a, n) for(int i =  a; i < n; i++)
using namespace std;
using ll = long long;
using P = pair<int, int>;

int main()
{
    int n, m;
    cin >> n >> m;
    map<int, int> mp;
    mp[0] = 1;
    rep(i, 1, n+1){
        mp[i] = 1;
    }
    int k;
    rep(i, 0, m){
        cin >> k;
        mp[k] = 0;
    }
    ll ans = 1;
    ll mod = 1000000007;
    rep(i, 2, n){
        if(mp[i-2] == 0 && mp[i-1] == 0){
            cout << 0 << endl;
            return 0;
        }
        else if(mp[i-2] == 1 && mp[i-1] == 1){
            ans *= 2
        }
    }
    cout << ans % 1000000007 << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:31:21: error: expected ';' before '}' token
   31 |             ans *= 2
      |                     ^
      |                     ;
   32 |         }
      |         ~
Language: C++

#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
const long long mod = 1e9 + 7;

int main() {
	int N, M;
	cin >> N >> M;

	vector<int>oks(N + 1, true);
	for (int i = 0; i < M; i++) {
		int a = 0;
		cin >> a;
		oks[a] = false;
	}

	vector<long long int>dp(N + 1);
	dp[0] = 1;
	for (int now = 0; now < N; i++) {
		for (int next = now + 1; now < min(N, now + 2); now++) {
			if (oks[next]) {
				dp[next] += dp[now];
				dp[next] %= mod;
			}
		}
	}

	cout << dp[N] << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:36: error: 'i' was not declared in this scope
   20 |         for (int now = 0; now < N; i++) {
      |                                    ^
Language: C++

#include <cmath>
#include <string.h>
#include <iostream>
#include <stack>
#include <map>
#include <set>
#include <vector>
#include <algorithm>

#define rep(i, n) for (int i = 0; i < n; i++)
#define rep_nested(i, s, n) for (int i = s; i <= n; i++)
#define ll long long
#define ull unsigned long long

const int N = 500;
const ll INF = 1000000007;

using namespace std;

template <class T>
T limit(T n, T k) {
	return (n > k) ? k : n;
}

int main() {
	cout << cal_time_steps() << endl;
    return 0;
}

int cal_time_steps() {
	int n, m, k;
	
	cin >> n >> m;
	
	vector<ull> v(n + 1, 0);
	vector<bool> a(n + 1, true);
	
	rep(i, n) {
		cin >> k;
		a[k] = false;
	}
	
	v[0] = 1;
	
	for (int i = 0; i < n; i++) {
		for (int j = i + 1; j <= limit(n, i + 2); j++) {
			if (a[j]) {
				v[j] += v[i];
				v[j] %= INF;
			}
		}
	}
	
	return v[n];
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:17: error: 'cal_time_steps' was not declared in this scope
   26 |         cout << cal_time_steps() << endl;
      |                 ^~~~~~~~~~~~~~
Language: C++

N,M = map(int, input().split())
a = [0]*M
for i in range(M): a[i] = int(input())

mod = [1]*N
inv = [1]*N
inf = 10**9+7
for i in range(N-1): mod[i+1] = mod[i]*(i+2)%inf
inv[N-1] = pow(mod[N-1], inf-2, inf)
for i in range(2,N+1): inv[N-i] = inv[N-i+1]*(N-i+2)%inf

def comb(cur,ai):
    if ai - cur == 1:
        return 1
    elif ai <= cur:
        return 0
    return(comb(cur, ai-1)+comb(cur,ai-2))

cur = 1
if a[0] == 1: cur += 1
cnt = 0
for i in range(M):
    if cur == a[i]:
        cnt = 0
        break
    cnt += comb(cur,a[i])
    cur = a[i]+1

print(cnt)

Compiler output:
a.cc:1:1: error: 'N' does not name a type
    1 | N,M = map(int, input().split())
      | ^
Language: C++


  #include<bits/stdc++.h>

using namespace std;

int main(){
     int N,M;
    cin >> N >> M;

    vector<long int> a(M);
    for( int i = 0; i < M; i++) cin >> a[i];
    vector<int> dp(N + 1,0);
    /*a[M] = 1000000007;*/
    dp[0] = 1;
    int j = 0;
    if(a[j] == 1){ dp[1] = 0; j++; }
    else{ dp[1] = 1;}
   
   for(int i = 2; i <= N; i++){
       
       
       if(i == a[j] j < M - 1){ dp[i] = 0; j++; }
       else{ dp[i] = dp[i - 1] + dp[i - 2];
           
             } 
            
     dp[i] %= 1000000007;

   }

   cout << dp[N] << endl;
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:22:20: error: expected ')' before 'j'
   22 |        if(i == a[j] j < M - 1){ dp[i] = 0; j++; }
      |          ~         ^~
      |                    )
Language: C++

#include<bits/stdc++.h>

using namespace std;

int main(){
    long long int N,M;
    cin >> N >> M;

    vector<long long int> a(M);
    for(long long int i = 0; i < M; i++) cin >> a[i];
    vector<long long int> dp(N + 1,0);
    dp[0] = 1;
    long long int j = 0;
    if(a[j] == 1){ dp[1] = 0; j++; }
    else{ dp[1] = 1;}
   
   for(long long int i = 2; i <= N; i++){
       
       if(i == a[j] && j < M){ dp[i] = 0; j++; }
       else{ dp[i] = dp[i - 1] + dp[i - 2];
       dp[i] %= 1000000007; } 

       if(i - 1 != a[j]) dp[]
   }

   cout << dp[N] << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:29: error: expected primary-expression before ']' token
   23 |        if(i - 1 != a[j]) dp[]
      |                             ^