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

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

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

int main(){
    int n,m,a[100010];
    cin>>n>>m;
    rep(i,m) cin>>a[i];
    ll cnt[100010],j=0;
    cnt[0]=1;
    for(int i=1;i<n;i++){
        while(a[j]-1<i&&j<m-1) j++;
        if(a[j]-1==i) cnt[i]=0,cnt[i+1]=cnt[i-1];
        else if cnt[i+1]=(cnt[i]+cnt[i-1])%(int(pow(10,9))+7);
    }
    cout<<cnt[n]<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:17: error: expected '(' before 'cnt'
   16 |         else if cnt[i+1]=(cnt[i]+cnt[i-1])%(int(pow(10,9))+7);
      |                 ^~~
      |                 (
Language: C++

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

int n, m;
int a[100000] = {0};
int adiff[100000];
bool flag = false;
long ans = 1;

void solve()
{
  for (int i=0; i<=m; i++) {
    if (adiff[i]-1 >= 0) {
    ans = (ans*pow(2,adiff[i]-1)) % 1000000007;
    }
  }
}

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

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

      if (i == 0)   {
        adiff[i] = a[i] - 1 ;
      } else {
        adiff[i] = a[i] - a[i-1] - 1;
      }
    }
    adiff[m] = n - a[m-1] - 1;

  solve();

  cout << ans  << endl;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:14:35: error: invalid operands of types '__gnu_cxx::__promote<double>::__type' {aka 'double'} and 'int' to binary 'operator%'
   14 |     ans = (ans*pow(2,adiff[i]-1)) % 1000000007;
      |           ~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~
      |               |                     |
      |               |                     int
      |               __gnu_cxx::__promote<double>::__type {aka double}
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <cstdio>
#define REP(i, n) for (int i = 0; i < (n); i++)
#define MOD 1000000007


using namespace std;

int main() {
    long long N, M;
    long long count = 1;
    cin >> N >> M;
    long long a[M];
    long long fib_array[N];
    fib_array[0] = 1;
    fib_array[1] = 1;
    for (int i = 2; i < N + M; i++) {
        fib_array[i] = (fib_array[i - 1] + fib_array[i - 2]) % MOD;
    }
    for (int i = 0; i < M; i++) {
        cin >> a[i];
        if (i == 0) {
            count = fib_array[a[0] - 1] % MOD;
        }
        else {
            if ((a[i] - a[i-1]) == 1) {
                count = 0;
                break;
            }
            else {
                count = (count * fib_array[(a[i] - a[i-1] - 2)]) % MOD;
            }
        }
    }
    cout << (count * fib_array[N - a[M - 1] - 1]) % MOD　<< endl;
}


Compiler output:
a.cc:38:53: error: extended character 　 is not valid in an identifier
   38 |     cout << (count * fib_array[N - a[M - 1] - 1]) % MOD　<< endl;
      |                                                     ^
a.cc: In function 'int main()':
a.cc:38:53: error: 'MOD\U00003000' was not declared in this scope
   38 |     cout << (count * fib_array[N - a[M - 1] - 1]) % MOD　<< endl;
      |                                                     ^~~~~
Language: C++

#include <bits/stdc++.h>

typedef long long int ll;
typedef unsigned long long int ull;

#define REP(i, n) for (ll i = 0; i < n; i++)

using namespace std;

ll fib(ll n, vector<ll> &table)
{
  if (table[n]>0){
    return table[n];
  } 

  for (ll i = 2; i <= n; ++i)
  {
    table[i] = table[i - 1] + table[i - 2];
  }
  return table[n];
}

int main()
{
  ll n, m;
  cin >> n >> m;
  if(m==0){
    cout << fib(n) << endl;
    return 0};
  vector<ll> t(n + 1);
  t[0] = t[1] = 1;

  vector<ll> a(m);
  for(ll i=0;i<m;i++){
    cin >> a[i];
  }

  ll res = fib(a[0]-1, t) * fib(n-a[m-1]-1, t)%1000000007LL;
  // cout << res << endl;
  for(ll i=1; i<m;i++){
    res *= fib(a[i]-a[i-1]-2, t)%1000000007LL;
    res %= 1000000007LL;
  }

  cout << res%1000000007LL << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:16: error: too few arguments to function 'll fib(ll, std::vector<long long int>&)'
   28 |     cout << fib(n) << endl;
      |             ~~~^~~
a.cc:10:4: note: declared here
   10 | ll fib(ll n, vector<ll> &table)
      |    ^~~
a.cc:29:13: error: expected ';' before '}' token
   29 |     return 0};
      |             ^
      |             ;
Language: C++

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

int n, m;
int a[100000] = {0};
int adiff[100000];
bool flag = false;
long ans = 1;

void solve()
{
  for (int i=0; i<=m; i++) {
    if (adiff[i]-1 >= 0) {
    ans = ans*pow(2,adiff[i]-1) % 1000000007;
    }
  }
}

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

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

      if (i == 0)   {
        adiff[i] = a[i] - 1 ;
      } else {
        adiff[i] = a[i] - a[i-1] - 1;
      }
    }
    adiff[m] = n - a[m-1] - 1;

  solve();

  cout << ans  << endl;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:14:33: error: invalid operands of types '__gnu_cxx::__promote<double>::__type' {aka 'double'} and 'int' to binary 'operator%'
   14 |     ans = ans*pow(2,adiff[i]-1) % 1000000007;
      |           ~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~
      |              |                    |
      |              |                    int
      |              __gnu_cxx::__promote<double>::__type {aka double}
Language: C++

#include <iostream>
#include <algorithm>

int N, M;
long memo[] = {[0 ... 100001] = -1};

long step(int position) {
    if (memo[position] >= 0) {
        return memo[position];
    }
    memo[position] = step(position + 1) + step(position + 2);
    return memo[position];
}

int main() {
    std::cin >> N >> M;
    for (int i = 0; i < M; i += 1) {
        int ai;
        std::cin >> ai;
        memo[ai] = 0;
    }
    memo[N] = 1;
    memo[N + 1] = 0;

    std::cout << step(0) % 1000000007 << std::endl;

    return 0;
}


