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

#include <stdio.h>
int main() {
	int n,m,i,a[100000];
	long long int ans[2] = (1, 1);
	scanf("%d", &n);
	scanf("%d", &m);
	for (i = 0; i < m; i++) scanf("%d", &a[i]);
	for (i = 0; i < m; i++) ans[i % 2] = ans[0] + ans[1];
	if (ans[1] > ans[0]) ans[0] = ans[1];
	printf("%lld", ans[0]%1000000007);
}

Compiler output:
main.c: In function 'main':
main.c:4:32: error: invalid initializer
    4 |         long long int ans[2] = (1, 1);
      |                                ^
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> broken(n + 1);

    for (int i = 0; i < M; i++) {
        int aa; cin >> aa;
        a[i] = aa;
        broken[a] = 1;
    }

    vector<int> dp(N + 1);
    dp[0] = 1;
    for (int j = 0; j < N; j++) {
        if (broken[i]) dp[j] = 0;
        else dp[j] = dp[j + 1] + dp[j + 2] % mod;
    }

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

Compiler output:
a.cc: In function 'int main()':
a.cc:9:24: error: 'n' was not declared in this scope
    9 |     vector<int> broken(n + 1);
      |                        ^
a.cc:13:9: error: 'a' was not declared in this scope; did you mean 'aa'?
   13 |         a[i] = aa;
      |         ^
      |         aa
a.cc:20:20: error: 'i' was not declared in this scope
   20 |         if (broken[i]) dp[j] = 0;
      |                    ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
	int N,M;cin>>N>>M;
    const int mod 1e9+7;
	int A[M];
	for(int i=0;i<M;i++){
		cin>>A[i];
	}
	int dp[N+1];dp[0]=1;
	int j;
	if(A[0]==1){
		j=1;
		dp[1]=0;
	}else{
		j=0;
		dp[1]=1;
	}for(int i=2;i<=N;i++){
		if(i==A[j]){
			dp[i]=0;
			if(j<M-1) j++;
		}else{
			dp[i]=(dp[i-1]+dp[i-2])%mod;
		}
	}cout<<dp[N]<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:19: error: expected initializer before numeric constant
    5 |     const int mod 1e9+7;
      |                   ^~~
a.cc:23:49: error: 'mod' was not declared in this scope; did you mean 'modf'?
   23 |                         dp[i]=(dp[i-1]+dp[i-2])%mod;
      |                                                 ^~~
      |                                                 modf
Language: Java

import java.util.Scanner;
import java.util.Comparator;
import java.util.Arrays;
import java.util.ArrayList;



public class Main {

	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int M = sc.nextInt();
		if(M == 0) {
			int [] a = new int[1];
			a[0] = 0;
		}
		else {
			int [] a = new int[M];
			for (int i = 0; i< M; i++) {
				a[i] = sc.nextInt();
			}
		}

		if(N == 1) {
			System.out.println(1);
		}
		else {
			long [] ans = new long[N+1];
			ans[0] = 1;
			int tmp = 0;
			if(a[tmp]==1) {
				ans[1] = 0;
				tmp++;
			}
			else {
				ans[1] = 1;
			}
			for (int i = 2; i<N+1;i++) {
				if(a[tmp]==i) {
					ans[i] = 0;
					if(tmp<M-1) {
						tmp++;
					}
				}
				else {
					ans[i]=(ans[i-1]+ans[i-2])%1000000007;
				}
			}
			System.out.println(ans[N]);
		}
	}
}


Compiler output:
Main.java:33: error: cannot find symbol
			if(a[tmp]==1) {
			   ^
  symbol:   variable a
  location: class Main
Main.java:41: error: cannot find symbol
				if(a[tmp]==i) {
				   ^
  symbol:   variable a
  location: class Main
2 errors
Language: Java

import java.util.Scanner;
 
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        boolean a[] = new boolean[n+10];
        for (int i = 0; i < m; i++) {
            ab[sc.nextInt()] = true;
        }
        final long MOD = 1000000007L;
        long dp[] = new long[n+10];
        dp[0] = 1;
        for (int i = 1; i <= n; i++) {
            if(a[i]) {
                dp[i] = 0;
            } else {
                dp[i] = dp[i-1];
                if(i> 1) dp[i] += dp[i-2];
                dp[i] %= MOD;
            }
        }
        System.out.println(dp[n]);
    }
}

Compiler output:
Main.java:10: error: cannot find symbol
            ab[sc.nextInt()] = true;
            ^
  symbol:   variable ab
  location: class Main
1 error
Language: C++

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

long long f(int n){
    if (n==1)return 1;
    if (n==2)return 1;
    return f(n-1)+f(n-2);
}

