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

#include <iostream>
#include <vector>

using namespace std;

int main(int argc, char const *argv[])
{
  int n; cin >> n;
  vector<int> w(n);
  int sum=0;
  for(int i=0;i<n;++i) { 
    cin >> w[i]; sum+=w[i];
  }
  int#include <iostream>
#include <vector>

using namespace std;

int main(int argc, char const *argv[])
{
  int n; cin >> n;
  vector<int> w(n);
  int sum=0;
  for(int i=0;i<n;++i) { 
    cin >> w[i]; sum+=w[i];
  }
  int s2 = sum, d = sum;
  for(int i=0;i<n;++i) {
    s2 -= w[i];
    d = min(d, max(s2*2-sum, sum-s2*2));
  }
  cout << d << endl;
  return 0;
}

 s2 = sum, d = sum;
  for(int i=0;i<n;++i) {
    s2 -= w[i];
    d = min(d, max(s2*2-sum, sum-s2*2));
  }
  cout << d << endl;
  return 0;
}



Compiler output:
a.cc:14:6: error: stray '#' in program
   14 |   int#include <iostream>
      |      ^
a.cc: In function 'int main(int, const char**)':
a.cc:14:15: error: expected initializer before '<' token
   14 |   int#include <iostream>
      |               ^
a.cc:20:1: error: a function-definition is not allowed here before '{' token
   20 | {
      | ^
a.cc:36:2: error: 's2' was not declared in this scope
   36 |  s2 = sum, d = sum;
      |  ^~
a.cc:36:12: error: 'd' was not declared in this scope
   36 |  s2 = sum, d = sum;
      |            ^
Language: C++

#include <iostream>
#include <numeric>
#include <vector>
#include <cmath>
#include <string>
#include <algorithm>
#include <set>
#include <map>
#include <queue>
#include <iomanip>
using namespace std;
using ll=long long;
const ll MOD=1000003;
const ll LINF=0x1fffffffffffffff;
const int INF=0x3fffffff;
#define rep(i,a,b) for(ll i=a;i<b;i++)
#define rrep(i,a,b) for(ll i=b-1;i>=a;i--)
#define range(i) (i).begin(),(i).end()
#define rrange(i) (i).rbegin(),(i).rend()
inline ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
inline constexpr int intpow(ll a,ll b){
    if(b==0) return 1;
    ll ans=intpow(a,b/2);
    return ans*ans%MOD*(b&1?a:1)%MOD;
}
inline constexpr int modf(ll n){
    ll ans=1;
    rep(i,0,n) {ans=ans*(n-i)%MOD;}
    return ans;
}
inline long double median(vector<ll> v){
    ll size=v.size();
    sort(v.begin(),v.end());
    if (size % 2 == 1) return v[(size - 1) / 2];
    else return v[(size / 2) - 1] ;
}
template<class T> inline bool chmax(T& a,T b) {if(a<b){a=b;return 1;} return 0;}
template<class T> inline bool chmin(T& a,T b) {if(a>b){a=b;return 1;} return 0;}
template<class T,class L>ostream& operator << (ostream& os, pair<T,L>& p){os << p.first << " " << p.second;return os;}

int main(){
  ll n;
  cin>>n;
  vector<ll> w(n);
  ll i=0,s=0,ans=0;
  rep(i,0,n) {
    cin>>w[i];
    s+=w[i];
  }
  while(ans<s-ans){
    ans+=w[i]
      i++;
  }
  cout<<min(abs(s-ans),abs(s-ans-w[i-1]));
}

Compiler output:
a.cc: In function 'int main()':
a.cc:51:14: error: expected ';' before 'i'
   51 |     ans+=w[i]
      |              ^
      |              ;
   52 |       i++;
      |       ~
Language: C++

#define _CRT_SECURE_NO_WARNINGS
#include<bits/stdc++.h>
#define fi first
#define se second
#define pb push_back

using namespace std;
const long long MOD = (long long)1e9 + 7;

int n, w[200], ps[200], ans = 100009;

int main()
{
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    cin >> n >> w[0];
    ps[0] = w[0];
    for (int i = 1; i < n; i++) {
        cin >> w[i];
        s[i] = s[i - 1];
        s[i] += w[i];
    }
    for (int i = 0; i < n - 1; i++) {
        ans = min(ans, abs(s[n - 1] - s[i] - s[i]));
    }
    cout << ans << "\n";
    //system("pause");
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:9: error: 's' was not declared in this scope
   19 |         s[i] = s[i - 1];
      |         ^
a.cc:23:28: error: 's' was not declared in this scope
   23 |         ans = min(ans, abs(s[n - 1] - s[i] - s[i]));
      |                            ^
Language: Java

import java.util.Scanner;

public class B {
    public static void main(String[] args) {
        final Scanner scanner = new Scanner(System.in);
        final int count = scanner.nextInt();
        final int[] point = new int[count];
        int all = 0;

        for (int i = 0; i < point.length; i++) {
            final int w = scanner.nextInt();
            point[i] = w;
            all += w;
        }

        int result = Integer.MAX_VALUE;
        int re = all;
        for (int i = 0; i < point.length; i++) {
            re -= point[i];
            if(Math.abs(all -re - re) < result){
                result = Math.abs(all - re - re);
            }
        }

        System.out.println(result);
    }
}


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

n = int(input())
a = list(map(int, input().split()))
ans = 10**10


for t in range(1, n):
	ans = min(ans, abs(sum(a[:t]) - sum(a[t:])))
	
print(ans)

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

#include <utility>
#include <vector>
#include <iostream>
#include <algorithm>
#include <set>
#include <cmath>
#include <cstdlib>
#define REP(i,n) for(int i=0;i<n;i++)
typedef unsigned long ul;
typedef unsigned long long ull;
typedef long long ll;
using namespace std;
int gcd(int a,int b){return b?gcd(b,a%b):a;}
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};


int main() {
	cin.tie(0);
   	ios::sync_with_stdio(false);
    int N;
    cin >> N;
    int W[N];
    for(int i = 0; i < N; i++){
        cin >> W[i];
    }

    int min = INT_MAX;
    for(int i = 0; i < N-1; i++){
        int s1=0;
        int s2=0;
        for(int j = 0; j <=i; j++){
            s1 += W[j];
        }
        for(int k = i+1; k < N; k++){
            s2 += W[k];
        }
        int ab = abs(s1-s2);
        if(ab < min){
            min = ab;
        }
    }
    cout << min << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:15: error: 'INT_MAX' was not declared in this scope
   28 |     int min = INT_MAX;
      |               ^~~~~~~
a.cc:8:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    7 | #include <cstdlib>
  +++ |+#include <climits>
    8 | #define REP(i,n) for(int i=0;i<n;i++)
Language: C++

#include<bits/stdc++.h>
using namespace std;
int w[105];
int main(){
	int n;
	scanf("%d",&n);
	for(int i=0;i<n;i++)
		scanf("%d",&w[i]);
	sort(w,w+n);
	int s1=0,s2=0;
	int f=0;
	if(n%2==0){
		for(int i=0;i<n/2;i+=2){
			s1+=(s[i]+s[n-i-1]);
			s2+=(s[i+1]+s[n-i-2]); 
		}
		printf("%d\n",abs(s1-s2));
	}
	else{
		for(int i=0;i<n/2;i+=2){
			s1+=(s[i]+s[n-i-1]);
			s2+=(s[i+1]+s[n-i-2]); 
		}
		if(s1>s2)
			s2+=s[n/2];
		else s1+=s[n/2];
		printf("%d\n",abs(s1-s2));
	} 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:30: error: 's' was not declared in this scope
   14 |                         s1+=(s[i]+s[n-i-1]);
      |                              ^
a.cc:21:30: error: 's' was not declared in this scope
   21 |                         s1+=(s[i]+s[n-i-1]);
      |                              ^
a.cc:25:29: error: 's' was not declared in this scope
   25 |                         s2+=s[n/2];
      |                             ^
a.cc:26:26: error: 's' was not declared in this scope
   26 |                 else s1+=s[n/2];
      |                          ^
Language: C

#include<stdio.h>
#include<stdlib.h>
/* 値を入れ替える関数 */
void swap (int *x, int *y) {
  int temp;    // 値を一時保存する変数

  temp = *x;
  *x = *y;
  *y = temp;
}

/***
* pivotを決め、
* 全データをpivotを境目に振り分け、
* pivotの添え字を返す
***/
int partition (int array[], int left, int right) {
  int i, j, pivot;
  i = left;
  j = right + 1;
  pivot = left;   // 先頭要素をpivotとする

  do {
    do { i++; } while (array[i] < array[pivot]);
    do { j--; } while (array[pivot] < array[j]);
    // pivotより小さいものを左へ、大きいものを右へ
    if (i < j) { swap(&array[i], &array[j]); }
  } while (i < j);

  swap(&array[pivot], &array[j]);   //pivotを更新

  return j;
}

/* クイックソート */
void quick_sort (int array[], int left, int right) {
  int pivot;

  if (left < right) {
    pivot = partition(array, left, right);
    quick_sort(array, left, pivot-1);   // pivotを境に再帰的にクイックソート
    quick_sort(array, pivot+1, right);
  }
}

int main (void) {
  int n,w[100],a=0,b=0;
  scanf("%d",&n);
  for(int i=0;i<n;i++){
    scanf("%d",&w[i]);
  }
  quick_sort(w,0,n-1);
  for(int i=0;i<n/2;i++){
    a+=w[i*2];
    b+=w[i*2+1];
  }
  if(n%2==1) a+=w[n-1];
  printf("%d\n",abs(a-b));
  return 0
}

Compiler output:
main.c: In function 'main':
main.c:59:11: error: expected ';' before '}' token
   59 |   return 0
      |           ^
      |           ;
   60 | }
      | ~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int N;
  cin >>N, sum, p_sum, pp_sum;
  sum = 0;
  p_sum =0;
  vector<int> w(N);
  for(int i=0;i<N;i++){
    cin >> w.at(i);
    sum += w.at(i);
  }
  for(int i=0;i<N;i++){
    p_sum += w.at(i);
    if(p_sum > sum){
      pp_sum = p_sum - w.at(i);
      break;
    }
  }
  cout << min(2*p_sum - sum, sum - 2*pp_sum) <<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:12: error: 'sum' was not declared in this scope
    5 |   cin >>N, sum, p_sum, pp_sum;
      |            ^~~
a.cc:5:17: error: 'p_sum' was not declared in this scope
    5 |   cin >>N, sum, p_sum, pp_sum;
      |                 ^~~~~
a.cc:5:24: error: 'pp_sum' was not declared in this scope
    5 |   cin >>N, sum, p_sum, pp_sum;
      |                        ^~~~~~
Language: C++

#include <iostream>
#include<math.h>
#include<algorithm>
#include<string>
#include<vector>
#include<iomanip>
using namespace std;
#define FOR(i,n) for(int (i)=0;(i)<(n);(i)++)

int retl(int K,int L){
    int tmp=0;
    while(pow(2,tmp) * L < K){
        tmp++;
    }
    return tmp;
}

struct A{
    string s;
    int p;
    int order;
};


int main(){
    int N;
    cin  >> N;
  
    int W[N];
    FOR(i,N){
        cin >>W[i];
    }
    
    int ab=INT_MAX;

    for(int i=0;i<N-1;i++){
        int t1=0;
        int t2=0;
        for(int j=0;j<=i;j++){
            t1+=W[j];
        }
        for(int j=i+1;j<N;j++){
            t2+=W[j];
        }
        if(ab>abs(t1-t2)){
            ab=abs(t1-t2);
        }
    }

    int ans=ab;
    cout << ans << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:12: error: 'INT_MAX' was not declared in this scope
   34 |     int ab=INT_MAX;
      |            ^~~~~~~
a.cc:7:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    6 | #include<iomanip>
  +++ |+#include <climits>
    7 | using namespace std;
Language: C++

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

const int MAXN = 105;
int n, a[MAXN];
long long A, r, ans;

int main() {
  cin >> n;
  for (int i = 0; i < n; i++)
    	cin >> a[i], A += a[i];
  ans = A;
  for (int i = 0; i < n; i++) {
  	 r += a[i];
    ans = min(ans, abs(A - (A - r)))
  }
  cout << ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:37: error: expected ';' before '}' token
   17 |     ans = min(ans, abs(A - (A - r)))
      |                                     ^
      |                                     ;
   18 |   }
      |   ~
Language: C++

#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<map>
#include<set>
#include<cstdio>
#include<cmath>
#include<numeric>
#include<queue>
#include<stack>
#define repp(i,a,b) for(int i=(int)a;i<(int)b;++i)
#define repm(i,a,b) for(int i=(int)a;i>(int)b;--i)
using ll=long long;
static const ll mod=1e9+7;
static const ll INF=1LL<<50;
using namespace std;

int main() {
int n;
  cin>>n;
  vector<int)w(n);
  repp(i,0,n)cin>>w[i];
  sort(w.begin(),w.end());
  int sum1=0,sum2=0;
  for(int i=0;i<n;i+=2)sum1+=w[i];
	for(int i=1;i<n;i+=2)sum2+=w[i];
  	cout<<abs(sum1-sum2)<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:10: error: template argument 1 is invalid
   22 |   vector<int)w(n);
      |          ^~~
a.cc:22:10: error: template argument 2 is invalid
a.cc:22:13: error: expected unqualified-id before ')' token
   22 |   vector<int)w(n);
      |             ^
a.cc:23:19: error: 'w' was not declared in this scope
   23 |   repp(i,0,n)cin>>w[i];
      |                   ^
a.cc:24:8: error: 'w' was not declared in this scope
   24 |   sort(w.begin(),w.end());
      |        ^
Language: C++

/* 
chirag11032000
Chirag Thakur
*/

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;

using ll = long long;
using db = double;
using pii = pair < int, int >;
using pll = pair < ll, ll >;

template < typename T > using OrderedSet = tree < T, null_type, less < T >, rb_tree_tag, tree_order_statistics_node_update >;
template < typename T > using MinPriorityQueue = priority_queue < T, vector < T >, greater < T > >;

#ifndef ONLINE_JUDGE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template < typename Arg1 >
void __f(const char* name, Arg1&& arg1) {
	cerr << name << " : " << arg1 << std::endl;
}
template < typename Arg1, typename... Args >
void __f(const char* names, Arg1&& arg1, Args&&... args) {
	const char* comma = strchr(names + 1, ',');
	cerr.write(names, comma - names) << " : " << arg1 << " | ";
	__f(comma + 1, args...);
}
#else
#define trace(...)
#endif

#define eb emplace_back
#define mp make_pair
#define mt make_tuple
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define unique_sort(x) sort(all(x)), x.resize(distance(x.begin(), unique(all(x))))

const db PI = acos(-1);
const ll LINF = LLONG_MAX;
const int INF = INT_MAX, MOD = 1e9 + 7, N = 1e5 + 10;

void test_case();

int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	test_case();
	cerr << "Time taken: " << int((clock() * 1000.) / CLOCKS_PER_SEC) << "ms\n";
	return 0;
}