Compiler output:
a.cc:5:17: error: expected identifier before numeric constant
    5 | long memo[] = {[0 ... 100001] = -1};
      |                 ^
a.cc: In lambda function:
a.cc:5:31: error: expected '{' before '=' token
    5 | long memo[] = {[0 ... 100001] = -1};
      |                               ^
a.cc: At global scope:
a.cc:5:34: error: no match for 'operator=' (operand types are '<lambda()>' and 'int')
    5 | long memo[] = {[0 ... 100001] = -1};
      |                                  ^
a.cc:5:29: note: candidate: '<lambda()>&<lambda()>::operator=(const<lambda()>&)' (deleted)
    5 | long memo[] = {[0 ... 100001] = -1};
      |                             ^
a.cc:5:29: note:   no known conversion for argument 1 from 'int' to 'const<lambda()>&'
Language: C++

#include <iostream>
using namespace std;
int main(){
    long N,M;
    long SEKI;
    M=0;
    long kekkan[100002];
    SEKI=1;
    cin >> N >> M;
    kekkan[0]=-1;
    kekkan[M+1]=N+1;
    for(int i=1;i<M+1;i++){
        cin >> kekkan[i];
    }
    for(int j=0;j<M+1;j++){
        if (kekkan[j]==kekkan[j+1]-1){
            SEKI=0;
            break;
        }
        else{
            long a= 1; 
            long b= 0;
            long c= 0;
            for(int t = kekkan[j]+1;t< kekkan[j+1]-1; t++) {
            c=b;
            b=a;
            a=(a+c)%1000000007;
            }
            SEKI=(SEKI*a)%1000000007 ;

        }
    }
    cout << SEKI << endl;


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

#include <bits/stdc++.h>
using namespace std;
void a(int x){
  vector<int> b;
  b.resize(x);
  b.at(0)=1;
  b.at(1)=2;
 for (int i=2; i<x; i++){
   b.at(i)=b.at(i-1)+b.at(i-2);
 }
  return b.at(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(c.at(M-1)-1);
  for(int i=1; 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; 
    }
    else{
      wa*=a(c.at(i+1)-c.at(i)-2);
    }
  }
  cout << wa << endl;
}


Compiler output:
a.cc: In function 'void a(int)':
a.cc:11:14: error: return-statement with a value, in function returning 'void' [-fpermissive]
   11 |   return b.at(x-1);
      |          ~~~~^~~~~
a.cc: In function 'int main()':
a.cc:18:19: error: expected ';' before 'i'
   18 |   for(int i=0; i<M i++){
      |                   ^~
      |                   ;
a.cc:21:22: error: invalid operands of types 'void' and 'void' to binary 'operator+'
   21 |   int wa=a(c.at(0)-1)+a(c.at(M-1)-1);
      |          ~~~~~~~~~~~~^~~~~~~~~~~~~~~
      |           |            |
      |           void         void
a.cc:31:12: error: void value not ignored as it ought to be
   31 |       wa*=a(c.at(i+1)-c.at(i)-2);
      |           ~^~~~~~~~~~~~~~~~~~~~~
Language: C

#include <stdio.h>
#include <math.h>
long double ff[100000]={1,1};
int p=1;
long double f(int a){
  if(a<=p)
    return ff[a];
  int i;
  for(i=p+1;i<=a;i++){
  	ff[i]=ff[i-1]+ff[i-2];
  }
  p=a;
  return ff[a];
}
int main(){
  int n,m,a1,a2,i;
  long double sum;
  fscanf(stdin,"%d%d\n",&n,&m);
  if(m>0){
    fscanf(stdin,"%d",&a1);
    sum=f(a1-1);
    for(i=1;i<m;i++){
      fscanf(stdin,"%d",&a2);
      if(a1+1==a2){
        printf("0");
        return 0;
      }
      sum*=fmodl(f(a2-a1-2),1000000007);
      a1=a2;
    }
    sum*=fmodl(f(n-a1-1),1000000007);
  }
  else
    sum=f(n);
  printf("%.0Lf",fmodl(sum,1000000007));
  return 0;
}
#include <stdio.h>
#include <math.h>
long double ff[100000]={1,1};
int p=1;
long double f(int a){
  if(a<=p)
    return ff[a];
  int i;
  for(i=p+1;i<=a;i++){
  	ff[i]=ff[i-1]+ff[i-2];
  }
  p=a;
  return ff[a];
}
int main(){
  int n,m,a1,a2,i;
  long double sum;
  fscanf(stdin,"%d%d\n",&n,&m);
  if(m>0){
    fscanf(stdin,"%d",&a1);
    sum=f(a1-1);
    for(i=1;i<m;i++){
      fscanf(stdin,"%d",&a2);
      if(a1+1==a2){
        printf("0");
        return 0;
      }
      sum*=fmodl(f(a2-a1-2),1000000007);
      a1=a2;
    }
    sum*=fmodl(f(n-a1-1),1000000007);
  }
  else
    sum=f(n);
  printf("%.0Lf",fmodl(sum,1000000007));
  return 0;
}


Compiler output:
main.c:40:13: error: redefinition of 'ff'
   40 | long double ff[100000]={1,1};
      |             ^~
main.c:3:13: note: previous definition of 'ff' with type 'long double[100000]'
    3 | long double ff[100000]={1,1};
      |             ^~
main.c:41:5: error: redefinition of 'p'
   41 | int p=1;
      |     ^
main.c:4:5: note: previous definition of 'p' with type 'int'
    4 | int p=1;
      |     ^
main.c:42:13: error: redefinition of 'f'
   42 | long double f(int a){
      |             ^
main.c:5:13: note: previous definition of 'f' with type 'long double(int)'
    5 | long double f(int a){
      |             ^
main.c:52:5: error: redefinition of 'main'
   52 | int main(){
      |     ^~~~
main.c:15:5: note: previous definition of 'main' with type 'int()'
   15 | int main(){
      |     ^~~~
Language: C++

#include<bits/stdc++.h>

using namespace std;

int sumarraybegin(vector<int> &w,int j,int n)
{
  int sum=0;
  
  for(int i=j;i<n;i++)
  {
    sum++;
  }
  

  return sum-1;
}

int main()
{
  int n,m;
  int step1=1;
  int step2=2;
  cin >> n >> m;
  a.at(0)=0;
  vector<int> a(m);
  for(int i=0;i<m;i++){
    cin >> a.at(i);
  }
  vector<int> k(m+1);
  long long ans=1;
  int j=0;
  for(int i=0;i<n;i++)
  {
    k.at(i)=sumarraybegin(a,j,a.at(i));
    j=a.at(i);
  }
  for(int i=0;i<k.size();i++)
  {
    ans*=k.at(i);
  }
  cout << ans%1000000007 << endl;
  
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:3: error: 'a' was not declared in this scope
   24 |   a.at(0)=0;
      |   ^
Language: C++

#include <iostream>
#include <vector>
#include <functional>

int main() {
  using ull = unsigned long long;
  ull N,M;
  std::cin >> N >> M;
  std::vector<ull> D;
  long long p = -1;
  long long max_diff = 0;
  for(ull m=0;m<M;m++){
    long long a;
    std::cin >> a;
    long long d = a - 1 - ( p + 1);
    if(d < 0) {
      std::cout << 0 << std::endl;
      return 0;
    }
    D.push_back(d);
    if(max_diff < d)
      max_diff = d;
    p = a;
  }
  d = N - (p+1);
  if(max_diff < d)
    max_diff = d;
  D.push_back(d);

  std::vector<ull> count(max_diff+1);
  count[0] = 1;
  count[1] = 1;
  for(ull i=0;i<max_diff-1;i++){
    count[i+2] = count[i] + count[i+1];
  }
  ull count_all = 1;
  for(auto &d:D)
    count_all *= count[d];
  std::cout << (count_all%1000000007) <<std::endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:25:3: error: 'd' was not declared in this scope
   25 |   d = N - (p+1);
      |   ^
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[i];
    if(a[i]-a[i-1]==1){
      cout<<0<<endl;
      return 0;
    }
  }
  int b[n];
  b[0]=1;
  b[1]=2;
  long long sum=1;
  for(int i=2;i<n;i++){
    b[i]=b[i-1]+b[i-2];
    for(int j=0;j<m;j++){
      if(i+1==a[j]){
        for(int k=a[j-1]+1;k<=i;k++){
          sum*=b[k];
        }
        b[i]=0;
        b[i-1]=1;
        break;
      }
    }
    if(i+1==n){
      for(int k=a[j-1]+1;k<=i;k++){
          sum*=b[k];
        }
      break;
    }
  }
  cout<<sum<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:19: error: 'j' was not declared in this scope
   31 |       for(int k=a[j-1]+1;k<=i;k++){
      |                   ^
Language: Java

import java.util.*;

class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int M = sc.nextInt();

    int now = 0;
    int before = 0;
    int total = 1;
    for(int i=1; i < M+1; i++){
    	now = sc.nextInt();
      	total *= howmany(now, before);
      	total %= 1000000007;
      	before = now;
    }
    total *= howmany(N, before);
    total %= 1000000007;
    System.out.println(total);
    
  }
  
  private static int howmany(int now, int before){
    int diff = now - before -1;
    if(diff == 0){
      return 0;
    }else{
      return fi(diff);
    }
    
  }
  private static int fi(int n){
    return n < 3 ? 1 : fi(n - 1) + fi(n - 2);
    if(n<3){
      return 1;
    }else{
      return fi(n-1) + fi(n-2);
    }
  }
}


Compiler output:
Main.java:35: error: unreachable statement
    if(n<3){
    ^
1 error
Language: C++

#include <iostream>
#include <set>
using namespace std;
typedef long long ll;

const ll wari = 1000000007;

int N,M;
//vector<string> s_list;
set<ll> m_set;
ll dp[1000000];

#if 1
ll rec(ll cur) {
  if (dp[cur]>=0) {
    return dp[cur];
  }
  if (cur>N)  return 0;
  if (cur==N) {
    return 1;
  }
  if (m_set.count(cur)==1) {
    //cout << "break:cur=" << cur << "\n";
    return 0;
  }
  return dp[cur]=rec(cur+1)+rec(cur+2);
}
#endif

int main() {
  cin >> N >> M;
  //m_set.resize(M);
  for(int i=0;i<M;i++) {
    ll tmp = 0;
    cin >> tmp;
    m_set.insert(tmp);
  }

#if 1
  memset(dp, -1, sizeof(dp));
  ll ans = rec(0);
  //cout << "ans=" << ans << "\n" ; 
  cout << (ans%wari) << "\n" ; 
#endif

#if 0
  ll tmp = 4;
  cout << "ans=" << (4%wari) << "\n";
#endif

#if 0
  cout << N << " " << M << "\n";
  for(auto s: m_set) cout << s << "\n"; 
#endif
  return 0;
}

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

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N,M;
  cin >> N >> M;

  int A[100010]
    int A[0] = 1, A[1]=1, A[2]=2;
  int dansuu(int x) {
   if(x == 0 || x == 1)
     return 1;
   	if else(x == 2)
     	return 2;
   		else{
   			for(int i=0;i<x-1;i++){
    			A[i+2]=A[i+1]+A[i];
   			}
    	return A[x];
        }
  }
  
  cout << dansuu(1) << endl;
  cout << dansuu(2) << endl;
  cout << dansuu(3) << endl;

  
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:5: error: expected initializer before 'int'
    9 |     int A[0] = 1, A[1]=1, A[2]=2;
      |     ^~~
a.cc:10:21: error: a function-definition is not allowed here before '{' token
   10 |   int dansuu(int x) {
      |                     ^
a.cc:23:11: error: 'dansuu' was not declared in this scope
   23 |   cout << dansuu(1) << endl;
      |           ^~~~~~
Language: Java

import java.io.*; 
import java.util.Scanner;
import java.lang.Math;

public class Main {
  
	public static void main(String[] args){
      	
      	Scanner in = new Scanner(System.in);
		int N = in.nextInt();
      	int M = in.nextInt();
      
      	int[] rotos = new int[M];
      	for(int i=0;i<M;i++){
        	rotos[i]= in.nextInt();
        }
        
      	System.out.println(ways(rotos, N));
      	
	}
  	
  	public static int ways(int[] rotos, int steeps){
      	int counter=0;
    	return waysAux(rotos, steeps, counter, 1, 0);
    }
  
  	public static int waysAux(int[] rotos, int steeps, int counter, int pos){
      	if(posRota(pos, rotos)) return 0;
      	else{
        	if(pos>=steeps) return 1;
          	else{
            	counter+= waysAux(rotos,steeps,counter,pos+1);
            	counter+= waysAux(rotos,steeps,counter,pos+2);
            }
        }
    }
  
    public static boolean posRota(int pos, int[]rotos){
      	for(int i=0; i< rotos.length; i++){
        	if (pos == rotos[i]) return true;
          	else return false;
        }
    }
  
}

Compiler output:
Main.java:24: error: method waysAux in class Main cannot be applied to given types;
    	return waysAux(rotos, steeps, counter, 1, 0);
    	       ^
  required: int[],int,int,int
  found:    int[],int,int,int,int
  reason: actual and formal argument lists differ in length
1 error
Language: C++

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

	class MemorizeFibonacci:public Fibonacci{
	int memo[10000] = {0};
public:
	virtual int fib(int x);
};

int MemorizeFibonacci::fib(int x){
	if(x == 0){
		return 0;
	}else if(x == 1){
		return 1;
	}else if(memo[x] != 0){
		return memo[x];
	}
	memo[x] = fib(x-1) + fib(x-2);
}
int main(){ 
    int n,m;
    long long int a=1;
    cin>> n>>m;
    vector<int> vec(m+2);
for (int i = 1; i < m+1; i++) {
  cin >> vec.at(i);
}
for(int i=1;i<m;i++){
    if(vec.at(i+1)-vec.at(i)==1){
        a=0;
        break;
    }
    a*=fib(vec.at(i+1)-vec.at(i)-1);

}
a*=fib(vec.at(1));
a*=fib(n-vec.at(m));
cout << a%1000000007<<endl;
    return 0;
}


Compiler output:
a.cc:4:49: error: expected class-name before '{' token
    4 |         class MemorizeFibonacci:public Fibonacci{
      |                                                 ^
a.cc: In function 'int main()':
a.cc:33:8: error: 'fib' was not declared in this scope
   33 |     a*=fib(vec.at(i+1)-vec.at(i)-1);
      |        ^~~
a.cc:36:4: error: 'fib' was not declared in this scope
   36 | a*=fib(vec.at(1));
      |    ^~~
a.cc: In member function 'virtual int MemorizeFibonacci::fib(int)':
a.cc:18:17: warning: control reaches end of non-void function [-Wreturn-type]
   18 |         memo[x] = fib(x-1) + fib(x-2);
      |         ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
Language: C++

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <vector>
#include <stack>
using namespace std;

int cnt=0;

void stairCheck(int N,int M,int a[M],int j){
    if(j==N) {
        cnt++;
        return;
    }
    for(int k=0;k<M;k++){
        if((j+1)==a[k]){
            if((j+2)==a[k+1]){
                return;
            }else{
                stairCheck(N,M,a,j+2);
                return;
            }
        }
        if((j+2)==a[k]){
            stairCheck(N,M,a,j+1);
            return;
        }
    }
    if((j+1)<=N) stairCheck(N,M,a,j+1);
    if((j+2)<=N) stairCheck(N,M,a,j+2);
    return;
}

int main(){
    int N,M;
    scanf("%d %d",&N,&M);
    int a[M];
    for(int i=0;i<M;i++){
        scanf("%d",&a[i]);
    }
    int count=0;
    stairCheck(N,M,a,0);

    printf("%d\n",(cnt%1000000007));

    return 0;
}

Compiler output:
a.cc:12:36: error: use of parameter outside function body before ']' token
   12 | void stairCheck(int N,int M,int a[M],int j){
      |                                    ^
a.cc:12:37: error: expected ')' before ',' token
   12 | void stairCheck(int N,int M,int a[M],int j){
      |                ~                    ^
      |                                     )
a.cc:12:38: error: expected unqualified-id before 'int'
   12 | void stairCheck(int N,int M,int a[M],int j){
      |                                      ^~~
Language: C++

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

function fib(int n) {
  int num1=1, num2=1, tmp=1;
  
  for(int i = 1; i<n; i++) {
    tmp = num1 + num2;
    num1 = num2;
    num2 = tmp;
  }
  return tmp;
}

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


Compiler output:
a.cc:4:1: error: deduced class type 'function' in function return type
    4 | function fib(int n) {
      | ^~~~~~~~
In file included from /usr/include/c++/14/functional:59,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
                 from a.cc:1:
/usr/include/c++/14/bits/std_function.h:111:11: note: 'template<class _Signature> class std::function' declared here
  111 |     class function;
      |           ^~~~~~~~
a.cc: In function 'int main()':
a.cc:25:10: error: 'fib' was not declared in this scope
   25 |     r *= fib(a[i] - a[i-1] - 1);
      |          ^~~
Language: C++

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





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

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

	vector<int>F(101);
	F[0]=0;
	F[1]=1;
	F[2]=1;
	for(int i =3;i<100;i++){
		F[i]=F[i-1]+F[i-2];
	}



	for(int i =0;i<M;i++){
		if(i==0){
			ans=F[a[0]];
			
		}else if(i=M-1){			
				ans=ans*F[N-a[M-1]];
				
		}else{
				ans=ans*F[a[i]-a[i-1]-1];
			}
		}
	}

	for(int i =1;i<M;i++){
		if(a[i]-a[i-1]==1) ans=0;
	}
	cout<<ans%1000000007;

	
}


Compiler output:
a.cc:42:9: error: expected unqualified-id before 'for'
   42 |         for(int i =1;i<M;i++){
      |         ^~~
a.cc:42:22: error: 'i' does not name a type
   42 |         for(int i =1;i<M;i++){
      |                      ^
a.cc:42:26: error: 'i' does not name a type
   42 |         for(int i =1;i<M;i++){
      |                          ^
a.cc:45:9: error: 'cout' does not name a type
   45 |         cout<<ans%1000000007;
      |         ^~~~
a.cc:48:1: error: expected declaration before '}' token
   48 | }
      | ^
Language: C++

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





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

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

	vector<int>F(101);
	F[0]=0;
	F[1]=1;
	F[2]=1;
	for(int i =3;i<100;i++){
		F[i]=F[i-1]+F[i-2];
	}



	for(int i =0;i<M;i++){
		if(i==0){
			ans=F[a[0]];
			
		}else if(i=M-1){			
				ans=ans*F[N-a[M-1]];
			}			
		}else{
				ans=ans*F[a[i]-a[i-1]-1];
			}
		}
	}

	for(int i =1;i<M;i++){
		if(a[i]-a[i-1]==1) ans=0;
	}
	cout<<ans%1000000007;

	
}


Compiler output:
a.cc: In function 'int main()':
a.cc:36:18: error: 'else' without a previous 'if'
   36 |                 }else{
      |                  ^~~~
a.cc:37:45: error: 'i' was not declared in this scope
   37 |                                 ans=ans*F[a[i]-a[i-1]-1];
      |                                             ^
a.cc: At global scope:
a.cc:40:9: error: expected declaration before '}' token
   40 |         }
      |         ^
a.cc:42:9: error: expected unqualified-id before 'for'
   42 |         for(int i =1;i<M;i++){
      |         ^~~
a.cc:42:22: error: 'i' does not name a type
   42 |         for(int i =1;i<M;i++){
      |                      ^
a.cc:42:26: error: 'i' does not name a type
   42 |         for(int i =1;i<M;i++){
      |                          ^
a.cc:45:9: error: 'cout' does not name a type
   45 |         cout<<ans%1000000007;
      |         ^~~~
a.cc:48:1: error: expected declaration before '}' token
   48 | }
      | ^
Language: C++

#include<iostream>
using namespace std;

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


int main(){
  long int n,m,a,b; cin>>n>>m;
  long int a[m];
  long long int s=1;
  
 
  for(int j=0;j<m+1;j++){
    long int k;
    b=a;
    if(j!=m)cin>>a;
    
    if(j==0){
      k=a-1;
      if(k<1) k=1;
    }
    else if(j==m){
      k=n-b-1;
      if(k<1) k-1;
    }
    else {
      k=a-b-2;
      if(k<0){
        cout<<0<<endl;
        return 0;
      }
    }
    
    
    s = s*ss(k)%1000000007;
  }
  
  cout<<s<<endl;
  return 0;
}
    

Compiler output:
a.cc: In function 'int main()':
a.cc:13:12: error: conflicting declaration 'long int a [m]'
   13 |   long int a[m];
      |            ^
a.cc:12:16: note: previous declaration as 'long int a'
   12 |   long int n,m,a,b; cin>>n>>m;
      |                ^
Language: C++

#include <bits/stdc++.h>
#define rep(i,a,b) for (long long i = (a); i < (b); i++)
#define REP(i,n) rep(i,0,n)
using namespace std;

int n,m;
vector <int>a(1000010,0);
vector<int>done(1000010,0);
vector<int>flag(1000010,0);
void dfs(int k)
{
    flag.at(k)=1;
    if(a.at(k)==1)return;
    if(k==n){a.at(n)=1;return;}
    if(k>n)return;
    if(flag.at(k+1)==0)dfs(k+1);
    if(flag.at(k+2)==0)dfs(k+2);
    if(done.at(k)>=1000000007)done.at(k)%=1000000007;
    done.at(k)=done.at(k+1)+done.at(k+2)
}

int main()
{
    cin>>n>>m;
    REP(i,m)
    {
        int x;
        cin>>x;
        a.at(x)=1;
    }
    dfs(0);
    cout<<done.at(0)<<endl;
}


Compiler output:
a.cc: In function 'void dfs(int)':
a.cc:19:41: error: expected ';' before '}' token
   19 |     done.at(k)=done.at(k+1)+done.at(k+2)
      |                                         ^
      |                                         ;
   20 | }
      | ~
Language: C++

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

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

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

Compiler output:
a.cc:4:9: error: 'n' was not declared in this scope; did you mean 'yn'?
    4 | int fib(n) {
      |         ^
      |         yn
a.cc: In function 'int main()':
a.cc:23:13: error: 'fib' cannot be used as a function
   23 |     r *= fib(a[i] - a[i-1] - 1);
      |          ~~~^~~~~~~~~~~~~~~~~~~
Language: C++

#include <iostream>
#include<vector>
using namespace std;
int counter = 0;

int vector_finder(vector<int> vec, int number) {
	auto itr = find(vec.begin(), vec.end(), number);
	size_t index = distance(vec.begin(), itr);
	if (index != vec.size()) {
		return 1;
	}
	else {
		return 0;
	}
}

	int re(int N, int step, vector<int> a) {
		if(!vector_finder(a, step + 1) && step + 1 < N)re(N, step + 1, a);
		if(!vector_finder(a, step + 2) && step + 2 < N)re(N, step + 2, a);
		if (step == N - 1)counter++;
		return counter;
	}

int main(void) {
	int N, M;
	cin >> N >> M;
	vector<int>a = vector<int>(M);
	for (int i = 0; i < M; i++)cin >> a[i];
	const long long int MAX = 1000000007;

	int step = 0;
	counter = re(N, step, a);

	cout << counter % MAX << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int vector_finder(std::vector<int>, int)':
a.cc:7:24: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, int&)'
    7 |         auto itr = find(vec.begin(), vec.end(), number);
      |                    ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/locale_facets.h:48,
                 from /usr/include/c++/14/bits/basic_ios.h:37,
                 from /usr/include/c++/14/ios:46,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
  435 |     find(istreambuf_iterator<_CharT> __first,
      |     ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note:   template argument deduction/substitution failed:
a.cc:7:24: note:   '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'std::istreambuf_iterator<_CharT>'
    7 |         auto itr = find(vec.begin(), vec.end(), number);
      |                    ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

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

int fibonacci(int n)  
{
        return fibonacci(n-1)+fibonacci(n-2);
}  

int main(){
	int c[100000];
	int sum = 0;
	int a,b;
	cin >> a >> b;
	for(int i = 0;i<b;i++){
		cin >> c[i];
		fibonacci(c[i]+1) = 0;
	}
	cout << fibonacci(a);
	return 0;
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:16:26: error: lvalue required as left operand of assignment
   16 |                 fibonacci(c[i]+1) = 0;
      |                 ~~~~~~~~~^~~~~~~~
Language: C++

#include <iostream>
#include <vector>
#include <queue>
#include <map>
#include <algorithm>
#include <limits.h>

#define ll long long

using namespace std;

int main(){

    int n,m;
    cin >> n >> m;

    vector<int> broken(100001,0);

    int before = -1;
    bool cut = false;


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

        if(before != -1){
            if(tmp - before == 1){
                cut = true;
                break;
            }
        }

        before = tmp;
    }

    if(!cut){

    vector<int> dp(100001,0);
    vector<int> dp(100001);
    
    
    dp[0] = 1;

    for(int i = 0; i < n; i++){
        for(int j = 0; j <= n; j++){
            dp2[j] = dp[j];
        }

        for(int j = i + 1; j <= n; j++){
            if(broken[j] != 1){
                if(j == 1){
                    dp[1] = dp2[0];
                }else{
                    dp[j] = (dp2[j - 1] + dp2[j - 2]) % 1000000007;
                }
            }
        }
    }
    

    cout << dp[n] << endl;

    }else{
        cout << 0 << endl;
    }

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:41:17: error: redeclaration of 'std::vector<int> dp'
   41 |     vector<int> dp(100001);
      |                 ^~
a.cc:40:17: note: 'std::vector<int> dp' previously declared here
   40 |     vector<int> dp(100001,0);
      |                 ^~
a.cc:48:13: error: 'dp2' was not declared in this scope; did you mean 'dp'?
   48 |             dp2[j] = dp[j];
      |             ^~~
      |             dp
a.cc:54:29: error: 'dp2' was not declared in this scope; did you mean 'dp'?
   54 |                     dp[1] = dp2[0];
      |                             ^~~
      |                             dp
a.cc:56:30: error: 'dp2' was not declared in this scope; did you mean 'dp'?
   56 |                     dp[j] = (dp2[j - 1] + dp2[j - 2]) % 1000000007;
      |                              ^~~
      |                              dp
Language: C++

#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
typedef long long int ll;
int main(void) {
	int n, m, a, b=-10; cin >> n >> m;
	bool t = true;
	ll ans = 0;
	for (int i = 0; i < m; i++){
		cin >> a;
		if (b + 1 == a) {
			t = false; break;
		}
		b = a;
	}
	if (t) {
		ll s=pow(2,(n-2*m)/2);
		ans = s % 1000000007;
	}
	cout << ans << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:22: error: 'pow' was not declared in this scope
   18 |                 ll s=pow(2,(n-2*m)/2);
      |                      ^~~
Language: Java

import java.util.*;

class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int M = sc.nextInt();

    int now = 0;
    int before = 0;
    int total = 1;
    for(int i=1; i < M+1; i++){
    	now = sc.nextInt();
      	total *= howmany(now, before);
      	total %= 1000000007;
      	before = now;
    }
    total *= howmany(N, before);
    total %= 1000000007;
    System.out.println(total);
    
  }
  
  private static int howmany(int now, int before){
    int diff = now - before;
    if(diff == 1){
      return 0;
    }else{
      return fibonacchi(diff-1);
    }
    
  }
  private static int fibonacchi(int n){
    return n <= 2 ? 1 : fibonacci(n - 1) + fibonacci(n - 2);
  }
}

Compiler output:
Main.java:34: error: cannot find symbol
    return n <= 2 ? 1 : fibonacci(n - 1) + fibonacci(n - 2);
                        ^
  symbol:   method fibonacci(int)
  location: class Main
Main.java:34: error: cannot find symbol
    return n <= 2 ? 1 : fibonacci(n - 1) + fibonacci(n - 2);
                                           ^
  symbol:   method fibonacci(int)
  location: class Main
2 errors
Language: C++

#include <functional>
#include <iostream>
#include<stdio.h>
#include<algorithm>
#include<vector>
#include <numeric>
#include<string>
using ll = long long;
using namespace std;
# define maxn 100001 
# define maxm 100001

int main() {
  int n,m,a[maxn]={0};
  ll p[maxn]={0};
  cin>>n>>m;
  for (int i(0);i<m;i++){
    int ai;
    cin>>ai;
    a[ai]=1; // a[i]が１の時は子晴れている
  }
  //for (int i(1);i<=n;i++)cout <<a[i]<<endl;
  if (n==1){
    cout << 1;
    return 0;
  }else if(n==2){
    int ans= (a[1]==1)? 1:2;
    cout <<ans
    return 0;
  }
  if (a[1]==1&&a[2]==1){
    cout << 0;
    return 0;
  }else if(a[1]==1){
    p[1]=0;
    p[2]=1;
  }else if (a[2]==1){
    p[1]=1;
    p[2]=0;
  }else{
    p[1]=1;
    p[2]=2;
  }
  for (int i(3);i<=n;i++){
    if (a[i]==1) continue;
    if (a[i-1]==1&&a[i-2]==1){
      cout << 0;
      return 0;
    }else if (a[i-1]==1){
      p[i]=p[i-2]; 
    }else if (a[i-2]==1){
      p[i]=p[i-1]; 
    }else{
      p[i]=p[i-1]+p[i-2];
    }
  }
//  for (int i(1);i<=n;i++)cout <<p[i]<<endl;
  cout << p[n]%1000000007;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:28:15: error: expected ';' before 'return'
   28 |     cout <<ans
      |               ^
      |               ;
   29 |     return 0;
      |     ~~~~~~
Language: C

#include<bits/stdc++.h>
#include<math.h>
#include<string>
using namespace std;
std::vector<bool> stiustir;
std::vector<long long> recordstepstir;
int N = 0;
void search(int now){
	long long step =0;
	if(stiustir[now] == false){
		recordstepstir[now] = 0;
		search(now-1);
		return;
	}
	if(now>0&&now<=N-2){
		step += recordstepstir[now+2];
		step += recordstepstir[now+1];
		recordstepstir[now] = step%1000000007;
		search(now-1);
	}else if(now==N-1){
		recordstepstir[now] = 1;
		search(now-1);
		return;
	}else if(now == 0){
		step += recordstepstir[now+2];
		step += recordstepstir[now+1];
		recordstepstir[now] = step%1000000007;
		cout << (step%1000000007);
		return;
	}
	return;
}
int main(void){
	int i,j,k,M;
	cin >> N >> M;
	int a[M];
	for(i=0;i<M;i++){
		cin >> a[i];
	}
	for(i=0;i<N;i++){
		stiustir.push_back(true);
		recordstepstir.push_back(0);
	}
	recordstepstir.push_back(1);
	stiustir.push_back(true);
	for(i=0;i<M;i++){
		stiustir[a[i]] = false;
	}
	search(N-1);
	return 0;
}

Compiler output:
main.c:1:9: fatal error: bits/stdc++.h: No such file or directory
    1 | #include<bits/stdc++.h>
      |         ^~~~~~~~~~~~~~~
compilation terminated.
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++)

int fib(int 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 = 0;
   cin >> N >> M;
   FOR(i,0,M){
       cin >> int a;
       int b = a - pre;
       c += fib(a);   
       pre = a;
   }
   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:23:15: error: expected primary-expression before 'int'
   23 |        cin >> int a;
      |               ^~~
a.cc:24:16: error: 'a' was not declared in this scope
   24 |        int b = a - pre;
      |                ^
Language: C++

#include <bits/stdc++.h>
#define INF 1e9
#define ALL(v) v.begin(), v.end()
#define REP(i, n) for(int i = 0; i < n; i++)
#define max(v) *max_element(v.begin(), v.end())
#define min(v) *min_element(v.begin(), v.end())
using namespace std;
 
int main(void){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n, m;
    cin>>n>>m;
    int s;
    int a[m];
    REP(i,m){
        cin>>s;
        a[i] = s;
    }
    unsigned long long dp[100100] = {0};
    int key;
    dp[0] = 1;
    for(int i = 1; i < n+1; i++){
        if(i == 1 and a[0] != 1){
            dp[1] += 1;
        }
        else{
            key = 0;
            for(int j = tmp; j < m; j++){
                if(i == a[j]){
                    key = 1;
                    tmp = j;
                    break;
                }
            }
            if(key == 0){
                dp[i] += dp[i-1];
                dp[i] += dp[i-2];
                dp[i] %= 1000000007;
            }
        }
    }
    /*
    REP(i, n+1){
        cout<<i<<dp[i]<<endl;
    }
    */
    cout<<dp[n]%1000000007<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:25: error: 'tmp' was not declared in this scope; did you mean 'tm'?
   29 |             for(int j = tmp; j < m; j++){
      |                         ^~~
      |                         tm
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++)

int fib(int 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 = 0;
   cin >> N >> M;
   FOR(i,0,M){
       int a = i - pre;
       c += fib(a);   
       pre = i;
   }
   cout << c % 1000000007 <<endl;
}



Compiler output:
a.cc: In function 'int fib(int)':
a.cc:13:9: error: 'N' was not declared in this scope
   13 |     if (N == 0 || n == 1){return 1;}
      |         ^
a.cc: At global scope:
a.cc:17:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   17 | main(){
      | ^~~~
a.cc: In function 'int fib(int)':
a.cc:15:1: warning: control reaches end of non-void function [-Wreturn-type]
   15 | }
      | ^
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++)

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

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



Compiler output:
a.cc: In function 'int fib(int)':
a.cc:13:9: error: 'N' was not declared in this scope
   13 |     if (N == 0 || n == 1){return 1;}
      |         ^
a.cc: At global scope:
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:20:16: error: conflicting declaration 'int c'
   20 |    int pre = 0,c = 0;
      |                ^
a.cc:19:14: note: previous declaration as 'long long int c'
   19 |    long long c;
      |              ^
a.cc: In function 'int fib(int)':
a.cc:15:1: warning: control reaches end of non-void function [-Wreturn-type]
   15 | }
      | ^
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++)

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

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



Compiler output:
a.cc: In function 'int fib(int)':
a.cc:13:9: error: 'N' was not declared in this scope
   13 |     if (N == 0 || n == 1){return 1;}
      |         ^
a.cc: At global scope:
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:20:16: error: conflicting declaration 'int c'
   20 |    int pre = 0,c = 0;
      |                ^
a.cc:19:14: note: previous declaration as 'long long int c'
   19 |    long long c;
      |              ^
a.cc:25:15: error: expected ';' before '}' token
   25 |        pre = i
      |               ^
      |               ;
   26 |    }
      |    ~           
a.cc: In function 'int fib(int)':
a.cc:15:1: warning: control reaches end of non-void function [-Wreturn-type]
   15 | }
      | ^
Language: C++

#include <iostream>
#include<vector>
#include<queue>
#include<algorithm>
#include<string>

#define REP(i,n) for(int i=0;i<n;i++)

using namespace std;

long mem[100000];

long fib(long i) {
    if(mem[i] != -1) return mem[i];
    if(i==0 || i == 1) return 1;
    return mem[i] = fib(i-1) + fib(i-2);
}

int main() {
    long n,m;
    cin >>n>>m;
    vector<long> v(m+2);
    long res =1;
    int flag = 0;
    v[0] = 0;
    memset(mem, -1, sizeof(mem));
    for(long i=0; i<m;i++){
        cin >> v[i+1];
        if(v[i+1] != 1) {
            if(v[i+1] -v[i]== 1) {
                flag =1;
                break;
            }
        }

        if(i == 0) res *= fib(v[i+1]-1);
        else res *= fib(v[i+1]-1 - v[i]-1);
    }

    if(flag == 1) cout << 0 << endl;
    else cout << (res*fib(n-v[m]-1))%1000000007 <<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:5: error: 'memset' was not declared in this scope
   26 |     memset(mem, -1, sizeof(mem));
      |     ^~~~~~
a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    4 | #include<algorithm>
  +++ |+#include <cstring>
    5 | #include<string>
Language: C++

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





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

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





	for(int i =0;i<M;i++){
		if(i==0){
			if(a[0]<3){
				ans=1;
			}else{
				ans=(a[0]-1)
			}
			
		}else if(i=M-1){
			if(N-a[M-1]<3){
				
			}else{
				ans=ans*(N-a[M-1]-1);
			}
			
		}else{
			if(a[i]-a[i-1]-1<3){

			}else{
				ans=ans*(a[i]-a[i-1]-2);
			}
		}
	}

	cout<<ans%1000000007;

	
}


Compiler output:
a.cc: In function 'int main()':
a.cc:28:45: error: expected ';' before '}' token
   28 |                                 ans=(a[0]-1)
      |                                             ^
      |                                             ;
   29 |                         }
      |                         ~
Language: C++

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





int main(){
	int N,M;
	
	cin>>N>>M;
	double ans=0;
	vector<int>a(M+1);

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





	for(int i =0;i<M;i++){
		if(i==0){
			if(a[0]<3){
				ans=1;
			}else{
				ans=(a[0]-1)
			}
			
		}else if(i=M-1){
			if(N-a[M-1]<3){
				
			}else{
				ans=ans*(N-a[M-1]-1);
			}
			
		}else{
			if(a[i]-a[i-1]-1<3){

			}else{
				ans=ans*(a[i]-a[i-1]-2);
			}
		}
	}

	cout<<ans%1000000007;

	
}


Compiler output:
a.cc: In function 'int main()':
a.cc:28:45: error: expected ';' before '}' token
   28 |                                 ans=(a[0]-1)
      |                                             ^
      |                                             ;
   29 |                         }
      |                         ~                    
a.cc:47:18: error: invalid operands of types 'double' and 'int' to binary 'operator%'
   47 |         cout<<ans%1000000007;
      |               ~~~^~~~~~~~~~~
      |               |   |
      |               |   int
      |               double
Language: C++

#include <iostream>
using namespace std;

long long long dp[100000];
int goal;

long long solve(int step) {
    if (step == goal) {
        return 1;
    } else if (step > goal || dp[step] < 0) {
        return 0;
    } else if (dp[step] > 0) {
        return dp[step];
    }

    return dp[step] = solve(step + 1) + solve(step + 2);
}

int main() {

    int n, m;
    cin >> n >> m;

    goal = n;

    for (int i = 0; i < m; ++i) {
        int step;
        cin >> step;

        dp[step] = -1;
    }

    solve(0);

    cout << dp[0] % 1000000007 << endl;

    return 0;
}

Compiler output:
a.cc:4:11: error: 'long long long' is too long for GCC
    4 | long long long dp[100000];
      |           ^~~~
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <cstdio>

#define INF 1000000

using namespace std;

unsigned int memo[100001];
unsigned int memb[100000];
int length = 0;

void bfib(int n) {
	bool bf = false;
	for (int i = 0; i < length; ++i) {
		if (memb[i] == 1) {
			bf = true;
		}
		if (memb[i] == n) {
			memo[n] = 0;
			return;
		}
	}
	if (n == 1) {
		memo[n] = 1;
		return;
	}
	if (n == 2) {
		if (bf == true) {
			memo[n] = 1;
		}
		else {
			memo[n] = 2;
		}
		return;
	}
	else {
		memo[n] = (memo[n - 1] + memo[n - 2]) % 1000000007;
		return;
	}
}

int main(void)
{
	int n, nb, buf;
	n = nb = buf = 0;
	scanf_s("%d %d", &n, &nb);
	length = nb;
	for (int i = 0; i < nb; ++i) {
		scanf_s("%d", &buf);
		memb[i] = buf;
	}
	for (int i = 0; i <= n; ++i) {
		bfib(i);
	}
	cout << memo[n];

	return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:48:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   48 |         scanf_s("%d %d", &n, &nb);
      |         ^~~~~~~
      |         scanf
Language: C++

matrix_2x2[2] + result_matrix_2x2[3];
}


int main() {
  int n, m;
  long long int answer = 1;
  cin >> n >> m;
  int bef = -1;
  for (int i = 0; i < m; ++i) {
    int cur;
    cin >> cur;
    int time = cur - bef;
    bef = cur;
    if (time == 1) {
      cout << 0 << endl;
      return 0;
    }
    answer *= calculate_fibonacci(time-2);
    answer %= 1000000007;
  }
  int time = n - bef+1;
  answer *= calculate_fibonacci(time-2);
  answer %= 1000000007;
  cout << answer << endl;
}


Compiler output:
a.cc:1:1: error: 'matrix_2x2' does not name a type
    1 | matrix_2x2[2] + result_matrix_2x2[3];
      | ^~~~~~~~~~
a.cc:2:1: error: expected declaration before '}' token
    2 | }
      | ^
a.cc: In function 'int main()':
a.cc:8:3: error: 'cin' was not declared in this scope
    8 |   cin >> n >> m;
      |   ^~~
a.cc:16:7: error: 'cout' was not declared in this scope
   16 |       cout << 0 << endl;
      |       ^~~~
a.cc:16:20: error: 'endl' was not declared in this scope
   16 |       cout << 0 << endl;
      |                    ^~~~
a.cc:19:15: error: 'calculate_fibonacci' was not declared in this scope
   19 |     answer *= calculate_fibonacci(time-2);
      |               ^~~~~~~~~~~~~~~~~~~
a.cc:23:13: error: 'calculate_fibonacci' was not declared in this scope
   23 |   answer *= calculate_fibonacci(time-2);
      |             ^~~~~~~~~~~~~~~~~~~
a.cc:25:3: error: 'cout' was not declared in this scope
   25 |   cout << answer << endl;
      |   ^~~~
a.cc:25:21: error: 'endl' was not declared in this scope
   25 |   cout << answer << endl;
      |                     ^~~~