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

#include <bits/stdc++.h>
using namespace std;
 
int mul(int x)
{
int y= 1;
for(int i=0;i<x;i++){
 y*= x-i;
}
return y;
}
 
int main(){
 int n,m;
  int64_t ans=1;
  cin>>n>>m;
 
  vector<int>a(m);
for(int i=0 ;i<m;i++){
  cin>>a.at(i);
  }
  
  vector<int>b(m+1);
  for(int i=0 ;i<=m;i++){
  if(i==0)
    b.at(0)=a.at(0);
    else if(i==m)
      b.at(m)=n-a.at(m-1);
    else
    b.at(i)=a.at(i)-a.at(i-1)-1;
    
    if(b.at(i)==0)
      ans*=0;
    else if(b.at(i)==1)
      ans*=1;
    else if(b.at(i)==2)
      ans*=1;
    else if(b.at(i)%2==0&&b.at(i)!=0&&b.at(i)!=2){//偶数
  int g=1;
      int t=b.at(i)/2 -1;
      int o=1;
       while(t>0){
      g+=mul(t+o)/mul(t)/mul(o);
      t--;
        o+=2;
      }
       ans*=g;
      ans=ans%1000000007;
  }
     else if(b.at(i)%2==1&&b.at(i)!=1){//奇数
  int g=1;
       int t=(b.at(i)-1)/2 ;
       int o=0;
      while(t>0){
      g+=mul(t+o)/mul(t)/mul(o);
      t--;
        o+=2;a
      }
       ans*=g;
       ans=ans%1000000007;
     }
  }
  cout<<ans%1000000007<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:57:15: error: expected ';' before '}' token
   57 |         o+=2;a
      |               ^
      |               ;
   58 |       }
      |       ~
Language: C++

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