void test_case() {
	int n;
	cin >> n;
	vector < int > v(n);
	for (auto &el: v) {
		cin >> el;
	}
	int tot = accumulate(all(v), 0), o = 0;
	int ans = INF;
	for (int i = 0; i < n - 1; ++i) {
		o += v[i];
		tot -= v[i];
		ans = min(ans, abs(o - tot));
	}
	cout << ans << "\n";
}a

Compiler output:
a.cc:74:2: error: 'a' does not name a type
   74 | }a
      |  ^
Language: C++

#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<map>
#include<set>
#include<cstdio>
#include<cmath>
#include<numeric>
#include<queue>
#include<stack>
#define repp(i,a,b) for(int i=(int)a;i<(int)b;++i)
#define repm(i,a,b) for(int i=(int)a;i>(int)b;--i)
using ll=long long;
static const ll mod=1e9+7;
static const ll INF=1LL<<50;
using namespace std;

int main() {
int n;
  cin>>n;
  vector<int)w(n);
  repp(i,0,n)cin>>w[i];
  sort(w.begin(),w.end());
  int sum1=0;sum2=0;
  for(int i=0;i<n;i+=2)sum1+=w[i];
	for(int i=1;i<n;i+=2)sum2+=w[i];
  	cout<<abs(sum1-sum2)<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:10: error: template argument 1 is invalid
   22 |   vector<int)w(n);
      |          ^~~