int main(){
    int n,m;
    cin >> n>> m;
    int a[m+1],d[m+1];
    a[0]=-1;
    for(int i=1;i<m+1;i++){
        cin>>a[i];
        d[i-1]=a[i]-a[i-1]-1;
        if(d[i-1]==0){
            cout<<0<<endl;
            return 0;
        }
    }
    d[m]=n-a[m];

    long long c=1;
    for(int i=0;i<m+1;i++){
        c*=f(d[i]);
    }
    c%=1000000007;
    cout<<c<<endl;

Compiler output:
a.cc: In function 'int main()':
a.cc:30:19: error: expected '}' at end of input
   30 |     cout<<c<<endl;
      |                   ^
a.cc:10:11: note: to match this '{'
   10 | int main(){
      |           ^
Language: C++

/* Author: Dhruv Rastogi */
#include<iostream>
#include<algorithm>
#include<set>
#include<vector>
#include<map>
#include<ctime>
#include<string>
#include<random>
#include<ctime>
using namespace std;
#define ll long long
#define int long long
#define all(sdk) sdk.begin(),sdk.end()
#define mll map<int, int>
#define pb push_back
#define rep(i,a,b) for(int i=a;i<b;++i)
#define repd(i,a,b) for(int i=a;i>=b;--i)
#define mp make_pair
#define hell 1000000007
#define endl '\n'
#define vvll vector<vector<int> >
#define vll vector<int>
#define mint map<int,int> 
#define sz(x) (int)x.size()
#define sll set<int>
#define pll pair<int,int>
#define F first
#define S second
const long double PI = acos(-1.0);

const int N=1e5+4;
int valid[N];
int dp[N];
void solve(){
	int n;
	cin>>n;
	dp[0]=1;
	memset(valid,1,sizeof valid);
	int m;
	cin>>m;
	rep(i,0,m){
		int x;
		cin>>x;
		valid[x]=0;
	}
	rep(i,0,n){
		if(valid[i]){
			dp[i]%=hell;
			dp[i+1]+=dp[i];
			dp[i+2]+=dp[i];
		}
	}
	cout<<dp[n]%hell<<endl;
}

signed main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int t=1;
    // cin>>t;
    while(t--){
        solve();
    }
    return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:39:9: error: 'memset' was not declared in this scope
   39 |         memset(valid,1,sizeof valid);
      |         ^~~~~~
a.cc:11:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
   10 | #include<ctime>
  +++ |+#include <cstring>
   11 | using namespace std;
Language: C++

#include<iostream>
using namespace std;

int fibo (int n){
    if(n==0 ||n==1){
      return 1;
    }else if (n==2){
      return 2;
    }else{
      return fibo(n-1) + fibo(n-2);
    }
}
  
int main(){
  int n,m, answer=1;
  cin >> n >> m;
  int a[n];
  cin >> a[0];
  for(int i= 1; i<m; i++){
    cin >> a[i];
    if (a[i]-a[i-1] ==1){
      answer= 0;
      break;
    }else{
      answer *= fibo(a[i] - a[i-1] -1);
  }
  
  
  cout << answer;
  return 0;
}  

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

#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstring>
#include <cstdlib>
#include <utility>
#include <cstdio>
#include <vector>
#include <string>
#include <string.h>
#include <queue>
#include <stack>
#include <cmath>
#include <set>
#include <map>
int GCD(int a, int b) {
    return b ? GCD(b, a%b) : a;
}
//sort(a, a + N, greater<int>())   // descend
//sort(a, a+N)                    //  ascend

using ll = long long;
using namespace std;
int main() {
    int n, m;
    int a[110000];
    cin >> n >> m;
    for (int i = 0; i < m; i++) cin >> a[i];
    bool renzoku = true;
    
    for (int i = 0; i < m; i++) {
        if (a[i] == a[i+1]+1) {
            renzoku = false;
                break;
        }
    }
    ll ppx = (m+((n - 3m)*(n - 3*m) *3/ 8)) % 1000000007;
    if(renzoku)cout << ppx;
    else cout << 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:23: error: unable to find numeric literal operator 'operator""m'
   37 |     ll ppx = (m+((n - 3m)*(n - 3*m) *3/ 8)) % 1000000007;
      |                       ^~
Language: C++

int main() {
    int n, m;
    int a[110000];
    cin >> n >> m;
    for (int i = 0; i < m; i++) cin >> a[i];
    bool renzoku = true;
    
    for (int i = 0; i < m; i++) {
        if (a[i] == a[i+1]+1) {
            renzoku = false;
                break;
        }
    }
    ll ppx = (m+((n - 3m)(n - 3*m) 3/ 8)) % 1000000007;
    if(renzoku)cout << ppx;
    else cout << 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:5: error: 'cin' was not declared in this scope
    4 |     cin >> n >> m;
      |     ^~~
a.cc:14:5: error: 'll' was not declared in this scope
   14 |     ll ppx = (m+((n - 3m)(n - 3*m) 3/ 8)) % 1000000007;
      |     ^~
a.cc:15:16: error: 'cout' was not declared in this scope
   15 |     if(renzoku)cout << ppx;
      |                ^~~~
a.cc:15:24: error: 'ppx' was not declared in this scope
   15 |     if(renzoku)cout << ppx;
      |                        ^~~
a.cc:16:10: error: 'cout' was not declared in this scope
   16 |     else cout << 0;
      |          ^~~~
Language: C++

#include <bits/stdc++.h>
#include <vector>
#include <string>
#include <algorithm> // sort
#include <map> // pair
using namespace std;

int main(){
  int N,M;
  cin >> N >> M;
  vector<long long int> f(N,0);
  vector<int> a(M + 1,0);

  for(int i = 0;i < M;i++){
    cin >> a[i];
    a[i] -= 1;
  }
  
  long long int temp1,temp2;

  f[0] = 1;
  f[1] = 2;
  
  int j = 0;

  //1,2段目が抜けていた場合
  if(a[0] == 0){
    f[0] = 0;
    f[1] = 1;
    j++;
  } 
  if(a[0] == 1 || a[1] == 1){
    f[1] = 0;
    j++;
  }
  
  temp1 = f[0];
  temp2 = f[1];

  //cout << f[0] << " " << f[1] << " ";

  for(int i = 2;i < N;i++){
    //f[i] がaと一致しない場合は行う
    if(i != a[j]){
      f[i] = temp1 + temp2;
    }else{
      j++;
    }
    temp2 = f[i - 1];
    temp1 = f[i];
    f[i] %= 1000000007
  }

  cout << f[N - 1] << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:51:23: error: expected ';' before '}' token
   51 |     f[i] %= 1000000007
      |                       ^
      |                       ;
   52 |   }
      |   ~
Language: Java

import java.util.*;

public class stairs {


    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

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

        int dp[] = new int[n];

        int a[] = new int[m];

        for (int i=0; i<m; i++){
            a[i] = sc.nextInt();
            dp[a[i]] = 0;
            dp[0] = 1;
            dp[1] = 1;
        }

        for (int j=0; j<n-2; j++){
            dp[j+2] = (dp[j+1]+dp[j])%1000000007;
        }

        System.out.println(dp[n-1]);

        }
    }



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

#include<iostream>
#include<sstream>
#include<fstream>
#include<string>
#include<vector>
#include<deque>
#include<queue>
#include<stack>
#include<map>
#include<set>
#include<utility>
#include<functional>
#include<algorithm>
#include<bitset>
#include<ctime>
#include<cmath>
#include<cstdio>
#include<cstdlib>
using namespace std;
const long long mod=1000000007;
int a[100005];
int main()
{
	int n,m;
	cin>>n>>m;
	for(int i=0;i<m;i++)
	{
		cin>>k;
		a[k]=-1;
	}
	a[0]=1;
	for(int i=1;i<=n;i++)
	{
		if(a[i]==-1)
			continue;
		if(i>=2&&a[i-2]!=-1)
			(a[i]+=a[i-2])%=mod;
		if(a[i-1]!=-1)
			(a[i]+=a[i-1])%=mod;
	}
	cout<<a[n];
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:22: error: 'k' was not declared in this scope
   28 |                 cin>>k;
      |                      ^
Language: C++

#include<iostream>
#include<sstream>
#include<fstream>
#include<string>
#include<vector>
#include<deque>
#include<queue>
#include<stack>
#include<map>
#include<set>
#include<utility>
#include<functional>
#include<algorithm>
#include<bitset>
#include<ctime>
#include<cmath>
#include<cstdio>
#include<cstdlib>
using namespace std;
const long long mod=1000000007;
int a[100005];
int main()
{
	int n,m;
	cin>>n>>m;
	rep(i,m)
	{
		cin>>k;
		a[k]=-1;
	}
	a[0]=1;
	for(int i=1;i<=n;i++)
	{
		if(a[i]==-1)
			continue;
		if(i>=2&&a[i-2]!=-1)
			(a[i]+=a[i-2])%=mod;
		if(a[i-1]!=-1)
			(a[i]+=a[i-1])%=mod;
	}
	cout<<a[n];
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:13: error: 'i' was not declared in this scope
   26 |         rep(i,m)
      |             ^
a.cc:26:9: error: 'rep' was not declared in this scope; did you mean 'frexp'?
   26 |         rep(i,m)
      |         ^~~
      |         frexp
Language: C++

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

int main()
{
	cin.tie(0);
	ios::sync_with_stdio(false);

	int n,m;
	vector<int> oks(n+1,true);
	cin >>n>>m;
	memset(oks,1,sizeof(oks));
	vector <long long> t(n+1);
    t[0]=1;
	for(int i = 0;i<n;++i)
	{    for(int next = i+1;next<=min(n,i+2);++next)
    {
        if(oks[next])
        {
            t[next]+=t[i];
            t[next]%=1000000007;
        }
    }
		
	}
	cout <<t[n]<<endl;

	return 0;
}
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 

Compiler output:
a.cc: In function 'int main()':
a.cc:12:16: error: cannot convert 'std::vector<int>' to 'void*'
   12 |         memset(oks,1,sizeof(oks));
      |                ^~~
      |                |
      |                std::vector<int>
In file included from /usr/include/c++/14/cstring:43,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:121,
                 from a.cc:1:
/usr/include/string.h:61:28: note:   initializing argument 1 of 'void* memset(void*, int, size_t)'
   61 | extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1));
      |                      ~~~~~~^~~
Language: C++

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

int main()
{
	cin.tie(0);
	ios::sync_with_stdio(false);

	int n,m;
	vector<int> oks(10000);
	cin >>n>>m;
	for(int i =0;i<m;i++)
	    {int a;
        cin >>a;
        oks[a] = false}
	vector <long> t(n);
    t[0]=1;
	for(int i = 0;i<n;i++)
	{    for(int next = i+1;next<=min(n,i+2);next++)
    {
        if(oks[next])
        {
            t[next]+=t[i];
            t[next]%=mod;
        }
    }
		
	}
	cout <<t[n-1]%1000000007<<endl;

	return 0;
}
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 

Compiler output:
a.cc: In function 'int main()':
a.cc:15:23: error: expected ';' before '}' token
   15 |         oks[a] = false}
      |                       ^
      |                       ;
a.cc:24:22: error: 'mod' was not declared in this scope; did you mean 'modf'?
   24 |             t[next]%=mod;
      |                      ^~~
      |                      modf
Language: C++

#include<bits/stdc++.h>
using namespace std;
int N;
int M;
int dp[100000];
int m=1000000007;
std::vector<int> v;
int recur(int n)
{
    if(n==N) return 1;
    if(n>N) return 0;

    
        if(c[n]==1) return 0;
    if(dp[n]!= -1) return ( dp[n] %m );

    return dp[n]=( (recur(n+1)%m) + (recur(n+2) %m)%m);

}

int main()
{
    memset(dp, -1, sizeof(dp));
    cin>>N;
  cin>>M;
  	int c[1000000]={0};
    for(int i=0; i<M;i++)
        {int x; cin>>x; c[x]++; }

    cout<<recur(0);

    return 0;
}

Compiler output:
a.cc: In function 'int recur(int)':
a.cc:14:12: error: 'c' was not declared in this scope
   14 |         if(c[n]==1) return 0;
      |            ^
Language: C++

#include<iostream>
using namespace std;

int main(){
  int n,m;cin>>n>>m;
  int a[m];for(int i=0;i<m;i++){cin>>a[i];}
  long ans=0;
  
  int fib[n];fib[0]=0;fib[1]=1;
  for(int i=2;i<n;i++){
    fib[i]=fib[i-1]+fib[i-2];
  }
  
  ans+=fib[a[0]-1];
  for(i=0;i<m-1;i++){
    ans+=fib[a[i+1]-a[i]-1];
  }
  cout<<ans<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:7: error: 'i' was not declared in this scope
   15 |   for(i=0;i<m-1;i++){
      |       ^
Language: Java

package com.company;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class C {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        List<Integer> brokens = new ArrayList<>();
        for(int i=0; i < M; i++){
            brokens.add(sc.nextInt());
        }

        List<Integer> ans = new ArrayList<>();
        if(brokens.contains(1) && brokens.contains(2)){
            ans.add(0);
            ans.add(0);
        }else if(brokens.contains(1)){
            ans.add(0);
            ans.add(1);
        }else if(brokens.contains(2)){
            ans.add(1);
            ans.add(0);
        }else {
            ans.add(1);
            ans.add(2);
        }
        for(int i=2; i<N; i++){
            if(brokens.contains(i) && brokens.contains(i-1)){
                ans.add(0);
            }else if (brokens.contains(i)){
                ans.add(ans.get(i-2));
            }else if (brokens.contains(i-1)){
                ans.add(ans.get(i-1));
            }else {
                ans.add(
                        ans.get(i-1)+ans.get(i-2)
                );
            }
            ans.set(i,ans.get(i)%1000000007);
        }
        System.out.println(ans.get(N-1));
    }
}


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

package com.company;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class C {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        List<Integer> brokens = new ArrayList<>();
        for(int i=0; i < M; i++){
            brokens.add(sc.nextInt());
        }

        List<Integer> ans = new ArrayList<>();
        if(brokens.contains(1) && brokens.contains(2)){
            ans.add(0);
            ans.add(0);
        }else if(brokens.contains(1)){
            ans.add(0);
            ans.add(1);
        }else if(brokens.contains(2)){
            ans.add(1);
            ans.add(0);
        }else {
            ans.add(1);
            ans.add(2);
        }
        for(int i=2; i<N; i++){
            if(brokens.contains(i) && brokens.contains(i-1)){
                ans.add(0);
            }else if (brokens.contains(i)){
                ans.add(ans.get(i-2));
            }else if (brokens.contains(i-1)){
                ans.add(ans.get(i-1));
            }else {
                ans.add(
                        ans.get(i-1)+ans.get(i-2)
                );
            }
            ans.set(i,ans.get(i)%1000000007);
        }
        //for (Integer list:ans){
        //    System.out.println(list);
        //}
        System.out.println(ans.get(i-1));
    }
}


Compiler output:
Main.java:7: error: class C is public, should be declared in a file named C.java
public class C {
       ^
Main.java:49: error: cannot find symbol
        System.out.println(ans.get(i-1));
                                   ^
  symbol:   variable i
  location: class C
2 errors
Language: C++

/**
       ������������    ������������
		Author : Avi J Patel
		University : DA-IICT
       ������������    ������������
**/
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define pb push_back
#define mp make_pair 
#define N 100000
#define ff first
#define ss second
#define si size()
#define mod 1000000007
#define large 10000000000000001
#define FAST ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);srand(time(NULL));

int main()
{
	FAST;
	int n,m;
	cin>>n>>m;
	vector<int> a;
	vector<ll> b
	b.pb(0);
	b.pb(1);
	b.pb(1);
	
	for(int i=3;i<100001;i++)
	{
		b.pb((b[i-1]+b[i-2])%1000000007);
	}
	cout<<b[100000]<<endl;
	for(int i=0;i<m;i++)
	{
		int a1;
		cin>>a1;
		a.pb(a1);
	}
	vector<int> c;
	ll ans=1;
	c.pb(a[0]);
	for(int i=1;i<m;i++)
	{
		c.pb(a[i]-a[i-1]-1);
	}
	c.pb(n-a[m-1]);
	
	for(int i=0;i<c.size();i++)
	{
		//cout<<c[i]<<" ";
		ans*=b[c[i]];
		ans%=1000000007;
	}
	cout<<ans;
    return 0;
}








Compiler output:
a.cc: In function 'int main()':
a.cc:28:9: error: expected initializer before 'b'
   28 |         b.pb(0);
      |         ^
a.cc:29:9: error: 'b' was not declared in this scope
   29 |         b.pb(1);
      |         ^
Language: C++

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

int main(){

  int N,M;
  cin >> N >> M;
  vector<int> broken(N+1);

  for(int i = 0;i < M;i++){
    int a;
    cin >> a;
    broken[a] = 1;
  }
  vector<int> dp(n+2);//dp[n+1]は0で初期化.
  const int mod = 1000000007;
  dp[n] = 1;
  for(int i = n - 1;i >= 0;i--){
    if(broken[i]){
      dp[i] = 0;
      continue;
    }
    dp[i] = (dp[i + 1] + dp[i + 2]) % mod;


  }

  cout << dp[0] << endl;

  return 0;


}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:18: error: 'n' was not declared in this scope
   15 |   vector<int> dp(n+2);//dp[n+1]は0で初期化.
      |                  ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

int N;
vector<long long> dp;
vector<bool> broke;
const int mod = 1e9 + 7;

int dfs(int pos)
{
  int& res = dp[pos];
  if (res >= 0) return res;
  if (broke[pos]) return res = 0;
  return res = (dfs(pos+1) + dfs(pos+2)) % mod;
}

int main()
{
  int M;
  cin >> N >> M;
  dp.resize(N+1, -1);
  broke.resize(N+1, false);
  dp[N] = 1;
  for (int i = 0; i < N; i++) {
    int t;
    cin >> t;
    broke[t] = true;
  }
  cout << dfs(0) << endl;
}


Compiler output:
a.cc: In function 'int dfs(int)':
a.cc:12:20: error: cannot bind non-const lvalue reference of type 'int&' to a value of type '__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type' {aka 'long long int'}
   12 |   int& res = dp[pos];
      |                    ^
Language: C++

#include <bits/stdc++.h> 
using namespace std;
canst long long mod=1e9+7;
int main(){
    int N,M;
    cin >> N >> M;
    //create a vector that judges floor is clash or safe 
    vector<int> oks(N+1,true);
    for(int i=0;i<M;i++){
        //clash floors are false
        int a;
        cin >> a;
        oks[a]=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(oks[next]){
                dp[next] +=dp[now];
                dp[next] %=mod;
            }
        }

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


}

Compiler output:
a.cc:3:1: error: 'canst' does not name a type; did you mean 'const'?
    3 | canst long long mod=1e9+7;
      | ^~~~~
      | const
a.cc: In function 'int main()':
a.cc:23:28: error: 'mod' was not declared in this scope; did you mean 'modf'?
   23 |                 dp[next] %=mod;
      |                            ^~~
      |                            modf
Language: C++

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

int main() {
  int mod = 1e9 + 7;
  int N, M;
  cin >> N >> M;

  vector<int> aa(M);
  for (int k = 0; k < M; k++) { cin >> aa[k]; }
  
  vector<int> ans(N + 1);
  ans[0] = 1;

  for (int k = 1, l = 0; k <= N; k++) {
    if (l < m && aa[l] == k) { l++; continue; }
    if (k > 0) { ans[k] += ans[k - 1]; }
    if (k > 1) { ans[k] += ans[k - 2]; }
    ans[k] %= mod;
  }
  
  cout << ans[N] << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:13: error: 'm' was not declared in this scope
   16 |     if (l < m && aa[l] == k) { l++; continue; }
      |             ^
Language: C++

#include <iostream>

using namespace std;

int fib(int x);

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

  int a[m+1];
  for(int i = 0; i < m; i++) cin >> a[i];

  if(m == 0) a[0] = n;

  for(int i = 0; i < m-1; i++) {
    if(a[i] + 1 == a[i+1]) {
      cout << 0;
      return 0;
    }
  }
  long long int ans = 1;
  int under;
  for(int i = 0; i < m; i++) {
    if(i == 0) under = -1;
    else under = a[i-1];

    if(a[i] != 1)ans *= fib(a[i] - under - 2);

    if(i == m-1) ans *= fib((n - 1) - a[i]);
  }

  cout << ans % 1000000007 << endl;
}

long int fib(int x) {
  if(x == 0 || x == 1) return 1;
  else return fib(x-1) + fib(x-2);
}


Compiler output:
a.cc:36:10: error: ambiguating new declaration of 'long int fib(int)'
   36 | long int fib(int x) {
      |          ^~~
a.cc:5:5: note: old declaration 'int fib(int)'
    5 | int fib(int x);
      |     ^~~
Language: C++

MOD = 10**9+7
n, m = map(int, input().split())
dp = [0] * (n+1)
dp[0] = 1

# skip用 list
A = [0] * (n+1) 
for _ in range(m):
  broken = int(input())
  A[broken] = 1

# dp
for i in range(1, n+1):
  if A[i] == 1:
    dp[i] = 0
  else:
    dp[i] = (dp[i-1] + dp[i-2]) % MOD
    
print(dp[n])

Compiler output:
a.cc:6:3: error: invalid preprocessing directive #skip\U00007528
    6 | # skip用 list
      |   ^~~~~~
a.cc:12:3: error: invalid preprocessing directive #dp
   12 | # dp
      |   ^~
a.cc:1:1: error: 'MOD' does not name a type
    1 | MOD = 10**9+7
      | ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL //デバッグ出力系
#define dout cout
#define debug() if(true)
#else
#define dout(s) if(false) cout
#define debug() if(false)
#endif//
#define next asdnext
#define prev asdprev
#define rep(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define all(x) (x).begin(),(x).end()
#define vout(v) for(auto &i:v){cout<<i<<" ";}cout<<"\n"; //配列出力
#define vin(v) for(auto &i:v)cin>>i; //配列入力
#define vec(v,n) vector<int> v(n,0);
typedef long long ll;
typedef unsigned long long ull;

void Main() {
	int N, M;
	cin >> N >> M;
	vec(a,M);
	vin(a);

	vec(dp, N+2);
	dp[N] = 1;
	int index = M-1;
	for (int i = N - 1; i >= 0; i--) {
		if (i == a[index]) {
			if (index != 0) index--;
			dp[i] = 0;
			continue;
		}
		dp[i] = (dp[i + 1] + dp[i + 2]) % 1000000007;
		dout << i << ":" << dp[i] << "\n";
	}

	cout << (dp[0] % 1000000007) << endl;
}

int main() {
	cin.tie(nullptr);
	ios_base::sync_with_stdio(false);
	cout << std::fixed << std::setprecision(15);
	Main();
	return 0;
}


Compiler output:
a.cc: In function 'void Main()':
a.cc:36:17: error: 'dout' was not declared in this scope
   36 |                 dout << i << ":" << dp[i] << "\n";
      |                 ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int a(int x){
if(x==0 || x==1){
 return 1; 
}
  else if(x==2){
   return 2; 
  }
  else{
   vector<int> b(x);
    b[0]=1; b[1]=2;
    for(int i=2; i<x; i++){
     b[i]=b[i-1]+b[i-2]; 
    }
    return b[x-1];
  }
}
int main() {
 int N,M;
  cin >> N >> M;
  vector<int> c;
  c.resize(M);
  for(int i=0; i<M; i++){
   cin >>  c.at(i);
  }
  int wa=a(c.at(0)-1)*a(N-c.at(M-1)-1);
  for(int i=0; i<M-1; i++){
   if(c.at(i+1)==c.at(i)+1) {
     wa=0;
     break;
   }
    else if(c.at(i+1)==c.at(i)+2){
     wa*=1; 
      continue;
    }
    else{
      wa*=a(c.at(i+1)-c.at(i)-2);
      continue;
    }

Compiler output:
a.cc: In function 'int main()':
a.cc:40:6: error: expected '}' at end of input
   40 |     }
      |      ^
a.cc:28:27: note: to match this '{'
   28 |   for(int i=0; i<M-1; i++){
      |                           ^
a.cc:40:6: error: expected '}' at end of input
   40 |     }
      |      ^
a.cc:19:12: note: to match this '{'
   19 | int main() {
      |            ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef unsigned int ll;
#define rep(i,n) for(int i=0;i<n;++i)
#define repf(i,n) for(int i=0;i<=n;i++)
const ll mod=1000000000+7;
typedef pair<ll, ll> P;

ll N,M;
priority_queue<ll,vector<ll>,greater<ll> > A;
ll dp[100010];

int main(){
	cin >> N >> M;
	rep(i,M){
		ll a;cin >> a;
		A.push(a);
	}

	dp[0] = 1; dp[1] = 1;
	ll cur;
	if(!(A.empty()))ll next = A.top();
	for(int i=1;i<N;i++){
		cur = next;
		if(!(A.empty())){
			next = A.top();
			if(i == next){
				dp[i] = 0;
				dp[i+1] = (dp[i] + dp[i-1]) % mod;
				A.pop();
				continue;
			}
			if(cur + 1 == next){
				cout << 0 << endl;
			}
		}

		dp[i+1] = (dp[i] + dp[i-1]) % mod;
	}

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

Compiler output:
a.cc: In function 'int main()':
a.cc:24:23: error: cannot resolve overloaded function 'next' based on conversion to type 'll' {aka 'unsigned int'}
   24 |                 cur = next;
      |                       ^~~~
a.cc:26:38: error: overloaded function with no contextual type information
   26 |                         next = A.top();
      |                                      ^
a.cc:27:30: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator=='
   27 |                         if(i == next){
      |                            ~~^~~~~~~
a.cc:33:36: error: invalid operands of types 'll' {aka 'unsigned int'} and '<unresolved overloaded function type>' to binary 'operator=='
   33 |                         if(cur + 1 == next){
      |                            ~~~~~~~~^~~~~~~
Language: C++

#include<iostream>
#include <math.h>
#include <algorithm>
#include<queue>
#include <bits/stdc++.h>


using namespace std;

#define FOR(i,a,b) for(int i=(a),i##formax=(b);i<i##formax;i++)


main(){
    int N, M;
    cin >> N >> M;
    vector<int> broken (n+1);
    FOR(i,0,M){
        int a;
        cin >> a;
        broken[a] = 1;
    }
    
    vector<int> dp(N+2);
    const int mod = 1000000007;
    dp[N] = 1;
    for(int i = N-1; i >= 0; i--){
        if(broken[i]){
            dp[i] = 0;
            continue;
        }
        dp[i] = (dp[i+1] + dp[i+2] % mod);
    }
    cout << dp[0] << endl;
    return 0;
}



Compiler output:
a.cc:13:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   13 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:16:25: error: 'n' was not declared in this scope
   16 |     vector<int> broken (n+1);
      |                         ^
Language: C++

#include<iostream>
#include <math.h>
#include <algorithm>
#include<queue>
#include <bits/stdc++.h>


using namespace std;

#define FOR(i,a,b) for(int i=(a),i##formax=(b);i<i##formax;i++)


main(){
    int N, M;
    cin >> N >> M;
    vector<int> broken(n+1);
    FOR(i,0,M){
        int a;
        cin >> a;
        broken[a] = 1;
    }
    
    vector<int> dp(n+2);
    const int mod 1000000007;
    dp[n] = 1;
    for(int i = n-1; i >= 0; i--){
        if(broken[i]){
            dp[i] = 0;
            continue;
        }
        dp[i] = (dp[i+1] + dp[i+2] % mod);
    }
    cout << dp[0] << endl;
    return 0;
}



Compiler output:
a.cc:13:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   13 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:16:24: error: 'n' was not declared in this scope
   16 |     vector<int> broken(n+1);
      |                        ^
a.cc:24:19: error: expected initializer before numeric constant
   24 |     const int mod 1000000007;
      |                   ^~~~~~~~~~
a.cc:31:38: error: 'mod' was not declared in this scope; did you mean 'modf'?
   31 |         dp[i] = (dp[i+1] + dp[i+2] % mod);
      |                                      ^~~
      |                                      modf
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define fi first
#define se second
#define pb push_back
#define all(v) (v).begin(),(v).end()
ll mod = 1000000007;
ll INF = 1000000099;
 
signed main(){
    ll n,m,x=-1,y=-1,ans=1;
    cin>>n>>m;
    vector<ll> fib(n+1),v;
    fib.at(0)=1;
    fib.at(1)=1;
 
    for(ll i=2;i <= n;i++)
    {
        fib.at(i)=fib.at(i-1)%mod+fib.at(i-2)%mod;
        fib.at(i)%=mod;
    }
 
    for(ll i=0;i < m;i++)
    {
        cin>>y;
        if(y==x+1){
            cout << 0 << endl;
            return 0;
        }
        v.pb(y-x-2);
        x=y;
    }
    v.pb(n-y-1);
 
    for(ll i=0;i < (ll)v.size();i++)
    {
        ans*=(fib.at(v.at(i));
        ans%=mod;
    }
    
    cout << ans%mod << endl;
 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:38:30: error: expected ')' before ';' token
   38 |         ans*=(fib.at(v.at(i));
      |              ~               ^
      |                              )
Language: C++

#include<bits/stdc++.h>
using namespace std;
long long D = 1000000007;

int main(){
int n,m,tmp = 0;
cin >> n >> m;
long long sta[n] = {0};
long long a[n] = {0};
a[0] = 1;//昇り口

for(int i=0;i<m;i++){
  cin >> tmp;
  sta[tmp]+=1;
}

for(int i=0;i<n;i++){
  for(int j = i+1;j < min(n,j+2);j++){
    if(sta[j]) {
      a[j]+=a[i];
      a[j]%=D;
    }
} 
cout << a[n] << endl;
}



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

import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
      	int m = sc.nextInt();
      	int a[] = new int[m];
      	for (int i = 0; i < m; i++){
          	a[i] = sc.nextInt();
        }
        int s = fib(a[0] - 1);
      	for (int i = 0; i < m-1; i++){
          	s = s * fib(a[i+1] - a[i]);
        }
		System.out.println(s%1000000007);
	}
  	public static int fib(int n){
      	int f0 = 0;
      	int f1 = 1;
      	int fn = f0 + f1;
      	for (int i = 2; i <= n; i++){
          	fn = f0 + f1;
            f0 = f1;
          	f1 = fn;
        }
        return fn;
        }
    }
}

Compiler output:
Main.java:29: error: class, interface, enum, or record expected
}
^
1 error
Language: Java

import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
      	int m = sc.nextInt();
      	int a[] = new int[m];
      	for (int i = 0; i < m; i++){
          	a[i] = sc.nextInt();
        }
        int s = fib(a[0] - 1);
      	for (int i = 0; i < m-1; i++){
          	s = s * fib(a[i+1] - a[i]);
        }
		System.out.println(s%1000000007);
	}
  	public static int fib(int n){
      	int f0 = 0;
      	int f1 = 1;
      	int fn = f0 + f1;
      	for (int i = 2; i <= n; i++){
          	fn = f0 + f1;
            f0 = f1;
          	f1 = fn;
          	return fn;
        }
    }
}

Compiler output:
Main.java:27: error: missing return statement
    }
    ^
1 error
Language: C++

#include<iostream>
#include <math.h>
#include <algorithm>
#include<queue>
#include <bits/stdc++.h>


using namespace std;

#define FOR(i,a,b) for(int i=(a),i##formax=(b);i<i##formax;i++)

long long fib(long long n){
    if (n == 0 || n == 1){return 1;}
    else{return fib(n-1) + fib(n-2);}
}

main(){
   int N, M;
   long long c = 0; 
   int pre = 1;
   cin >> N >> M;
    int a, b;
    if(M != 0){
        FOR(i,0,M){
            cin >> a;
            if (a == pre && pre != 1){
                c = 0;
                break;
            }
            else{
                b = a - pre;
                c += fib(b);
                c %= 1000000007
                pre = a + 1;
            }
        }
        if (c == 0){cout << 0 << endl;}
        else{
        b = N - pre;
        c += fib(b);
        cout << c % 1000000007 <<endl;
        }
    }
    else{
        c = fib(N);
        cout << c % 1000000007 << endl;
    }
}




Compiler output:
a.cc:17:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   17 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:33:32: error: expected ';' before 'pre'
   33 |                 c %= 1000000007
      |                                ^
      |                                ;
   34 |                 pre = a + 1;
      |                 ~~~
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int main() {
	int N, M;
	cin >> N >> M;
	vector<long long int> s(M + 2), t(N), d(M + 1);
	s[0] = -1;
	for(int i = 1; i < M + 1; ++i) {
		cin >> s[i];
	}
	s[M + 1] = N + 1;
	t[0] = 1;
	t[1] = 1;	
	for(int i = 1; i < M + 1; ++i) {
		d[i] = s[i] - s[i - 1];
	}
	int max_d = *max_element(d.begin(),d.end());
	int min_d = *min_element(d.begin(),d.end());
		if(min_d <= 1 && d[0] != 1 && d[0] != 0) {
				cout << 0 << endl; 
			} else {
			//cout << "max = " << max_d << endl;
			for(int i = 2; i < max_d; ++i) {
				t[i] = t[i - 1] + t[i - 2];
				t[i] = t[i] % 1000000007;
				//cout << i << "= " << t[i] << endl;
			}
			long long int sum = 1;
			for(int i = 1; i < M + 1; ++i) {
				sum = sum * t[d[i] - 2];
				//cout << t[d[i] - 2] << endl;
				sum = sum % 1000000007;
			}
			cout << sum % 1000000007 << endl;
		}
	}
}
	


Compiler output:
a.cc:40:1: error: expected declaration before '}' token
   40 | }
      | ^
Language: C++

#include<iostream>
#include <math.h>
#include <algorithm>
#include<queue>
#include <bits/stdc++.h>


using namespace std;

#define FOR(i,a,b) for(int i=(a),i##formax=(b);i<i##formax;i++)


main(){
   int N, M;
   long long c = 0; 
   int pre = 1;
   cin >> N >> M;
    int a, b;
    if(M != 0){
        FOR(i,0,M){
            cin >> a;
            if (a == pre && pre != 1){
                c = 0;
                break;
            }
            else{
                b = a - pre;
                c += fib(b); 

                pre = a + 1;
            }
        }
        if (c == 0){cout << 0 << endl;}
        else{
        b = N - pre;
        c += fib(b);
        cout << c % 1000000007 <<endl;
        }
    }
    else{
        c = fib(N);
        cout << c % 1000000007 << endl;
    }
}



Compiler output:
a.cc:13:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   13 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:28:22: error: 'fib' was not declared in this scope
   28 |                 c += fib(b);
      |                      ^~~
a.cc:36:14: error: 'fib' was not declared in this scope
   36 |         c += fib(b);
      |              ^~~
a.cc:41:13: error: 'fib' was not declared in this scope
   41 |         c = fib(N);
      |             ^~~
Language: C++

long dp[1<<17],mod=(long)1e9+7;
inline void solve(void){
  long N,M;
  in(N,M);
  long a;
  rep(i,M){
    in(a);
    dp[a]=-1;
  }
  if(dp[1]==-1&&dp[2]==-1){
    out(0);
    return;
  }
  dp[1]=dp[1]!=-1?1:-1;
  if(dp[2]!=-1&&dp[1]!=-1)dp[2]=2;
  else if(dp[1]==-1)dp[2]=1;
  up(i,3,N){
    if(dp[i]==-1)continue;
    if(dp[i-1]!=-1)dp[i]+=dp[i-1],dp[i]%=mod;
    if(dp[i-2]!=-1)dp[i]+=dp[i-2],dp[i]%=mod;
  }
  out(dp[N]);
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:4:3: error: 'in' was not declared in this scope; did you mean 'int'?
    4 |   in(N,M);
      |   ^~
      |   int
a.cc:6:7: error: 'i' was not declared in this scope
    6 |   rep(i,M){
      |       ^
a.cc:6:3: error: 'rep' was not declared in this scope
    6 |   rep(i,M){
      |   ^~~
a.cc:11:5: error: 'out' was not declared in this scope
   11 |     out(0);
      |     ^~~
a.cc:17:3: error: 'up' was not declared in this scope; did you mean 'dp'?
   17 |   up(i,3,N){
      |   ^~
      |   dp
a.cc:22:3: error: 'out' was not declared in this scope
   22 |   out(dp[N]);
      |   ^~~
Language: C

#include <stdio.h>
#include <math.h>
int all(int st,int goal);
 int main(void){
     double ans=1.0;
    int n, m,i;
 
    int now=0;//to (n)
    scanf("%d %d",&n,&m);
    int data[m];//no enter
    for(i=0;i<m;i++){
        scanf("%d",&data[i]);
        
       
        
        ans=ans*(double)all(now,data[i]-1);
    
        ans=ans%1000000007;
        
        now=data[i]+1;
    }
    
    ans=ans*(double)all(now,n);

    printf("%d\n",ans%1000000007);
  
   
    return 0;
}
int all(int st,int goal){
int na=goal-st+1;
 int ans,i, sut[na];
    if(na==2){
        return 1;
        
    }else if(na<=1){return 0;}
    else{sut[0]=1;
    sut[1]=1;
        
    }
  for (i=2;i<na;i++){
      sut[i]=sut[i-1]+sut[i-2] ;
  }
  return sut[na-1];
}


Compiler output:
main.c: In function 'main':
main.c:18:16: error: invalid operands to binary % (have 'double' and 'int')
   18 |         ans=ans%1000000007;
      |                ^
main.c:25:22: error: invalid operands to binary % (have 'double' and 'int')
   25 |     printf("%d\n",ans%1000000007);
      |                      ^
Language: C

#include <stdio.h>
#include <math.h>
int all(int st,int goal);
 int main(void){
     double ans=1.0;
    int n, m,i;
 
    int now=0;//to (n)
    scanf("%d %d",&n,&m);
    int data[m];//no enter
    for(i=0;i<m;i++){
        scanf("%d",&data[i]);
        
       
        
        ans=ans*(double)all(now,data[i]-1);
    
        ans=ans%1000000007.0;
        
        now=data[i]+1;
    }
    
    ans=ans*(double)all(now,n);

    printf("%d\n",ans%1000000007.0);
  
   
    return 0;
}
int all(int st,int goal){
int na=goal-st+1;
 int ans,i, sut[na];
    if(na==2){
        return 1;
        
    }else if(na<=1){return 0;}
    else{sut[0]=1;
    sut[1]=1;
        
    }
  for (i=2;i<na;i++){
      sut[i]=sut[i-1]+sut[i-2] ;
  }
  return sut[na-1];
}


Compiler output:
main.c: In function 'main':
main.c:18:16: error: invalid operands to binary % (have 'double' and 'double')
   18 |         ans=ans%1000000007.0;
      |                ^
main.c:25:22: error: invalid operands to binary % (have 'double' and 'double')
   25 |     printf("%d\n",ans%1000000007.0);
      |                      ^
Language: C++

n,_,*a=map(int,open(0).read().split())
a=set(a)
c,d=1,0
for i in range(n):n=(c+d)%(10**9+7)*(i not in a);c,d=n,c
print(n)

Compiler output:
a.cc:1:1: error: 'n' does not name a type
    1 | n,_,*a=map(int,open(0).read().split())
      | ^
a.cc:4:50: error: 'c' does not name a type
    4 | for i in range(n):n=(c+d)%(10**9+7)*(i not in a);c,d=n,c
      |                                                  ^
Language: C

#include <iostream>
#include <vector>
using namespace std;

int n, m;
long long memo[100001];

int main() {
  cin >> n >> m;
  vector<int> a(m);
  int prev;
  for(int i = 0; i < m; i++){
    cin >> a[i];
    if(i == 0){
      prev = a[0];
      continue;
    }
    if(a[i] - prev == 1){
      cout << 0 << endl;
      return 0;
    }
    prev = a[i];
  }

  memo[0] = 0;
  memo[1] = 1;
  memo[2] = 2;
  for(int i = 3; i < 100001; i++) {
    memo[i] = memo[i - 1] + memo[i - 2];
  }

  int start = 0, end = 0;
  long long ans = 1;
  for(int i = 0; i < m; i++){
    end = a[i] - 1;
    long long res = memo[end - start];
    if(res != 0){
      ans *= res;
      ans = ans % 1000000007;
    }
    start = a[i] + 1;
  }
  long long res = memo[n - start];
  if(res != 0) {
    ans *= res;
    ans = ans % 1000000007;
  }
  cout << ans % 1000000007 << endl;
  return 0;
}

Compiler output:
main.c:1:10: fatal error: iostream: No such file or directory
    1 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

#include<iostream>
using namespace std;
long long hoge = 1000000007;

int main(){
  int n, m, head = 0;
  // 標準入力
  cin >> n >> m;

  int a[m+1];
  long long s[n+1];
  for ( int i = 0; i < m; i++){ cin >> a[i];}
  a[m] = 0;
  a[m+1] = 0;

  // init
  for ( int i = 0; i <= n; i++){ s[i] = 0;}

  // 1段目
  s[0] = 1;
  s[1] = 1;
  // 2段目から始める
  for ( int i = 2; i <= n; i++){
    if (i = a[head] || i = a[head+1]) {
    s[i] = 0;
    }
    
    if (i-2 == a[head] && i-1 == a[head+1]){
      s[i] = 0;
      break;
    } else if (i-2 == a[head] && i-1 != a[head+1]){
      s[i] = s[i-1];
      head++;
    } else if (i-2 != a[head] && i-1 == a[head]){
      s[i] = s[i-2];
    } else {
      s[i] = s[i-2] + s[i-1];
    }

   s[i] = s[i]%hoge;
  }

  cout << s[n]%hoge << endl;

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:21: error: lvalue required as left operand of assignment
   24 |     if (i = a[head] || i = a[head+1]) {
      |             ~~~~~~~~^~~~
Language: C++

include<stdio.h>

int min(int a,int b);

int main(){

  int div = 1000000007;
  int N,M;
  int a;
  int state[100000];
  int dp[100001];
  int i,now,next;
  long ans;
  
  scanf("%d %d", &N,&M);
/*
  for(i=0;i<N;i++){
    state[i] = 0;
  }
*/ 
  for(i=0;i<M;i++){
    scanf("%d", &a);
    state[a] = 1;
  }

  dp[0] = 1;

  for(now=0;now<N;now++){
    for(next = now + 1; next <= min(N, now + 2); next++){
      if(state[next] == 0){
	dp[next] += dp[now];
	dp[next] %= div;
      }
    }
  }

  printf("%d\n", dp[N]);

  return 0;

}

int min(int a,int b){

  if(a <= b){
    return a; 
  }
  else{
    return b;
  }
  
}


Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include<stdio.h>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:15:3: error: 'scanf' was not declared in this scope
   15 |   scanf("%d %d", &N,&M);
      |   ^~~~~
a.cc:29:33: error: 'min' was not declared in this scope; did you mean 'main'?
   29 |     for(next = now + 1; next <= min(N, now + 2); next++){
      |                                 ^~~
      |                                 main
a.cc:37:3: error: 'printf' was not declared in this scope
   37 |   printf("%d\n", dp[N]);
      |   ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | include<stdio.h>
Language: Java

import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
      	int m = sc.nextInt();
      	int a[] = new a[m];
      	for (int i = 0; i < m; i++){
          	a[i] = sc.nextInt();
        }
        int s = fib(a[0] - 1);
      	for (int i = 0; i < m-1; i++){
          	s = s * fib(a[i+1] - a[i]);
        }
		System.out.println(s%1000000007);
	}
  	public static int fib(int n){
      	int f0 = 0;
      	int f1 = 1;
      	int fn = f0 + f1;
      	for (int i = 2; i <= n; i++){
          	fn = f0 + f1;
            f0 = f1;
          	f1 = fn;
          	return fn;
        }
    }
}

Compiler output:
Main.java:7: error: cannot find symbol
      	int a[] = new a[m];
      	              ^
  symbol:   class a
  location: class Main
1 error
Language: Java

import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
      	int m = sc.nextInt();
      	int a[] = new a[m];
      	for (int i = 0; i < m; i++){
          	a[i] = sc.nextInt();
        }
        int s = fib(a[0] - 1);
      	for (int i = 0; i < m-1; i++){
          	s = s * fib(a[i+1] - a[i]);
        }
		System.out.println(s%1000000007);
	}
  	public static int fib(n){
      	int f0 = 0;
      	int f1 = 1;
      	int fn = f0 + f1;
      	for (int i = 2; i <= n; i++){
          	fn = f0 + f1;
            f0 = f1;
          	f1 = fn;
          	return fn;
        }
    }
}

Compiler output:
Main.java:17: error: <identifier> expected
  	public static int fib(n){
  	                       ^
1 error