int main(){
  int N,M;
  cin>>N>>M;
  
  vector<int>oks(N+1,true);

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

  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;
   return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'cin' was not declared in this scope
    7 |   cin>>N>>M;
      |   ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | //#include<bits/stdc++.h>
a.cc:9:3: error: 'vector' was not declared in this scope
    9 |   vector<int>oks(N+1,true);
      |   ^~~~~~
a.cc:1:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
  +++ |+#include <vector>
    1 | //#include<bits/stdc++.h>
a.cc:9:10: error: expected primary-expression before 'int'
    9 |   vector<int>oks(N+1,true);
      |          ^~~
a.cc:13:5: error: 'oks' was not declared in this scope
   13 |     oks[a]=false;
      |     ^~~
a.cc:15:10: error: expected primary-expression before 'long'
   15 |   vector<long long int>dp(N+1);
      |          ^~~~
a.cc:16:3: error: 'dp' was not declared in this scope
   16 |   dp[0]=1;
      |   ^~
a.cc:19:30: error: 'min' was not declared in this scope; did you mean 'main'?
   19 |     for(int next=now+1;next<=min(N,now+2);++next){
      |                              ^~~
      |                              main
a.cc:20:10: error: 'oks' was not declared in this scope
   20 |       if(oks[next]){
      |          ^~~
a.cc:26:4: error: 'cout' was not declared in this scope
   26 |    cout<<dp[N]<<endl;
      |    ^~~~
a.cc:26:4: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:26:17: error: 'endl' was not declared in this scope
   26 |    cout<<dp[N]<<endl;
      |                 ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | //#include<bits/stdc++.h>
Language: C

#include<stdio.h>

int main(){

    long int ans = 1;

    int N, M;
    scanf("%d%d", &N, &M);

    int a[M+2];

    a[0] = -1;
    a[M + 1] = N+1;

    for (int i = 1; i < M+1; i++){

        scanf("%d", &a[i]);

        if(a[i] == a[i-1]+1){
            ans = 0;
            break;
        }
    }

    if(ans == 1){

        long int pattern[N+1];

        pattern[0] = 1;
        pattern[1] = 1;
        pattern[2] = 2;

        for (int i = 3; i < N+1; i++){
            pattern[i] = pattern[i - 1] + pattern[i - 2];
        }

        for (int i = 1; i < M+2; i++){

            ans = (ans * pattern[a[i] - a[i - 1] - 2]) % 1000000007;
    }

    printf("%ld", ans);

    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:45:1: error: expected declaration or statement at end of input
   45 | }
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int mul(int x)
{
int y= 1;
for(int i=0;i<x;i++){
 y*= x-i;
}
return y;
}
 
int main(){
 int n,m;
  int64_t ans=1;
  cin>>n>>m;
 
  vector<int>a(m);
for(int i=0 ;i<m;i++){
  cin>>a.at(i);
  }
  
  vector<int>b(m+1);
  for(int i=0 ;i<=m;i++){
  if(i==0)
    b.at(0)=a.at(0);
    else if(i==m)
      b.at(m)=n-a.at(m-1);
    else
    b.at(i)=a.at(i)-a.at(i-1)-1;
    
    if(b.at(i)==0)
      ans*=0;
    else if(b.at(i)==1)
      ans*=1;
    else if(b.at(i)==2)
      ans*=1;
    else if(b.at(i)%2==0&&b.at(i)!=0&&b.at(i)!=2){//偶数
  int g=1;
      int t=b.at(i)/2 -1;
      int o=1;
       while(t>0){
      g+=mul(t+o)/mul(t)/mul(o);
      t--;
        o+=2;
      }
       ans*=g%1000000007;
  }
     else if(b.at(i)%2==1&&b.at(i)!=1){//奇数
  int g=1;
       int t=(b.at(i)-1)/2 ;
       int o=0;
      while(t>0){
      g+=mul(t+o)/mul(t)/mul(o);
      t--;
        o+=2;a
      }
       ans*=g%1000000007;
     }
  }
  cout<<ans%1000000007<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:56:15: error: expected ';' before '}' token
   56 |         o+=2;a
      |               ^
      |               ;
   57 |       }
      |       ~
Language: C++

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

int main() {
    long x=1000000007;
    long n,m;cin>>n>>m;
    vector<long> a(m);
    long sum=0;
    for(long i=0;i<m;i++){
        cin>>a.at(i);
    }
    vector<long> p(n+1);
    p.at(0)=1;
    p.at(1)=1;
    long ai=0;
    if(a.at(0)==1){
        p.at(1)=0;
        ai++;
    }
    for(long i=2;i<n+1;i++){
        if(a.at(min(ai,min(m-1,0)))==i){
            p.at(i)=0;
            ai++;
        }
        else{
            p.at(i)=(p.at(i-2)+p.at(i-1))%x;
        }
    }    
    cout<<p.at(n)<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:27: error: no matching function for call to 'min(long int, int)'
   21 |         if(a.at(min(ai,min(m-1,0)))==i){
      |                        ~~~^~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:21:27: note:   deduced conflicting types for parameter 'const _Tp' ('long int' and 'int')
   21 |         if(a.at(min(ai,min(m-1,0)))==i){
      |                        ~~~^~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:21:27: note:   mismatched types 'std::initializer_list<_Tp>' and 'long int'
   21 |         if(a.at(min(ai,min(m-1,0)))==i){
      |                        ~~~^~~~~~~
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), t(N), d(M + 1);
	for(int i = 0; i < M; ++i) {
		cin >> s[i];
	}
	t[0] = 1;
	t[1] = 1;	
	if(M == 0) {
		for(int i = 2; i < N; ++i) {
			t[i] = t[i - 1] + t[i - 2];
			t[i] = t[i] % 1000000007;
		}
		cout << t[N - 1] % 1000000007 << endl;
	} else { 
		d[0] = s[0] - 1;
		if(M >= 2) {
			for(int i = 1; i < M; ++i) {
				d[i] = s[i] - s[i -1];
			}
		}
		d[M] = N - s[M - 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 long int sum = 1;
			for(int i = 1; i < M; ++i) {
				sum = sum * t[d[i] - 2];
				//cout << t[d[i] - 2] << endl;
				sum = sum % 1000000007;
			}
			sum = sum * t[d[0]] * t[d[M] - 1];
			cout << sum % 1000000007 << endl;
		}
	}
}
	


Compiler output:
a.cc: In function 'int main()':
a.cc:40:35: error: 'long long long' is too long for GCC
   40 |                         long long long int sum = 1;
      |                                   ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  int n,m;
  cin >> n >> m;
  if(m==0){
    vector<int> a(1);
  }else{
    vector<int> a(m);
  }
  int i;
  for(i=0;i<m;i++){
    cin >> a[i];
  }

  long ans;
  vector<long> b(n+1);
  b[0] = 1;
  if(a[0] == 1){
    b[1] = 0;
  }else{b[1] = 1;}
    int j =0;
  while(j != m && a[j] == 1)j++;
  for(i=2;i<n+1;i++){
    while(j != m && a[j] == a[j+1])j++;
    if(i ==a[j]){
      b[i] = 0;
      if(j!=m)
        j++;
    }else{
      b[i] = b[i-1] + b[i-2];
    }
    if(b[i] > 1000000007)b[i] %= 1000000007;
  }
  cout << b[n] << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:12: error: 'a' was not declared in this scope
   13 |     cin >> a[i];
      |            ^
a.cc:19:6: error: 'a' was not declared in this scope
   19 |   if(a[0] == 1){
      |      ^
a.cc:23:19: error: 'a' was not declared in this scope
   23 |   while(j != m && a[j] == 1)j++;
      |                   ^
a.cc:25:21: error: 'a' was not declared in this scope
   25 |     while(j != m && a[j] == a[j+1])j++;
      |                     ^
a.cc:26:12: error: 'a' was not declared in this scope
   26 |     if(i ==a[j]){
      |            ^
Language: C++

#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0;i < n;i++)
#define rev(i, n) for(int i = n;i >= 0;i--)
#define Rep(i, m, n) for(int i = m;i < n;i++)
#define repeatrev(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define ll long long
#define pb(a) push_back(a)
#define INF 999999999
#define itn int

using namespace std;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;
typedef priority_queue<int> Pr;

int dy[]={0, 0, 1, -1, 0};
int dx[]={1, -1, 0, 0, 0};

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    ll int n, m;
    cin >> n >> m;
    ll int a[m];
    rep(i, m) cin >> a[i];
    ll int dp[n + 1];
    memset(dp, -1, sizeof(dp));
    rep(i, m){
        dp[a[i]] = -2;
    }
    dp[0] = 1;
    if(dp[1] != -2) dp[1] = 1;
	int a;
    rep(i, n - 1){
        if(dp[i + 2] == -1 && dp[i] != -2 && dp[i + 1] != -2){
            dp[i + 2] = dp[i + 1] + dp[i];
        }
        else if(dp[i + 2] == -1 && dp[i] == -2 && dp[i + 1] !=  -2){
            dp[i + 2] = dp[i + 1];
        }
        else if(dp[i + 2] == -1 && dp[i] != -2 && dp[i + 1] == -2){
            dp[i + 2] = dp[i];
        }
        else if(dp[i + 1] == -2 && dp[i] == -2) dp[i + 2] = -2;
      else a = 1;
      dp[i] %= 1000000007;

    }
    if(dp[n] == -1) cout << 0 << endl;
    if(dp[n] == -2) cout << 0 << endl;
     else cout << dp[n] % 1000000007 << endl;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:37:13: error: conflicting declaration 'int a'
   37 |         int a;
      |             ^
a.cc:28:12: note: previous declaration as 'long long int a [m]'
   28 |     ll int a[m];
      |            ^
a.cc:49:14: error: incompatible types in assignment of 'int' to 'long long int [m]'
   49 |       else a = 1;
      |            ~~^~~
Language: C++

#include <iostream>

using namespace std;

int main()
{
  size_t n, m;
  cin >> n >> m;
  
  n += 1;
  vector<size_t> holes(m);
  for(size_t i = m-1; i >= 0; --i)
    cin >> holes[i];
  
  size_t section = 0;
  unsigned long long result = 1;
  vector<unsigned long long> steps(n);
  for(size_t i = 0; i < n; ++ i)
  {
    if(holes[holes.size()-1] == i)
    {
      holes.pop_back();        
      steps[i] = 0;
      result *= steps[i-1] % (unsigned long long)1000000007;
      
      if(!result)
        break;
        
      continue;
    }
    
    if(i < 2 || !steps[i-1] || !steps[i-2])
    {
    	steps[i] = 1;
      	continue;
    }
    
    steps[i] = steps[i-1] + steps[i-2];
  }
  result *= steps[steps.size() - 1] % (unsigned long long)1000000007;
  cout << result << endl;
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:3: error: 'vector' was not declared in this scope
   11 |   vector<size_t> holes(m);
      |   ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | 
a.cc:11:16: error: expected primary-expression before '>' token
   11 |   vector<size_t> holes(m);
      |                ^
a.cc:11:18: error: 'holes' was not declared in this scope
   11 |   vector<size_t> holes(m);
      |                  ^~~~~
a.cc:17:10: error: expected primary-expression before 'unsigned'
   17 |   vector<unsigned long long> steps(n);
      |          ^~~~~~~~
a.cc:23:7: error: 'steps' was not declared in this scope
   23 |       steps[i] = 0;
      |       ^~~~~
a.cc:32:18: error: 'steps' was not declared in this scope
   32 |     if(i < 2 || !steps[i-1] || !steps[i-2])
      |                  ^~~~~
a.cc:38:5: error: 'steps' was not declared in this scope
   38 |     steps[i] = steps[i-1] + steps[i-2];
      |     ^~~~~
a.cc:40:13: error: 'steps' was not declared in this scope
   40 |   result *= steps[steps.size() - 1] % (unsigned long long)1000000007;
      |             ^~~~~
Language: C++

#include <bits/stdc++.h>
#define vin vector<long long>
#define vch vector<char>
#define vst vector<string>
#define vbo vector<bool>
#define vvin vector<vin>
#define vvch vector<vch>
#define int long long
#define pin pair<int,int>
#define ppin pair<int,pin>
#define mkp make_pair
#define rep(i,n) for(int i=0;i<n;i++)
#define maxel(vec, j) *max_element(vec.begin(), vec.begin()+j)

using namespace std;
void mmin(int &a, int b) { a = min(a, b); }
void mmax(int &a, int b) { a = max(a, b); }
int vsum(vin v){ return accumulate(v.begin(), v.end(), 0); }
int msum(vvin v){
    int ans = 0;
    rep(i, v.size()){
        ans += vsum(v[i]);
    }
    return ans;
}
const int MOD = 1000000007;
signed main() {
    int N, M;
    cin >> N >> M;
    vector<bool> ok(n+1, true);
    rep(i, M)
        int a;
        cin >> a;
        ok[a] = false;
    }
 
    vin dp(n+1, 0);
    dp[0] = 1;
    rep(i, N+1){
        // 1つ下から
        if(ok[i-1]){
            dp[i] += dp[i-1];
            dp[i] %= MOD;
        }
        // 2つ下から
        if(i > 1 && ok[i-2]){
            dp[i] += dp[i-2];
            dp[i] %= MOD;
        }
    }
    cout << dp[N] << endl;
 
    return 0;
}
/*
 *
 *
6 1
3
 */


Compiler output:
a.cc: In function 'int main()':
a.cc:30:21: error: 'n' was not declared in this scope
   30 |     vector<bool> ok(n+1, true);
      |                     ^
a.cc:33:16: error: 'a' was not declared in this scope
   33 |         cin >> a;
      |                ^
a.cc: At global scope:
a.cc:37:12: error: 'n' was not declared in this scope; did you mean 'yn'?
   37 |     vin dp(n+1, 0);
      |            ^
      |            yn
a.cc:38:5: error: 'dp' does not name a type
   38 |     dp[0] = 1;
      |     ^~
a.cc:12:18: error: expected unqualified-id before 'for'
   12 | #define rep(i,n) for(int i=0;i<n;i++)
      |                  ^~~
a.cc:39:5: note: in expansion of macro 'rep'
   39 |     rep(i, N+1){
      |     ^~~
a.cc:39:9: error: 'i' does not name a type
   39 |     rep(i, N+1){
      |         ^
a.cc:12:30: note: in definition of macro 'rep'
   12 | #define rep(i,n) for(int i=0;i<n;i++)
      |                              ^
a.cc:39:9: error: 'i' does not name a type
   39 |     rep(i, N+1){
      |         ^
a.cc:12:34: note: in definition of macro 'rep'
   12 | #define rep(i,n) for(int i=0;i<n;i++)
      |                                  ^
a.cc:51:5: error: 'cout' does not name a type
   51 |     cout << dp[N] << endl;
      |     ^~~~
a.cc:53:5: error: expected unqualified-id before 'return'
   53 |     return 0;
      |     ^~~~~~
a.cc:54:1: error: expected declaration before '}' token
   54 | }
      | ^
Language: C++

#include <bits/stdc++.h>
#define vin vector<long long>
#define vch vector<char>
#define vst vector<string>
#define vbo vector<bool>
#define vvin vector<vel>
#define vvch vector<vech>
#define int long long
#define pin pair<int,int>
#define ppin pair<int,pin>
#define mkp make_pair
#define rep(i,n) for(int i=0;i<n;i++)
#define maxel(vec, j) *max_element(vec.begin(), vec.begin()+j)

using namespace std;
void mmin(int &a, int b) { a = min(a, b); }
void mmax(int &a, int b) { a = max(a, b); }
int vsum(vel v){ return accumulate(v.begin(), v.end(), 0); }
int msum(vvel v){
    int ans = 0;
    rep(i, v.size()){
        ans += vsum(v[i]);
    }
    return ans;
}
const int MOD = 1000000007;
signed main() {
    int N, M;
    cin >> N >> M;
    vector<bool> ok(n+1, true);
    rep(i, M)
        int a;
        cin >> a;
        ok[a] = false;
    }
 
    vin dp(n+1, 0);
    dp[0] = 1;
    rep(i, N+1){
        // 1つ下から
        if(ok[i-1]){
            dp[i] += dp[i-1];
            dp[i] %= MOD;
        }
        // 2つ下から
        if(i > 1 && ok[i-2]){
            dp[i] += dp[i-2];
            dp[i] %= MOD;
        }
    }
    cout << dp[N] << endl;
 
    return 0;
}
/*
 *
 *
6 1
3
 */


Compiler output:
a.cc:18:10: error: 'vel' was not declared in this scope
   18 | int vsum(vel v){ return accumulate(v.begin(), v.end(), 0); }
      |          ^~~
a.cc:19:10: error: 'vvel' was not declared in this scope
   19 | int msum(vvel v){
      |          ^~~~
a.cc: In function 'int main()':
a.cc:30:21: error: 'n' was not declared in this scope
   30 |     vector<bool> ok(n+1, true);
      |                     ^
a.cc:33:16: error: 'a' was not declared in this scope
   33 |         cin >> a;
      |                ^
a.cc: At global scope:
a.cc:37:12: error: 'n' was not declared in this scope; did you mean 'yn'?
   37 |     vin dp(n+1, 0);
      |            ^
      |            yn
a.cc:38:5: error: 'dp' does not name a type
   38 |     dp[0] = 1;
      |     ^~
a.cc:12:18: error: expected unqualified-id before 'for'
   12 | #define rep(i,n) for(int i=0;i<n;i++)
      |                  ^~~
a.cc:39:5: note: in expansion of macro 'rep'
   39 |     rep(i, N+1){
      |     ^~~
a.cc:39:9: error: 'i' does not name a type
   39 |     rep(i, N+1){
      |         ^
a.cc:12:30: note: in definition of macro 'rep'
   12 | #define rep(i,n) for(int i=0;i<n;i++)
      |                              ^
a.cc:39:9: error: 'i' does not name a type
   39 |     rep(i, N+1){
      |         ^
a.cc:12:34: note: in definition of macro 'rep'
   12 | #define rep(i,n) for(int i=0;i<n;i++)
      |                                  ^
a.cc:51:5: error: 'cout' does not name a type
   51 |     cout << dp[N] << endl;
      |     ^~~~
a.cc:53:5: error: expected unqualified-id before 'return'
   53 |     return 0;
      |     ^~~~~~
a.cc:54:1: error: expected declaration before '}' token
   54 | }
      | ^
Language: C++

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

int main() {
  int n,m;
  cin >> n >> m;
  vector<int> v(m);
  for(int i=0;i<m;i++){
    cin >> v[i];
  }
  
  //defining fibonacci sequence (though f(1)=1, f(2)=2) ok!
  
  vector<int> fib(n+1);
  for(int j=1;j<=n;j++){
    if(j==1){
      fib[j]=1;
    }
    else if(j==2){
      fib[j]=2;
    }
    else{
      fib[j]=fib[j-1]+fib[j-2];
    }
    
  }
  
  //defining the number of stairs
  
    vector<int> s(m+1);
    s[0]=v[0]-1;
    for(int k=1;k<m;k++){
      s[k]=v[k]-v[k-1]-2;
    }
    s[m]=v[m]-1;
    
    int ans=1;
    for(int l=0;l<m+1;l++){
      ans*=fib[s[l]]
      ans=ans%1000000007;
    }
  
  cout << ans%1000000007 << endl;    
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:39:21: error: expected ';' before 'ans'
   39 |       ans*=fib[s[l]]
      |                     ^
      |                     ;
   40 |       ans=ans%1000000007;
      |       ~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N, M;
  int floor = 0;
  int step2 = -1;
  int i, j = 0;
  bool out = false;
  int pattern = 0;
  int skip = -1;
  cin >> N >> M; 
  vector<int> vec(M);
  for (i = 0; i < M; i++) {
    cin >> vec.at(i);
  }
  /////////////////////
  for(i = -1;i < N;i++){
    for(j = 1;j < N;j++){
      if((i == skip) || (i == step2)){
        j++
      }
      for(int k = 0;k < N;k++){
        while(k < M){
          if(i == vec.at(k)){
            out = true;
            break;
          }
        }
        if(out){
          break;
        }
      }
      if(out != true){
        pattern++;
      }
      step2++;
    }
    skip++;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:12: error: expected ';' before '}' token
   21 |         j++
      |            ^
      |            ;
   22 |       }
      |       ~
Language: C++

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

using namespace std;
#define REP(i,n) FOR(i,0,n)
#define FOR(i,a,b) for(long long i=(a),i##Len_=(b);i<i##Len_;i++)
typedef unsigned long long ll;


int main()
{
    ll N,M,res;

    cin >> N >> M;

    ll tmp;

    vector <ll> koware(M + 2);
    vector <ll> kumi(N + 2);

    kumi[0] = 0;
    kumi[1] = 1;
    kumi[2] = 1;
    for(ll j = 3; j <= N + 1; j++)
    {
        kumi[j] = kumi[j-1] + kumi[j-2];
    }
    koware[0] = -1;

    for(ll j = 1; j <= M; j++)
    {
        cin >> koware[j];

    }
    koware[M+1] = N+1;

    res = 1;
    ll tmp;

    //1つめだけ別の解法
    
    for(ll j = 0; j <= M; j++)
    {
        res *= kumi[(koware[j+1] - koware[j] - 1)];

        if(res > 1000000007)
        {
            tmp = res / 1000000007;
            res -= 1000000007 * tmp;
        }
    }

    res = res % 1000000007;
    cout << res << endl;

}



Compiler output:
a.cc: In function 'int main()':
a.cc:40:8: error: redeclaration of 'll tmp'
   40 |     ll tmp;
      |        ^~~
a.cc:18:8: note: 'll tmp' previously declared here
   18 |     ll tmp;
      |        ^~~
Language: C++

#!/usr/bin/env python3
import sys
import bisect

MOD = 1000000007  # type: int

def is_ok(i,a):
    ii = bisect.bisect_left(a,i)
    if ii >= len(a):
        return True
    return i != a[ii]


def solve(N: int, M: int, a: "List[int]"):
    dp = [0]*N
    dp[0] = 1 if is_ok(1,a) else 0
    if is_ok(2,a):
        if is_ok(1,a):
            dp[1] = 2
        else:
            dp[1] = 1

    for i in range(2,N):
        if is_ok(i+1,a):
            dp[i] = dp[i-1] + dp[i-2]
            dp[i] %= MOD

    print(dp[N-1] % MOD)
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    M = int(next(tokens))  # type: int
    a = [ int(next(tokens)) for _ in range(M) ]  # type: "List[int]"
    solve(N, M, a)

if __name__ == '__main__':
    main()



Compiler output:
a.cc:1:2: error: invalid preprocessing directive #!
    1 | #!/usr/bin/env python3
      |  ^
a.cc:5:19: error: stray '#' in program
    5 | MOD = 1000000007  # type: int
      |                   ^
a.cc:32:3: error: invalid preprocessing directive #Generated
   32 | # Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
      |   ^~~~~~~~~
a.cc:39:28: error: stray '#' in program
   39 |     N = int(next(tokens))  # type: int
      |                            ^
a.cc:40:28: error: stray '#' in program
   40 |     M = int(next(tokens))  # type: int
      |                            ^
a.cc:41:50: error: stray '#' in program
   41 |     a = [ int(next(tokens)) for _ in range(M) ]  # type: "List[int]"
      |                                                  ^
a.cc:44:16: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes
   44 | if __name__ == '__main__':
      |                ^~~~~~~~~~
a.cc:2:1: error: 'import' does not name a type
    2 | import sys
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

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

int main() {
  int N;
  cin>>N;
  
 
  
  for (int k=0;k<N;i++) {
    for (int j=0;j<N;j++) {
      vector<string> S(N);
      int P[j];
      cin>>S[j]>>P[j];
    }
    int sum[k]=1;
    
    for (int i=0;i<N;i++) {
      for (int j=0;j<S[i].size();j++) {
        int x=S[k].at(j)-'0'+48;
        int a=S[i].at(j)-'0'+48;
      
        if (x-a>=0) {
          continue;
        }
        else {
          sum[k]++;
        }
      }
      
      if (S[k]=S[i] && P[k]<P[i]) {
        sum[k]++;
      }
      else {
        continue;
      }
          
    }
    cout<<sum[k]<<endl;
  }
    
    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:20: error: 'i' was not declared in this scope
   10 |   for (int k=0;k<N;i++) {
      |                    ^
a.cc:16:16: error: array must be initialized with a brace-enclosed initializer
   16 |     int sum[k]=1;
      |                ^
a.cc:19:22: error: 'S' was not declared in this scope
   19 |       for (int j=0;j<S[i].size();j++) {
      |                      ^
a.cc:31:11: error: 'S' was not declared in this scope
   31 |       if (S[k]=S[i] && P[k]<P[i]) {
      |           ^
a.cc:31:24: error: 'P' was not declared in this scope
   31 |       if (S[k]=S[i] && P[k]<P[i]) {
      |                        ^
Language: C++

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

#include <numeric>
using namespace std;

typedef long long ll;

ll dp[1000000];
ll MOD = 1000000007;


int main() {
    int N, M;
    cin>>N>>M;
    
    ll ans;
    bool f = true;
    vector<int> v(M);
    for(int i=0;i<M;i++){
        cin>>v[i];
        if(i>=1 and abs(v[i])-abs(v[i-1])==1){
             ans = 0;
             f = false;
        }
    }
    
    dp[0]=1;
    auto result = std::find(v.begin(), v.end(), 1);
    if (result != v.end()) {
        dp[1] = 0;
    dp[1]=1;

    if(f){
        for(int i=0;i<N;i++){
            auto result = std::find(v.begin(), v.end(), i+1);
            if (result != v.end()) {
                dp[i+1] = 0;
            }
            else{
                dp[i+2] = dp[i+1]+dp[i];
                ans = dp[i+1]%MOD;
            }
        }
    }
    cout<<ans%MOD<<endl;

}


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

#include <iostream>

using namespace std;

int N, M;
int d = 1000000007;

int memo[100001];

int rec(int n) {
  if (n < 2) return 1;
  else if (memo[n] > -1) return memo[n];
  memo[n] = (rec(n-1)+rec(n-2))%d;
  return memo[n];
}

int main() {
  int a;
  cin >> N >> M;
  memset(memo, -1, sizeof(memo));
  for (int i = 0; i < M; i++) {
    cin >> a;
    memo[a] = 0;
  }
  cout << rec(N) << endl;
  return 0;
}


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

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

template <class T> using V = vector<T>;
template <class S, class T> using P = pair<S, T>;
template <class... T> using TP = tuple<T...>;

using ll = long long;
using db = double;
using ldb = long db;
using str = string;
using vll = V<ll>;
using vvll = V<V<ll>>;
using pll = P<ll,ll>;
using tpll = TP<ll,ll,ll>;
using vpll =V<pll>;
using vst = V<str>;
using vch = V<char>;

#define FOR(i,a,b) for(ll i=(a);i<(ll)(b);i++)
#define rFOR(i,a,b) for(ll i=(b);i>(ll)(a);i--)
#define oFOR(i,a,b) for(ll i=(a);i<(ll)(b);i+=2)
#define bgn begin()
#define en end()
#define SORT(a) sort((a).bgn,(a).en)
#define REV(a) reverse((a).bgn,(a).en)
#define fi first
#define se second
#define sz size()
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) __lcm(a,b)
#define co(a) cout<<a<<endl
#define ci(a) cin>>a
#define pb(a) push_back(a)
#define pob pop_back()
#define mp make_pair
#define mt make_tuple
#define pbmp(a,b) push_back(mp(a,b))
#define subs(a,b) substr(a,b)
#define cfs(a) cout<<fixed<<setprecision(a)
#define INF 1e16
#define mod 1e9+7


int main() {
  ll n,m;
  cin>>n>>m;
  vll vec(m);
  FOR(i,0,m){
    cin>>vec[i];
  }
  bool D=false;
  if(vec[0]==1){
    D=true;
  }
  if(m>1){
  FOR(i,1,m){
    if((vec[i]-vec[i-1])==1){
      D=true;
    }
  }
  }
  if((n-vec[m-1])==1){
    D=true;
  }
  if(D){
    co(0);
  }
  else{
  vll v2(18);
    //1 iranai
  ll a2=1;
  FOR(i,0,18){
    v2[i]=a2;
    a2*=2;
  }
  //nisinsuu ni surun ha pass
  //keisanryou ha daizyoubu yoteidoutinara
  ll bns=0,ans=0;
    ll b=0;
  FOR(j,0,18){
    if((vec[0]-1)>=v2[j]){
      bns+=vec[0]/v2[j]+vec[0]%v2[j];
    }
    else break;
  }
  ans+=bns;
  ll a=0;
  if(m>1){
  FOR(i,1,m){
    a=vec[i]-vec[i-1]-1;
    FOR(j,0,17){
      if(a>=v2[j]){
        bns+=a/v2[j]+a%v2[j];
      }
      else break;
    }
    ans+=bns;
  }
  }
  a=n-vec[m-1]-1;
  FOR(j,0,17){
      if(a>=v2[j]){
        FOR(k,0,a%v2[j]){
    //if( (a/v2[j]+1)>a%v2[j];)
   //   (a/v2[j]+1) C a%v2[j];
    //else ...
        bns+=(a/v2[j]+1)a%v2[j];
      }
      else break;
    ans+=bns;
  }
  co(ans);
  }
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:110:25: error: expected ';' before 'a'
  110 |         bns+=(a/v2[j]+1)a%v2[j];
      |                         ^
      |                         ;
a.cc:112:7: error: expected '}' before 'else'
  112 |       else break;
      |       ^~~~
a.cc:105:19: note: to match this '{'
  105 |       if(a>=v2[j]){
      |                   ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i, n) for(ll i = 0; i < (ll)n; i++)
const ll MOD = 1e9+7;
// const ll MOD = 1;
// ll dp[100000];
vector<ll > dp(100000, -1);
ll cal(ll i){
  if(dp[i] >= 0){
    return dp[i ];
  }
  dp[i] = cal(i - 1) + cal(i - 2);
}
int main()
{
  ll N, M;
  cin >> N >> M;
  vector<ll > a(M);
  REP(i, M) cin >> a[i] ;
  //  memset(dp, -1, sizeof(dp));
  dp[0] = 0;
  dp[1] = 1;
  dp[2] = 2;
  ll sum = 0;
  if(a[0] == 1){sum = 1;}
  else{sum = cal(a[0] - 1);}
  // cout << "init:" << sum << endl;
  ll ind = 0;
  REP(i, M - 1){
    ind = a[i + 1] - a[i] - 1;
    sum *= cal(ind);
    // cout << "ind = " << ind << ", cal(ind) = " << cal(a[i + 1] - a[i] - 1) << endl;
    sum %= MOD;
    if(sum ==0){
      break;
    }
  }
  // cout << "final:" << N - a[M - 1] - 1 << "," <<cal(N - a[M - 1] - 1)<< endl;
  if(a[M - 1] == N - 1){sum *= 1;}
  else{sum *= cal(N - a[M - 1] - 1);}
  sum %= MOD;
  cout << sum << endl;
  // REP(i, 10){
  //   cal(i);
  //   cout << "i = " << i << ", dp = " << dp[i] << endl;
  // }


Compiler output:
a.cc: In function 'int main()':
a.cc:43:23: error: expected '}' at end of input
   43 |   cout << sum << endl;
      |                       ^
a.cc:16:1: note: to match this '{'
   16 | {
      | ^
a.cc: In function 'll cal(ll)':
a.cc:13:9: warning: control reaches end of non-void function [-Wreturn-type]
   13 |   dp[i] = cal(i - 1) + cal(i - 2);
Language: C++

#include <bits/stdc++.h>
using namespace std;
int c[100000];

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

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

#include <stdio.h>
int main()
{
	int N=0, M=0,count=0,i=0,temp=0;
	int a[100000];

	for (i = 0; i < M;i++)
	{
		scanf("%d", &temp);
		if (i == temp)
		{
			a[temp] = 1;
		}
		else a[i] = 0;
	}
	while (1)
	{
		if(a[i)
	}
}

Compiler output:
main.c: In function 'main':
main.c:18:23: error: expected ']' before ')' token
   18 |                 if(a[i)
      |                       ^
      |                       ]
main.c:19:9: error: expected expression before '}' token
   19 |         }
      |         ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int proibido[112345],resp,x,n;

int qtsmaneiras(int i){
	if(i > n)
		return -1;
	if(proibido[i])
		return -1;

	if(i == n)
		return 1;

	x = qtsmaneiras(i+1);
	if(x != -1)
		resp++;
	x = qtsmaneiras(i+2);
	if(x != -1)
		resp++;

}

int main(){

	scanf("%d %d",&n,&m);
	for(int i = 0;i < m;++i){
		scanf("%d",&x);
		proibido[x-1] = 1;
	}
	printf("%d\n",qtsmaneiras(0));
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:27: error: 'm' was not declared in this scope
   25 |         scanf("%d %d",&n,&m);
      |                           ^
a.cc: In function 'int qtsmaneiras(int)':
a.cc:21:1: warning: control reaches end of non-void function [-Wreturn-type]
   21 | }
      | ^
Language: C++

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

int main() {
	int N, M;
	cin >> N >> M;
	vector<long int> s(M), t(N), d(M + 1);
	for(int i = 0; i < M; ++i) {
		cin >> s[i];
	}
	t[0] = 1;
	t[1] = 1;	
	d[0] = s[0] - 1;
	for(int i = 1; i < M; ++i) {
		d[i] = s[i] - s[i -1];
	}
	d[M] = N - s[M - 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];
			//cout << i << "= " << t[i] << endl;
		}
		long long int sum = 1;
		for(int i = 1; i < M; ++i) {
			sum = sum * t[d[i] - 2];
			//cout << t[d[i] - 2] << endl;
			sum = sum % 1000000007;
		}
		sum = sum * t[d[0]] * t[d[M] - 1];
		cout << sum % 1000000007 << endl;
	}
}
	


Compiler output:
a.cc: In function 'int main()':
a.cc:19:22: error: 'max_element' was not declared in this scope
   19 |         int max_d = *max_element(d.begin(),d.end());
      |                      ^~~~~~~~~~~
a.cc:20:22: error: 'min_element' was not declared in this scope
   20 |         int min_d = *min_element(d.begin(),d.end());
      |                      ^~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
#include <stdio.h>
using namespace std;
const int MOD = 1000000007;
int fib_memo[MOD] = {0};
int fib(int x) {
    if(x==0)return 0;
    if(x==1)return 1;
    if(fib_memo[x] != 0) {
        return fib_memo[x];
    }
    return fib_memo[x] = fib(x-1)+fib(x-2);
}
int main(){
  int n,m;  
  cin>>n>>m;
  long long ans=1
  if(m==0){
    ans=fib(n);
    ans%=MOD;
    cout<<ans<<endl;
  }
  else{
    vector<int>vec1(m);
    for(int i=0;i<m;i++){
      int a; cin>>a;
      vec1[i]=a;
    }
    sort(vec1.begin(),vec1.end());
    vec1.erase(unique(vec1.begin(),vec1.end()),vec1.end());
    long long size=vec1.size();
    for(int i=0;i<size;i++){
    }
    vector<int>vec2;
    vec2.push_back(vec1[0]+1);
    for(int i=1;i<size;i++){
      vec2.push_back(vec1[i]-vec1[i-1]);
    }
    vec2.push_back(n-vec1[size-1]+1);
    int yes=1;
    //. #.....
    for(int i=0;i<size+1;i++){
      if(vec2[i]<=1){
        yes=0;
        break;
      }
      else{
        int y=vec2[i]-1;
        ans*=fib(y);
        ans%=MOD;
      }
    }
    if(yes==0) cout<<0<<endl;
    else cout<<ans<<endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:3: error: expected ',' or ';' before 'if'
   18 |   if(m==0){
      |   ^~
a.cc:23:3: error: 'else' without a previous 'if'
   23 |   else{
      |   ^~~~
Language: C++

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

#define INF 1000000

using namespace std;

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

void bfib(int n) {
	bool bf = false;
	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, before;
	n = nb = buf = before = 0;
	scanf_s("%d %d", &n, &nb);
	length = nb;
	for (int i = 0; i < nb; ++i) {
		scanf_s("%d", &buf);
		if (before + 1 == buf && i > 0) {
			cout << 0 << endl;
			return 0;
		}
		before = buf;
		memo[buf] = -1;
	}
	if (memo[1] == 4294967295) {
		memo[2] = 1;
	}
	else {
		memo[1] = 1;
		memo[2] = 2;
	}

	for (int i = 3; i <= n; ++i) {
		if (memo[i] == 4294967295) {
			memo[i + 1] = memo[i + 2] = memo[i - 1];
			i += 2;
		}
		else {
			if (memo[i - 2] == 4294967295) {
				memo[i] = memo[i - 1];
			}
			else if (memo[i - 1] == 4294967295) {
				memo[i] = memo[i - 2];
			}
			else {
				memo[i] = (memo[i - 2] + memo[i - 1]) % 1000000007;
			}
		}
	}
	cout << memo[n] << endl;

	return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:38:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   38 |         scanf_s("%d %d", &n, &nb);
      |         ^~~~~~~
      |         scanf
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() {
    int N, M;
    long long count = 1;
    cin >> N >> M;
    int a[M];
    long long fib_array[N];
    fib_array[0] = 1;
    fib_array[1] = 1;
    for (int i = 2; i < N; 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;
}
#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() {
    int N, M;
    long long count = 1;
    cin >> N >> M;
    int 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:51:5: error: redefinition of 'int main()'
   51 | int main() {
      |     ^~~~
a.cc:12:5: note: 'int main()' previously defined here
   12 | int main() {
      |     ^~~~
Language: C++

#include <iostream>

using namespace std;

int N, M;
int d = 1000000007;

int memo[100001];

int rec(int n) {
  if (n < 2) return 1;
  else if (memo[n] > -1) return memo[n];
  memo[n] = (rec(n-1)+rec(n-2))%d;
  return memo[n];
}

int main() {
  int a;
  cin >> N >> M;
  memset(memo, -1, sizeof(memo));
  for (int i = 0; i < M; i++) {
    cin >> a;
    memo[a] = 0;
  }
  for (int i = 0; i < N; i++) {
    cout << memo[i] << " ";
  }
  cout << rec(N) << endl;
  return 0;
}


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

#include <bits/stdc++.h>
#include <algorithm>
using namespace std;
typedef long long LL;
LL f(LL n)
{
	int f;
    if(n==1||n==0||n==2)
	{
         return n;
    }
    else
	{
       int a=1;
       int b=2;
       int temp=0;
        for(int i=3;i<n+1;i++)
		{
            temp=a+b;
            a=b;
            b=temp;
        }
         return temp;
    }
}
int main()
{
	LL n,i=0,m,s=0,k=0;
	cin>>n>>m;
	if(m==0)
	{
		s=f(n);
		s=s%1000000007;
		printf("%lld",s);
	}
	else
	{
		LL a[m],t=0;
		cin>>a[0];
		s=f(a[0]-1);
		for(i=1;i<m;i++)
		{
			cin>>a[i];
			if(a[i]-a[i-1]==1)
			{
				t=1;s=0;break;
			}
			else
			{
				k=f(a[i]-a[i-1]-2)
				
			    if(s==0)
			    {
			    	s=s+k;
				}
				else if(k!=0)
				{
					s=s*k;
				}
				s=s%1000000007;
			}
			
		}
		if(t==0&&a[m-1]!=n-1)
		{
			s=s*f(n-a[m-1]-1);
			s=s%1000000007;
		}
		printf("%lld",s);
    }
	return 0;
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:50:51: error: expected ';' before 'if'
   50 |                                 k=f(a[i]-a[i-1]-2)
      |                                                   ^
      |                                                   ;
   51 | 
   52 |                             if(s==0)
      |                             ~~                     
a.cc:56:33: error: 'else' without a previous 'if'
   56 |                                 else if(k!=0)
      |                                 ^~~~
Language: C++

#include <iostream>
using namespace std;

int func(int x){
  if(!x){
    return x;
  }
  else{
    int s = 0;
    s += x;
    return x;
  }
}

int main(){
  int N, M;
  int a[10000]
  cin << N << M;
  for(int i = 0; i < M; i++){
    cin >> a[i];
  }
  bool x = 1;
  for(int i = 0; i < M - 1; i++){
    if(a[i + 1] == a[i] + 1){
      x = 0;
      break;
    }
  }
  if(x){
    if(M == 0){
      cout << func(N) << endl;
    }
    else{
      
      int s = 0;
      s += func(a[0] - 1);
      for(int i = 0; i M - 1; i++){
        s *= func(a[i] - a[i - 1] -2)
      }
      s *= func(N - a[M - 1]);
      cout << s << endl;
      
    }
  }
  else{
    cout << 0 << endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:3: error: expected initializer before 'cin'
   18 |   cin << N << M;
      |   ^~~
a.cc:20:12: error: 'a' was not declared in this scope
   20 |     cin >> a[i];
      |            ^
a.cc:24:8: error: 'a' was not declared in this scope
   24 |     if(a[i + 1] == a[i] + 1){
      |        ^
a.cc:36:17: error: 'a' was not declared in this scope
   36 |       s += func(a[0] - 1);
      |                 ^
a.cc:37:23: error: expected ';' before 'M'
   37 |       for(int i = 0; i M - 1; i++){
      |                       ^~
      |                       ;
a.cc:37:29: error: expected ')' before ';' token
   37 |       for(int i = 0; i M - 1; i++){
      |          ~                  ^
      |                             )
a.cc:37:31: error: 'i' was not declared in this scope
   37 |       for(int i = 0; i M - 1; i++){
      |                               ^
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;
  vector<ll> t(n + 1);
  t[0] = t[1] = 1;
  if(m==0){
    cout << fib(n, t) << endl;
    return 0};

  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:31:13: error: expected ';' before '}' token
   31 |     return 0};
      |             ^
      |             ;
Language: C

#include<stdio.h>

unsigned long fibonacci(int n){
    unsigned long f;
    int i;

    if(n < 0L)
        return(0L);
    else if(n == 0L || n == 1L)
        return(1L);
    else
        return fibonacci(n - 1) + fibonacci(n - 2);
}

int main(void){
    int n, m, a;
    int answer;
    int d = 0;
    scanf("%d %d", &n, &m);

    answer = fibonacci(n);



    for(i = 0; i < m; i++){
        scanf("%d", &a);
        d = fibonacci(n - a) * fibonacci(n - a - 1) - d;
        answer -= d;
    }

    printf("%lo", answer % 1000000007);

    return 0;
}



Compiler output:
main.c: In function 'main':
main.c:25:9: error: 'i' undeclared (first use in this function)
   25 |     for(i = 0; i < m; i++){
      |         ^
main.c:25:9: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include <bits/stdc++.h>
using namespace std;
vector<vector<long> kaij(100000,vector<long>(2));
long Combination(int n, int r)
{

    if (n - r < r) r = n - r;
    if (r == 0) return 1;
    if (r == 1) return n;

    vector<int> numerator(r);
  vector<int> denominator(r);

    for (int k = 0; k < r; k++)
    {
        numerator[k] = n - r + k + 1;
        denominator[k] = k + 1;
    }

    for (int p = 2; p <= r; p++)
    {
        int pivot = denominator[p - 1];
        if (pivot > 1)
        {
            int offset = (n - r) % p;
            for (int k = p - 1; k < r; k += p)
            {
                numerator[k - offset] /= pivot;
                denominator[k] /= pivot;
            }
        }
    }

    long result = 1;
    for (int k = 0; k < r; k++)
    {
        if (numerator[k] > 1) result *= numerator[k];
    }

    return result;
}

long kai(long n,long r){
  if(kaij[n][r] != 0)return kaij[n][r];
  kaij[n][r] = Combination(n,r);
  return kaij[n][r];
}
int main() {
  int n,m;
  cin >> n >> m;
  vector<long long> a(m);
  long long i,j;
  long long ans = 1;
  long long tmp=0;
  //vector<vector<long long int> > v(n+1,vector<long long int>(n+1,0));
  //comb(v);
  if(m==0){
    for(j=0;j<(n/2)+1;j++){
      tmp += kai(n-j,n - j*2);
    }
    cout << tmp << endl;
    return 0;
  }
  for(i=0;i<m;i++){
    cin >> a[i];
  }
  vector<long long> b(m+1);
  for(i=1;i<m;i++){
    b[i] = a[i] - a[i-1] - 2;
  }
  b[0] = a[0] - 1;
  b[m] = n -1 - a[m-1];

  for(i=0;i<m+1;i++){
    if(b[i] == -1){
      ans = 0;
      break;
    }else if(b[i] == -2){
      continue;
    }
    for(j=0;j<(b[i]/2)+1;j++){
      tmp += kai(b[i]-j,b[i] - j*2);
    }
    ans *= tmp;
    if (ans > 1000000007)ans %= 1000000007;
    tmp = 0;
  }
  cout << ans << endl;
}

Compiler output:
a.cc:3:48: error: template argument 1 is invalid
    3 | vector<vector<long> kaij(100000,vector<long>(2));
      |                                                ^
a.cc:3:48: error: template argument 2 is invalid
a.cc: In function 'long int kai(long int, long int)':
a.cc:44:6: error: 'kaij' was not declared in this scope; did you mean 'kai'?
   44 |   if(kaij[n][r] != 0)return kaij[n][r];
      |      ^~~~
      |      kai
a.cc:45:3: error: 'kaij' was not declared in this scope; did you mean 'kai'?
   45 |   kaij[n][r] = Combination(n,r);
      |   ^~~~
      |   kai