a.cc:22:10: error: template argument 2 is invalid
a.cc:22:13: error: expected unqualified-id before ')' token
   22 |   vector<int)w(n);
      |             ^
a.cc:23:19: error: 'w' was not declared in this scope
   23 |   repp(i,0,n)cin>>w[i];
      |                   ^
a.cc:24:8: error: 'w' was not declared in this scope
   24 |   sort(w.begin(),w.end());
      |        ^
a.cc:25:14: error: 'sum2' was not declared in this scope; did you mean 'sum1'?
   25 |   int sum1=0;sum2=0;
      |              ^~~~
      |              sum1
Language: C++

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

int main() {
  int n;
  cin >> n;
  vector<int> ws(n);
  for (auto &w : ws) {
    cin >> w;
  }
  
  int ans = (1 << 30);
  
  for (int i = 0; i < n - 1; i++) {
    int s1 = 0, s2 = 0;
    for (int j = 0; j <= i; j++) {
      s1 += ws[j];
    }
    for (int j = i + 1; j < n; j++) {
      s2 += ws[j];
    }
    ans = min(ans, abs(s1 - s2));
  }
  
  cout << ans << endl;
  
  return 0;
}

Compiler output:
a.cc:1:10: fatal error: bits/stdc++.H: No such file or directory
    1 | #include <bits/stdc++.H>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: C

#include <bits/stdc++.h>

using namespace std;
using int64 = long long;
const int mod = 1e9 + 7;

const int64 infll = (1LL << 62) - 1;
const int inf = (1 << 30) - 1;

struct IoSetup {
  IoSetup() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(10);
    cerr << fixed << setprecision(10);
  }
} iosetup;


template< typename T1, typename T2 >
ostream &operator<<(ostream &os, const pair< T1, T2 > &p) {
  os << p.first << " " << p.second;
  return os;
}

template< typename T1, typename T2 >
istream &operator>>(istream &is, pair< T1, T2 > &p) {
  is >> p.first >> p.second;
  return is;
}

template< typename T >
ostream &operator<<(ostream &os, const vector< T > &v) {
  for(int i = 0; i < (int) v.size(); i++) {
    os << v[i] << (i + 1 != v.size() ? " " : "");
  }
  return os;
}

template< typename T >
istream &operator>>(istream &is, vector< T > &v) {
  for(T &in : v) is >> in;
  return is;
}

template< typename T1, typename T2 >
inline bool chmax(T1 &a, T2 b) { return a < b && (a = b, true); }

template< typename T1, typename T2 >
inline bool chmin(T1 &a, T2 b) { return a > b && (a = b, true); }

template< typename T = int64 >
vector< T > make_v(size_t a) {
  return vector< T >(a);
}

template< typename T, typename... Ts >
auto make_v(size_t a, Ts... ts) {
  return vector< decltype(make_v< T >(ts...)) >(a, make_v< T >(ts...));
}

template< typename T, typename V >
typename enable_if< is_class< T >::value == 0 >::type fill_v(T &t, const V &v) {
  t = v;
}

template< typename T, typename V >
typename enable_if< is_class< T >::value != 0 >::type fill_v(T &t, const V &v) {
  for(auto &e : t) fill_v(e, v);
}

int main() {
  int N;
  cin >> N;
  vector< int > A(N);
  cin >> A;
  int S = accumulate(begin(A), end(A), 0);
  int ret = inf, T = 0;
  for(int i = 0; i < N; i++) {
    T += A[i];
    chmin(ret, abs((S - T) - T));
  }
  cout << ret << endl;
}

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

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

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

    vector<ll> dp(n+1);
    dp[0]=1;
    for(int i=0; i<n; i++){
        int MIN = min(n, i+2);
        for(int j=i+1; j<=MIN; j++){
            if(stairs[j]){
                dp[j]+=dp[i];
                dp[j]%=mod;
            }
        }
    }

    cout << dp[n] << endl;

    return 0;
}   

Compiler output:
a.cc: In function 'int main()':
a.cc:18:22: error: no matching function for call to 'min(ll&, int)'
   18 |         int MIN = min(n, i+2);
      |                   ~~~^~~~~~~~
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:18:22: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   18 |         int MIN = min(n, i+2);
      |                   ~~~^~~~~~~~
/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:18:22: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   18 |         int MIN = min(n, i+2);
      |                   ~~~^~~~~~~~
Language: C++

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

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

    vector<ll> dp(n+1);
    dp[0]=1;
    for(int i=0; i<n; i++){
        for(int j=i+1; j<=min(n, i+2); j++){
            if(stairs[j]){
                dp[j]+=dp[i];
                dp[j]%=mod;
            }
        }
    }

    cout << dp[n] << endl;

    return 0;
}  

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

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


vector<long long> dp(100010);
long long nota[100010];


long long rec(int i,vector<long long> &dp){
if(i==0)return 0;  
long long x=1000000007;
if(dp[i]!=-1){  
if(i==1)return dp[i]=1;
if(i>1){
dp[i]=(rec(i-1)+1+rec(i-2)+1+x)%x;
}
  return dp[i];
}
else return dp[i];  
  
}
int main(){
int n,m;

  cin >> n >> m;
for(int i=0;i<100010;i++){
cin >> nota[i];
dp[i]=0;  
}
for(int i=0;i<m;i++){
dp[nota[i]]=-1;
}
  
cout << rec(n) << endl;  
}



Compiler output:
a.cc: In function 'long long int rec(int, std::vector<long long int>&)':
a.cc:15:11: error: too few arguments to function 'long long int rec(int, std::vector<long long int>&)'
   15 | dp[i]=(rec(i-1)+1+rec(i-2)+1+x)%x;
      |        ~~~^~~~~
a.cc:9:11: note: declared here
    9 | long long rec(int i,vector<long long> &dp){
      |           ^~~
a.cc:15:22: error: too few arguments to function 'long long int rec(int, std::vector<long long int>&)'
   15 | dp[i]=(rec(i-1)+1+rec(i-2)+1+x)%x;
      |                   ~~~^~~~~
a.cc:9:11: note: declared here
    9 | long long rec(int i,vector<long long> &dp){
      |           ^~~
a.cc: In function 'int main()':
a.cc:34:12: error: too few arguments to function 'long long int rec(int, std::vector<long long int>&)'
   34 | cout << rec(n) << endl;
      |         ~~~^~~
a.cc:9:11: note: declared here
    9 | long long rec(int i,vector<long long> &dp){
      |           ^~~
Language: C++

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


long long dp[100010];
long long nota[100010];


long long rec(int i,long long &dp[100010]){
if(i==0)return 0;  
long long x=1000000007;
if(dp[i]!=-1){  
if(i==1)return dp[i]=1;
if(i>1){
dp[i]=(rec(i-1)+1+rec(i-2)+1+x)%x;
}
  return dp[i];
}
else return dp[i];  
  
}
int main(){
int n,m;

  cin >> n >> m;
for(int i=0;i<100010;i++){
cin >> nota[i];
dp[i]=0;  
}
for(int i=0;i<m;i++){
dp[nota[i]]=-1;
}
  
cout << rec(n) << endl;  
}



Compiler output:
a.cc:9:32: error: declaration of 'dp' as array of references
    9 | long long rec(int i,long long &dp[100010]){
      |                                ^~
a.cc: In function 'long long int rec(...)':
a.cc:10:4: error: 'i' was not declared in this scope
   10 | if(i==0)return 0;
      |    ^
a.cc:12:7: error: 'i' was not declared in this scope
   12 | if(dp[i]!=-1){
      |       ^
Language: C++

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

int n,m;
long long dp[100010];
long long nota[100010]


long long rec(int i){
if(i==0)return 0;  
long long x=1000000007;
if(dp[i]!=-1){  
if(i==1)return dp[i]=1;
if(i>1){
dp[i]=(rec(n-1)+1+rec(n-2)+1+x)%x;
}
  return dp[i];
}
else return dp[i];  
  
}
int main(){


  cin >> n >> m;
for(int i=0;i<100010;i++){
cin >> nota[i];
dp[i]=0;  
}
for(int i=0;i<m;i++){
dp[nota[i]]=-1;
}
  
cout << rec(n) << endl;  
}


Compiler output:
a.cc:9:1: error: expected initializer before 'long'
    9 | long long rec(int i){
      | ^~~~
a.cc: In function 'int main()':
a.cc:27:8: error: 'nota' was not declared in this scope
   27 | cin >> nota[i];
      |        ^~~~
a.cc:31:4: error: 'nota' was not declared in this scope
   31 | dp[nota[i]]=-1;
      |    ^~~~
a.cc:34:9: error: 'rec' was not declared in this scope
   34 | cout << rec(n) << endl;
      |         ^~~
Language: C++

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




long long rec(int i){
if(i==0)return 0;  
long long x=1000000007;
if(dp[i]!=-1){  
if(i==1)return dp[i]=1;
if(i>1){
dp[i]=(rec(n-1)+1+rec(n-2)+1+x)%x;
}
  return dp[i];
}
else return dp[i];  
  
}
int main(){
long long nota[100010];
long long dp[100010];  
int n,m;
  cin >> n >> m;
for(int i=0;i<100010;i++){
cin >> nota[i];
dp[i]=0;  
}
for(int i=0;i<m;i++){
dp[nota[i]]=-1;
}
  
cout << rec(n) << endl;  
}


Compiler output:
a.cc: In function 'long long int rec(int)':
a.cc:10:4: error: 'dp' was not declared in this scope; did you mean 'dup'?
   10 | if(dp[i]!=-1){
      |    ^~
      |    dup
a.cc:13:12: error: 'n' was not declared in this scope
   13 | dp[i]=(rec(n-1)+1+rec(n-2)+1+x)%x;
      |            ^
Language: C++

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




long long rec(int i,long long &dp[100010]){
if(i==0)return 0;  
long long x=1000000007;
if(dp[i]!=-1){  
if(i==1)return dp[i]=1;
if(i>1){
dp[i]=(rec(n-1)+1+rec(n-2)+1+x)%x;
}
  return dp[i];
}
else return dp[i];  
  
}
int main(){
long long nota[100010];
long long dp[100010];  
int n,m;
  cin >> n >> m;
for(int i=0;i<100010;i++){
cin >> nota[i];
dp[i]=0;  
}
for(int i=0;i<m;i++){
dp[nota[i]]=-1;
}
  
cout << rec(n) << endl;  
}


Compiler output:
a.cc:7:32: error: declaration of 'dp' as array of references
    7 | long long rec(int i,long long &dp[100010]){
      |                                ^~
a.cc: In function 'long long int rec(...)':
a.cc:8:4: error: 'i' was not declared in this scope
    8 | if(i==0)return 0;
      |    ^
a.cc:10:4: error: 'dp' was not declared in this scope; did you mean 'dup'?
   10 | if(dp[i]!=-1){
      |    ^~
      |    dup
a.cc:10:7: error: 'i' was not declared in this scope
   10 | if(dp[i]!=-1){
      |       ^
a.cc:13:12: error: 'n' was not declared in this scope
   13 | dp[i]=(rec(n-1)+1+rec(n-2)+1+x)%x;
      |            ^
Language: C++

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

int n,m;
long long nota[100010];
long long dp[100010];

long long rec(int i,long long &dp[100010]){
if(i==0)return 0;  
long long x=1000000007;
if(dp[i]!=-1){  
if(i==1)return dp[i]=1;
if(i>1){
dp[i]=(rec(n-1)+1+rec(n-2)+1+x)%x;
}
  return dp[i];
}
else return dp[i];  
  
}
int main(){
int n,m;
  cin >> n >> m;
for(int i=0;i<100010;i++){
cin >> nota[i];
dp[i]=0;  
}
for(int i=0;i<m;i++){
dp[nota[i]]=-1;
}
  
cout << rec(n) << endl;  
}

Compiler output:
a.cc:8:32: error: declaration of 'dp' as array of references
    8 | long long rec(int i,long long &dp[100010]){
      |                                ^~
a.cc: In function 'long long int rec(...)':
a.cc:9:4: error: 'i' was not declared in this scope
    9 | if(i==0)return 0;
      |    ^
a.cc:11:7: error: 'i' was not declared in this scope
   11 | if(dp[i]!=-1){
      |       ^
Language: C++

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

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

// cout << fixed << setprecision(15) <<  << endl;

Compiler output:
a.cc: In function 'int main()':
a.cc:17:9: error: expected ',' or ';' before 'const'
   17 |         const int mod = 1000000007;
      |         ^~~~~
a.cc:24:47: error: 'mod' was not declared in this scope; did you mean 'modf'?
   24 |                 dp[i] = (dp[i+1] + dp[i+2]) % mod;
      |                                               ^~~
      |                                               modf
Language: C++

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

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

// cout << fixed << setprecision(15) <<  << endl;

Compiler output:
a.cc: In function 'int main()':
a.cc:16:27: error: expected primary-expression before ')' token
   16 |         vector<int> dp(n+!)
      |                           ^
a.cc:17:9: error: expected ',' or ';' before 'const'
   17 |         const int mod = 1000000007;
      |         ^~~~~
a.cc:24:47: error: 'mod' was not declared in this scope; did you mean 'modf'?
   24 |                 dp[i] = (dp[i+1] + dp[i+2]) % mod;
      |                                               ^~~
      |                                               modf
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define REP(i,x,n) for(int i = (x); i < (n); ++i)
const long long mod = 1e9+7;
int main(void)
{
    int n, m;
    cin >> n >> m;
    vector<bool> ok(n+1,true);
    rep(i,m){
        int a;
        cin >> a;
        ok[a] = false;
    }
    vector<long long> dp(n+1);
    dp[0]=1;
    REP(now,0,n)REP(next,now+1,min(n,now+2)+1){
        if(ok[next]){
            dp[next] += dp[now];
            dp[next] %= mod;
        }
    }
    cout << dp[n] << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: 'i' was not declared in this scope
   10 |     rep(i,m){
      |         ^
a.cc:10:5: error: 'rep' was not declared in this scope
   10 |     rep(i,m){
      |     ^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define REP(i,x,n) for(int i = (x); i < (n); ++i)
const ll mod = 1e9+7;
int main(void)
{
    int n, m;
    cin >> n >> m;
    vector<bool> ok(n+1,true);
    rep(i,m){
        int a;
        cin >> a;
        ok[a] = false;
    }
    vector<long long> dp(n+1);
    dp[0]=1;
    REP(now,0,n)REP(next,now+1,min(n,now+2)+1){
        if(ok[next]){
            dp[next] += dp[now];
            dp[next] %= mod;
        }
    }
    cout << dp[n] << endl;
    return 0;
}


Compiler output:
a.cc:4:7: error: 'll' does not name a type
    4 | const ll mod = 1e9+7;
      |       ^~
a.cc: In function 'int main()':
a.cc:10:9: error: 'i' was not declared in this scope
   10 |     rep(i,m){
      |         ^
a.cc:10:5: error: 'rep' was not declared in this scope
   10 |     rep(i,m){
      |     ^~~
a.cc:20:25: error: 'mod' was not declared in this scope; did you mean 'modf'?
   20 |             dp[next] %= mod;
      |                         ^~~
      |                         modf
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define REP(i,x,n) for(int i = (x); i < (n); ++i)
const ll mod = 1e9+7;
int main(void)
{
    int n, m;
    cin >> n >> m;
    vector<bool> ok(n+1,true);
    rep(i,m){
        int a;
        cin >> a;
        ok[a] = false;
    }
    vector<long long> dp(n+1);
    dp[0] = dp[1] = 1;
    if(ok[1]==false) dp[1]--;
    REP(i,2,n+1){
        if(!ok[i]) dp[i] = 0;
        else dp[i] = ((dp[i-1]%mod)+(dp[i-2]%mod))%mod;
        dp[i] %= mod;
    }
    cout << dp[n] << endl;
    return 0;
}


Compiler output:
a.cc:5:7: error: 'll' does not name a type
    5 | const ll mod = 1e9+7;
      |       ^~
a.cc: In function 'int main()':
a.cc:21:32: error: 'mod' was not declared in this scope; did you mean 'modf'?
   21 |         else dp[i] = ((dp[i-1]%mod)+(dp[i-2]%mod))%mod;
      |                                ^~~
      |                                modf
a.cc:22:18: error: 'mod' was not declared in this scope; did you mean 'modf'?
   22 |         dp[i] %= mod;
      |                  ^~~
      |                  modf
Language: C++

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

int main(void)
{
    int n, m;
    cin >> n >> m;
    vector<bool> ok(n+1,true);
    rep(i,m){
        int a;
        cin >> a;
        ok[a] = false;
    }
    vector<long long> dp(n+1);
    dp[0]=dp[1]=1;
    if(ok[1]==false) dp[1]--;
    REP(i,2,n+1){
        if(!ok[i]) dp[i] = 0;
        else dp[i] = ((dp[i-1]%mod)+(dp[i-2]%mod))%mod;
        dp[i] %= mod;
    }
    cout << dp[n] << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:32: error: 'mod' was not declared in this scope; did you mean 'modf'?
   21 |         else dp[i] = ((dp[i-1]%mod)+(dp[i-2]%mod))%mod;
      |                                ^~~
      |                                modf
a.cc:22:18: error: 'mod' was not declared in this scope; did you mean 'modf'?
   22 |         dp[i] %= mod;
      |                  ^~~
      |                  modf
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <map>
#include <queue>
#include <deque>
#include <list>
#include <set>
#include <functional>
#include <cmath>
#define REP(i,n) for(lint i{}, i##_len=(n); i<i##_len; ++i)
#define DOUBLE_LOOP(i, h, j, w) for(lint i{}; i < (lint)(h); ++i)for(lint j{}; j < (lint)(w); ++j)
#define DOUBLE_LOOP2(i, j, n) for(lint i{}; i < (lint)(n - 1); ++i)for(lint j{i + 1}; j < (lint)(n); ++j)
#define SZ(x) ((lint)(x).size())
using lint = long long; lint N, M, H, W;
using namespace std;
const long long INF{ 1LL << 60 };
const long double PI{ 3.1415926535897932 };
const long long NUM97{ 1000000007 };
template<class T> inline bool chmax(T& x, T y) { if (x < y) { x = y; return 1; } return 0; }
template<class T> inline bool chmin(T& x, T y) { if (x > y) { x = y; return 1; } return 0; }
std::vector<std::string> field;
std::vector<std::vector<bool>> seen(H, std::vector<bool>(W));
const std::vector<int> dx { 1, 0, -1, 0 };
const std::vector<int> dy { 0, 1, 0, -1 };
void DP_1(){lint n;  std::cin >> n;
	std::vector<lint> dp; dp.resize(N);  for (auto& r : dp) r = INF;
	std::vector<lint> h; h.resize(n); for (auto& r : h) std::cin >> r;
	dp[0] = 0; for (int i = 1; i < N; ++i) {
		chmin(dp[i], dp[i - 1] + std::abs(h[i] - h[i - 1]));
		if (i > 1) { chmin(dp[i], dp[i - 2] + std::abs(h[i] - h[i - 2])); }}
	std::cout << dp[N - 1] << DP_1_Memoization(N - 1, dp, h) << std::endl;}
lint DP_1_Memoization(lint i, std::vector<lint> dp, std::vector<lint> h) {
	if (dp[i] < INF) { return dp[i]; } if (i == 0) { return 0; }
	lint ans{ INF }; chmin(ans, DP_1_Memoization(i - 1, dp, h) + std::abs(h[i] - h[i - 1]));
	if (i > 1) { chmin(ans, DP_1_Memoization(i - 2, dp, h) + std::abs(h[i] - h[i - 2])); }
	return dp[i] = ans;} // memoization

std::vector<lint> a;

int main() {
	std::cin >> N >> M; a.resize(M);
	vector<bool> issafe(N + 1, true);
	std::vector<lint> dp(N + 1, 0);
	for (auto& r : a) { std::cin >> r; issafe[r] = false; }
	dp[0] = 1;
	for (int n = 2; n <= N; ++n) {
		if (issafe[n - 1]) dp[n] += dp[n - 1]; // n-1 段目が安全なら
		if (issafe[n - 2]) dp[n] += dp[n - 2]; // n-2 段目が安全なら
		dp[n] %= NUM97; // 1000000007 で割る
	}
	std::cout << dp[N] << std::endl;
	return 0;
}

Compiler output:
a.cc: In function 'void DP_1()':
a.cc:33:35: error: 'DP_1_Memoization' was not declared in this scope
   33 |         std::cout << dp[N - 1] << DP_1_Memoization(N - 1, dp, h) << std::endl;}
      |                                   ^~~~~~~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

using namespace std;
using ll = long long;

const int mod = 1000000007;
struct mint {
  ll x;
  mint(ll x = 0) : x(x % mod) {}
  mint operator-() const { return mint(-x); }
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) {
      x -= mod;
    }
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod - a.x) >= mod) {
      x -= mod;
    }
    return *this;
  }
  mint& operator*=(const mint a) {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const { return mint(*this) += a; }
  mint operator-(const mint a) const { return mint(*this) -= a; }
  mint operator*(const mint a) const { return mint(*this) *= a; }
  mint pow(ll t) const {
    if (!t) {
      return 1;
    }
    mint a = pow(t >> 1);
    a *= a;
    if (t & 1) {
      a *= *this;
    }
    return a;
  }

  mint inv() const { return pow(mod - 2); }
  mint& operator/=(const mint a) { return *this *= a.inv(); }
  mint operator/(const mint a) { return mint(*this) /= a; }
};

istream& operator>>(istream& is, mint& a) {
  return is >> a.x;
}
ostream& operator<<(ostream& os, const mint& a) {
  return os << a.x;
}

Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:30:24: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
   30 |   else if(n==1) printf('1');
      |                        ^~~
      |                        |
      |                        char
In file included from a.cc:1:
/usr/include/stdio.h:363:43: note:   initializing argument 1 of 'int printf(const char*, ...)'
  363 | extern int printf (const char *__restrict __format, ...);
      |                    ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)n;i++)
typedef int64_t ll;


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<ll> 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:26:45: error: 'mod' was not declared in this scope; did you mean 'modf'?
   26 |                                 dp[next] %= mod;
      |                                             ^~~
      |                                             modf
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
template<class T> inline bool chmax(T& a, T b) {
  if (a < b) { a = b; return 1; }
  return 0; }
template<class T> inline bool chmin(T& a, T b) {
  if (a > b) { a = b; return 1; }
  return 0; }
ll MOD = 1000000007;

int main(void){
  ll n,m; cin >> n >> m;
  ll a[m];
  rep(i,m){
    cin >> a[i];
    if(i > 0 && a[i-1] + 1 == a[i]){
      cout << 0 << endl;
      return 0;
    }
  }
  ll s[100005];
  s[0] = 1;
  s[1] = 1;
  for(int i = 2; i < 100005; i++){
    s[i] = (s[i-1] + s[i-2])%MOD;
  }
  ll ans = 0;
  ans += (s[a[0]-1]);
  if(m == 0){
    ans = s[n-1]
    cout << ans << endl;
    return 0;
  }
  for(int i = 1; i < m; i++){
    if(a[i] - a[i-1] == 2) ans *= 1;
    else ans *= (s[a[i]-a[i-1]-2])%MOD;
  }
  ans *= (s[n-a[m-1]-1])%MOD;
  ans %= MOD;
  cout << ans << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:33:17: error: expected ';' before 'cout'
   33 |     ans = s[n-1]
      |                 ^
      |                 ;
   34 |     cout << ans << endl;
      |     ~~~~
Language: C++

#include <iostream>
using namespace std;

int a[100001] = {0};
int N = 1000000007;

int main () {
	int n, m, temp;
	memset(a, -1, sizeof(a));
	cin >> n >> m;
	for (int i = 1; i <= m; i++) {cin >> temp; a[temp] = 0;}
	if (a[1] != 0) a[1] = 1;
	if (a[2] != 0 && a[1] == 0) a[2] = 1;
	if (a[2] != 0 && a[1] != 0) a[2] = 2;
	for (int i = 3; i <= n; i++) {
		a[i] = (a[i] == 0) ? 0 : (a[i-1] % N + a[i-2] % N) % N;
	}
	cout << a[n] << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:9: error: 'memset' was not declared in this scope
    9 |         memset(a, -1, sizeof(a));
      |         ^~~~~~
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 | using namespace std;
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
const ll MOD = 1e9 + 7;
#define rep1(i, n) for (ll i=0; i<(n); i++) 
#define rep2(i, k, n) for (ll i=k; i<(n); i++)
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
int main() {
    ll n, m;
    cin >> n >> m;
    vector<ll> a(m+1, 0), b(m, 0);
    rep1(i, m) cin >> a[i];
    rep1(i, m-1){
        if (a[i+1] - a[i]<=1){
            cout << 0 << endl;
            return 0;
        }
        b[i] = a[i+1] - a[i] - 2;
    
    return 0;
    //printf("%.12f", ans);
}


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

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
const ll MOD = 1e9 + 7;
#define rep1(i, n) for (ll i=0; i<(n); i++) 
#define rep2(i, k, n) for (ll i=k; i<(n); i++)
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }


int main() {
    ll n, m, a;
    cin >> n >> m;
    vector<ll> b(n+100, 0);
    rep1(i, m){
        cin >> a;
        b[a]++;
    }
    vector<ll> dp(n+100, 0);
    dp[0] = 1;
    rep1(i, n){
        rep2(j, 1, 3){
            if (b[i+j]) continue;
            dp[i+j] += dp[i];
            dp[i+j] %= MOD;
    }
    cout << dp[n] << endl;
    return 0;
    //printf("%.12f", ans);
}

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

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
const ll MOD = 1e9 + 7;
#define rep1(i, n) for (ll i=0; i<(n); i++) 
#define rep2(i, k, n) for (ll i=k; i<(n); i++)
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }


int main() {
    ll n, m, a;
    cin >> n >> m;
    vector<ll> b(n+100, 0);
    rep1(i, m){
        cin >> a;
        b[a]++;
    }
    vector<ll> dp(n+100, 0);
    dp[0] = 1;
    rep1(i, n+){
        rep2(j, 1, 3){
            if (b[i+j]) continue;
            dp[i+j] += dp[i];
            dp[i+j] %= MOD;
        }
    }
    cout << dp[n] << endl;
    return 0;
    //printf("%.12f", ans);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:37: error: expected primary-expression before ')' token
    6 | #define rep1(i, n) for (ll i=0; i<(n); i++)
      |                                     ^
a.cc:22:5: note: in expansion of macro 'rep1'
   22 |     rep1(i, n+){
      |     ^~~~
Language: C++

#include <iostream>
#include <math.h>

using namespace std;

int main(){
    int N,M;
    cin >> N >> M;
    int s[N+1];
    for(int i=0;i<=N;i++){
        s[i]=0;
    }
    for(int i=0;i<M;i++){
        int a; cin >> a;
        s[a]=1;
    }

    int dp[N+1];
    dp[0]=1;
    for(int i=1;i<N+1;i++){
        dp[i]=0;
    }
    for(int i=0;i<N-1;i++){
        for(int j=i+1;j<=min(i+2;N);j++){
            if(s[i]==0){
            dp[j]+=dp[i];
            }

        }
    }
    
    cout << dp[N]%1000000007<<endl;
  //cout << dp[2] << endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:33: error: expected ')' before ';' token
   24 |         for(int j=i+1;j<=min(i+2;N);j++){
      |                             ~   ^
      |                                 )
a.cc:24:37: error: 'j' was not declared in this scope
   24 |         for(int j=i+1;j<=min(i+2;N);j++){
      |                                     ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
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]+=do[now];
        dp[next]%=mod;
      }
    }
  }
  
  cout << dp[N] << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:19: error: expected primary-expression before 'do'
   19 |         dp[next]+=do[now];
      |                   ^~