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

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <functional>
#include <limits>
#include <queue>
#include <iomanip>
#include <deque>
#include <stack>
#include <cstdio>
#include <cmath>
#include <complex.h>
#include <cstdio>
#include <random>
#include <chrono>
#include <numeric>
#include <cassert>
#include <iso646.h>
#include <exception>
#include <stdexcept>
#include <iterator>
#include <sstream>

using namespace std;

typedef long long i64;

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

    int n;
    cin >> n;

    int a[52] = {};
    for (int i = 1; i <= n; i++)
        cin >> a[i];

    vector<pair<int, int>> ops;
    for (int cnt = 0; cnt < 10000; cnt++)
    {
        int max_prefix[52] = { -1e9 };
        int max_prefix_id[52];
        for (int i = 1; i <= n; i++)
        {
            if (a[i] > max_prefix[i - 1])
            {
                max_prefix[i] = a[i];
                max_prefix_id[i] = i;
            }
            else
            {
                max_prefix[i] = max_prefix[i - 1];
                max_prefix_id[i] = max_prefix_id[i - 1];
            }
        }

        int min_suffix[52];
        min_suffix[n + 1] = 1e9;
        int min_suffix_id[52];
        for (int i = n; i >= 1; i--)
        {
            if (a[i] < min_suffix[i + 1])
            {
                min_suffix[i] = a[i];
                min_suffix_id[i] = i;
            }
            else
            {
                min_suffix[i] = min_suffix[i + 1];
                min_suffix_id[i] = min_suffix_id[i + 1];
            }
        }

        for (int i = n; i >= 1; i--)
        {
            if (a[i] >= 0)
            {
                if (a[i] < max_prefix[i])
                {
                    a[i] += max_prefix[i];
                    ops.push_back({ max_prefix_id[i], i });
                }
            }
            else
            {
                if (a[i] < max_prefix[i] && max_prefix[i] > 0)
                {
                    a[i] += max_prefix[i];
                    ops.push_back({ max_prefix_id[i], i });
                }
                else if (a[i] > min_suffix[i])
                {
                    a[i] += min_suffix[i];
                    ops.push_back({ min_suffix_id[i], i });
                }
            }
        }
    }

    cout << ops.size() << endl;
    for (const auto& p : ops)
        cout << p.first << ' ' << p.second << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:47:32: error: narrowing conversion of '-1.0e+9' from 'double' to 'int' [-Wnarrowing]
   47 |         int max_prefix[52] = { -1e9 };
      |                                ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
const int N=2e3+5;
int n,a[N],p1,p2; 
int main()
{
	cin>>n;
	int mx=-1e9,mn=1e9;
	for(int i=1;i<=n;i++)
	{
		cin>>a[i];//mn=min(mn,a[i]),mx=max(mx,a[i]); 
		if(mx<a[i])
			mx=a[i],p1=i;
		if(mn>a[i])
			mn=a[i],p2=i;
	}
	if(mx>abs(mn))
	{
		for(int i=1;i<=n;i++)
			if(a[i]<0)
				res.push_back(ii(p1,i));
		for(int i=1;i<n;i++)
			res.push_back(ii(i+1,i));
	}
	else
	{
		for(int i=1;i<=n;i++)
			if(a[i]>0)
				res.push_back(ii(p2,i));
		for(int i=n;i>1;i--)
			res.push_back(ii(i-1,i));	
	}
	printf("%d\n",res.size());
	for(int i=0;i<res.size();i++)
		printf("%d %d\n",res[i].first,res[i].second);
	return 0;	
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:21:33: error: 'res' was not declared in this scope
   21 |                                 res.push_back(ii(p1,i));
      |                                 ^~~
a.cc:21:47: error: 'ii' was not declared in this scope; did you mean 'i'?
   21 |                                 res.push_back(ii(p1,i));
      |                                               ^~
      |                                               i
a.cc:23:25: error: 'res' was not declared in this scope
   23 |                         res.push_back(ii(i+1,i));
      |                         ^~~
a.cc:23:39: error: 'ii' was not declared in this scope; did you mean 'i'?
   23 |                         res.push_back(ii(i+1,i));
      |                                       ^~
      |                                       i
a.cc:29:33: error: 'res' was not declared in this scope
   29 |                                 res.push_back(ii(p2,i));
      |                                 ^~~
a.cc:29:47: error: 'ii' was not declared in this scope; did you mean 'i'?
   29 |                                 res.push_back(ii(p2,i));
      |                                               ^~
      |                                               i
a.cc:31:25: error: 'res' was not declared in this scope
   31 |                         res.push_back(ii(i-1,i));
      |                         ^~~
a.cc:31:39: error: 'ii' was not declared in this scope; did you mean 'i'?
   31 |                         res.push_back(ii(i-1,i));
      |                                       ^~
      |                                       i
a.cc:33:23: error: 'res' was not declared in this scope
   33 |         printf("%d\n",res.size());
      |                       ^~~
Language: C++

//Priyanshu Kumar : IIIT Allahabad
#include<bits/stdc++.h>
using namespace std;

#define ll long long int
#define MAX 100005
#define MOD 1000000007
#define sz size()
#define ln length()
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define si(n) scanf("%d",&n)
#define sl(n) scanf("%lld",&n)
#define pi(n) printf("%d",n)
#define pin(n) printf("%d\n",n);
#define pl(n) printf("%lld",n)
#define pln(n) printf("%lld\n",n);
#define FUCK_YEAH ios_base::sync_with_stdio(false);cin.tie(NULL)
inline ll gcd(ll x,ll y){return x%y==0?y:gcd(y,x%y);}
inline ll lcm(ll x,ll y){return x*(y/gcd(x,y));}
inline ll powmod(ll a,ll b,ll mod) 
{
	ll res=1;
	a%=mod; 
	assert(b>=0); 
	for(;b;b>>=1)
	{
		if(b&1)res=res*a%mod;
		a=a*a%mod;
	}
	return res;
}
inline ll mulmod(ll a, ll b, ll c)
{
	if(!b)return 0;
	ll x = mulmod(a, b/2, c);
	if (b & 1)return (x+x+a)%c;
	return (x+x)%c;
}

int main()
{
	FUCK_YEAH;
	ll n,xx,yy;
	cin >> n;
	ll a[n];
	for(int i=0;i<n;i++) {
		cin >> a[i];
	}
	vector <pair<ll,ll> > v;
	for(int i=0;i<n-1;i++) {
		xx = a[i];
		yy = a[i+1];
		if(xx <= yy) {
			continue;
		}
		else if(xx < 0 && yy < 0) {
			xx += yy;
			v.pb(mp(i+1,i));
		}
		else if(xx >= 0 && yy >= 0) {
			yy += xx;
			v.pb(mp(i,i+1));
		}
		else if(xx >= 0 && yy < 0){
			if(abs(xx) >= abs(yy)) {
				yy += (2*xx);
				v.pb(mp(i,i+1));
				v.pb(mp(i,i+1));
			}
			else {
				xx += (2*yy);
				v.pb(mp(i+1,i));
				v.pb(mp(i+1,i));
			}
		}
		else {
			assert(0);
		}
		a[i] = xx;
		a[i+1] = yy;
	}
	if(v.size() >= 0 && v.size() <= 2*n)
	else cout << 1/0;
	for(int i=0;i<n-1;i++) {
		assert(a[i] <= a[i+1]);
	}
	cout << v.size() << endl;
	for(int i=0;i<v.size();i++) {
		cout << v[i].fi + 1 << " " << v[i].se + 1<< endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:86:9: error: expected primary-expression before 'else'
   86 |         else cout << 1/0;
      |         ^~~~
Language: C++

n = input()
a = map(int, raw_input().split())
seq = []
for i in range(n - 1):
    if a[i] <= a[i + 1]:
        continue
    if a[i] > 0 and a[i + 1] > 0:
        seq.append((i, i + 1))
    elif a[i] < 0 and a[i + 1] < 0:
        seq.append((i + 1, i))
    else:
        if abs(a[i]) > abs(a[i + 1]):
            seq.append((i, i + 1))
            seq.append((i, i + 1))
        else:
            seq.append((i + 1, i))
            seq.append((i + 1, i))

print len(seq)
for (a, b) in seq:
    print a + 1, b + 1


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

#include <bits/stdc++.h>
using namespace std;
constexpr int P = 1'000'000'007;
int main() {
  std::ios_base::sync_with_stdio(false);
  std::cin.tie(nullptr);
  std::cout.tie(nullptr);
  int n;
  in >> n;
  vector<vector<int>> graph(n+1);
  for (int i = 1, p; i <= n; ++i) {
    in >> p;
    graph[p].push_back(i);
  }
  int i2 = (P + 1) / 2;
  using dp_t = deque<array<int, 2>>;
  function<dp_t(int, int)> dfs = [&](int u, int p) {
    dp_t res;
    for (int v : graph[u]) {
      if (v != p) {
        dp_t rhs = dfs(v, u);
        if (rhs.size() > res.size())
          swap(rhs, res);
        for (int depth = 0; depth < (int) rhs.size(); ++depth) {
          res[depth][1] = ((int64_t) res[depth][1] * rhs[depth][0] + (int64_t) res[depth][0] * rhs[depth][1]) % P;
          res[depth][0] = (int64_t) res[depth][0] * rhs[depth][0] % P;
        }
      }
    }
    for (array<int, 2> &val : res)
      val[0] = (1 - val[1]);
    res.push_front({i2, i2});
    return res;
  };
  int p2 = 1;
  for (int i = 0; i <= n; ++i) (p2 *= 2) %= P;
  int ans = 0;
  dp_t dp = dfs(0, -1);
  for (array<int, 2> d : dp)
    (ans += d[1]) %= P;
  cout << (int64_t) ans * p2 % P << '\n';
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:3: error: 'in' was not declared in this scope; did you mean 'n'?
    9 |   in >> n;
      |   ^~
      |   n
Language: C++

#include <iostream>

#define int long long
#define MOD 1000000007

signed main() {
  int n;
  std::cin >> n;
  
  int h[n+1], bin[n+1], c[n+1];
  h[0] = 0;
  c[0] = 1;
  bin[0] = 1;
  
  for(int i = 1; i <= n; i++) {
    int x;
    std::cin >> x;
    h[i] = h[x]+1;
    c[h[i]]++;
    bin[i] = (bin[i-1]*2)%MOD;
  }
  
  int ans = 0;
  for(int i = 0; i <= n; i++) {
    ans = (ans + c[i]*bin[n-c[i]])%MOD;
  }
  
  std::cout << std::endl;
  
  return 0
 }

Compiler output:
a.cc: In function 'int main()':
a.cc:30:11: error: expected ';' before '}' token
   30 |   return 0
      |           ^
      |           ;
   31 |  }
      |  ~
Language: C++

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<functional>
#include<vector>
#include<queue>
#include<stack>
#include<set>
#include<map>
using namespace std;
#define MOD 1000000007
#define f(i,n) for(int i=0;i<int(n);i++)
#define N 300000

vector<int>e[N];


vector<long long> dfs(int k){

vector< vector<long long> >a;
vector<pair<int,int> >c;
  vector<long long>d;
int m;
long long ww,xx,yy,zz;

f(i,e[k].size()){
d=dfs(e[k][i]);
a.push_back(d);
c.push_back(make_pair(d.size(),i));
}

if(c.size()>0){
sort(c.begin(),c.end(),greater<pair<int,int> >());
vector<long long>b(a[c[0].second]);

if(c.size()>1){

f(i,c[1].first){
m=0;

f(j,c.size()){
if(c[j].first>i)m++;
else break;
}

xx=1;
zz=0;

f(j,m){
ww=a[c[j].second][c[j].first-i-1];
yy=(MOD+1-ww);
if(yy>=MOD)yy=yy%MOD;

zz=zz*yy;
zz=zz%MOD;

ww=ww*xx;
ww=ww%MOD;
zz+=ww;
zz=zz%MOD;

xx=xx*yy;
xx=xx%MOD;
}

b[c[0].first-i-1]=zz;

}

}
}
  else{
   vector<long long>b; 
  }
b.push_back(((MOD+1)/2));
return b;
}




int main(){
	vector<long long>a;
	int n, x;
	long long ans;
	ans = 0;
	scanf("%d", &n);
	f(i,n){
		scanf("%d", &x);
		e[x].push_back(i+1);
	}

a=dfs(0);
f(i,a.size()){
ans+=a[i];
ans=ans%MOD;
}
f(i,n+1){
ans=ans*2;
ans=ans%MOD;
}
	printf("%lld\n", ans);


	return 0;
}


Compiler output:
a.cc: In function 'std::vector<long long int> dfs(int)':
a.cc:77:1: error: 'b' was not declared in this scope
   77 | b.push_back(((MOD+1)/2));
      | ^
Language: C++

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<functional>
#include<vector>
#include<queue>
#include<stack>
#include<set>
#include<map>
using namespace std;
#define MOD 1000000007
#define f(i,n) for(int i=0;i<int(n);i++)
#define N 300000

vector<int>e[N];


vector<long long> dfs(int k){

vector< vector<long long> >a;
vector<pair<int,int> >c;
  vector<long long>d;
int m;
long long ww,xx,yy,zz;

f(i,e[k].size()){
d=dfs(e[k][i]);
a.push_back(d);
c.push_back(make_pair(d.size(),i));
}

if(c.size()>0){
sort(c.begin(),c.end(),greater<pair<int,int> >());
vector<long long>b(a[c[0].second]);

if(c.size()>1){

f(i,c[1].first){
m=0;

f(j,c.size()){
if(c[j].first>i)m++;
else break;
}

xx=1;
zz=0;

f(j,m){
ww=a[c[j].second][c[j].first-i-1];
yy=(MOD+1-ww);
if(yy>=MOD)yy=yy%MOD;

zz=zz*yy;
zz=zz%MOD;

ww=ww*xx;
ww=ww%MOD;
zz+=ww;
zz=zz%MOD;

xx=xx*yy;
xx=xx%MOD;
}

b[c[0].first-i-1]=zz;

}

}
}
b.push_back(((MOD+1)/2));
return b;
}




int main(){
	vector<long long>a;
	int n, x;
	long long ans;
	ans = 0;
	scanf("%d", &n);
	f(i,n){
		scanf("%d", &x);
		e[x].push_back(i+1);
	}

a=dfs(0);
f(i,a.size()){
ans+=a[i];
ans=ans%MOD;
}
f(i,n+1){
ans=ans*2;
ans=ans%MOD;
}
	printf("%lld\n", ans);


	return 0;
}


Compiler output:
a.cc: In function 'std::vector<long long int> dfs(int)':
a.cc:74:1: error: 'b' was not declared in this scope
   74 | b.push_back(((MOD+1)/2));
      | ^
Language: C++

#include <cstdio>
#include <cstring>
#include <string>
#include <iostream>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <complex>
#define MOD 1000000007LL

using namespace std;
typedef long long int ll;
typedef pair<int, int> P;

ll inv(ll a){
    if(a==0) return 0;
    ll ap=a, ans=1, k=MOD-2;
    while(k>0){
        if(k%2==1){
            ans*=ap;
            ans%=MOD;
        }
        ap=ap*ap;
        ap%=MOD;
        k/=2;
    }
    return ans;
}

vector<int> v[200001];
int d[200001], dmax;
vector<int> dist[200001];
int pp[200001];

void dfs(int x){
	for(auto y:v[x]){
		if(d[y]<0){
			d[y]=d[x]+1;
			dist[d[y]].push_back(y);
			dmax=max(d[y], dmax);
			dfs(y);
		}
	}
}

int p1;

void dfs2(int x){
	int ct=0;
	for(auto y:v[x]){
		if(d[y]>d[x]) ct++;
	}
	if(ct>1){
		for(auto y:v[x]){
			if(d[y]<d[x]) continue;
			p1=y;
			dfs2(y);
		}
	}
	if(ct==1){
		for(auto y:v[x]){
			if(d[y]<d[x]) continue;
			pp[y]=p1;
			dfs2(y);
		}
	}
}

map<int, vector<int> > g;

void dfs3(int x){
	bool e=0;
	if(g[pp[x]].empty()) e=1;
	g[pp[x]].push_back(x);
	if(e && pp[x]!=0) dfs3(pp[x]);
}

ll dfs4(int x){
	if(g[x].empty()){
		return 500000004;
	}
	ll sum=0, prod=1;
	for(auto y:g[x]){
		ll c=dfs4(y);
		sum+=(c*inv((MOD+1-c)%MOD, MOD)%MOD);
		sum%=MOD;
        prod*=(MOD+1-c);
        prod%=MOD;
	}
	return sum*prod%MOD;
}

int main()
{
	int n;
	scanf("%d", &n);
	for(int i=1; i<=n; i++){
		scanf("%d", &pp[i]);
		v[i].push_back(pp[i]);
		v[pp[i]].push_back(i);
	}
	fill(d, d+n+1, -1);
	d[0]=0;
	dist[0].push_back(0);
	dfs(0);
	dfs2(0);
	ll p2=1;
	for(int i=0; i<=n; i++){
		p2*=2;
		p2%=MOD;
	}
	ll ans=0;
	for(int t=0; t<=dmax; t++){
		if(t==0){
			ans+=500000004;
			continue;
		}
		g.clear();
		for(auto x:dist[t]){
			dfs3(x);
		}
		ans+=dfs4(0);
		ans%=MOD;
	}
	ans*=p2;
	ans%=MOD;
	printf("%lld\n", ans);
	return 0;
}

Compiler output:
a.cc: In function 'll dfs4(int)':
a.cc:90:28: error: too many arguments to function 'll inv(ll)'
   90 |                 sum+=(c*inv((MOD+1-c)%MOD, MOD)%MOD);
      |                         ~~~^~~~~~~~~~~~~~~~~~~~
a.cc:20:4: note: declared here
   20 | ll inv(ll a){
      |    ^~~
Language: C++

#include <iostream>
#include <queue>
#include <algorithm>
#include <functional>
#include <utility>
#include <climits>

#include <boost/rational.hpp>
 
#include <cstdio>
 
using namespace std;

#define REP(var, count) for(int var=0; var<count; var++)

int parent[200100];
//int cnt[200100];
vector<int> children[200100];

const long long int MOD = 1000000007;

using RAT = boost::rational<long long int>;
//using RAT = pair<long long int, long long int>; //X mod MOD,  2^x

queue<RAT> func(int x) {
    int sibl = children[x].size();
   
    queue<RAT> ret;
    ret.push( RAT(1,2) );
    if ( sibl == 0 ) { return ret; }
   
    vector< queue<RAT> > kaku;
    for( int c : children[x] ) {
        kaku.push_back ( func(c) );
    }
   
    while(true) {
        bool popped = false;
        vector<RAT> ra;
        for( auto& q : kaku ) {
            if ( q.size() ) {
                ra.push_back ( q.front() );
                q.pop();
                popped = true;
            } else {
                ra.push_back(0);
            }
        }
       
        if ( !popped ) { break; }
        RAT mo(0);
        REP(i, sibl) {
            RAT re = 1;
            REP(j, sibl) {
				/*
                if ( i == j ) {
                    long long int bunbo = re.second + ra[j].second;
                    long long int bunsi = (re.first * ra[j].first) % MOD;
                    re = make_pair(bunsi, bunbo);
                } else {
               
                }
				*/
                re = (re * ((i==j)?ra[j] : (1-ra[j])));
				//re = RAT( re.numerator()
            }
           
            mo += re;
        }
       
        ret.push(mo);
    }

    return ret;
}


int main(void) {
    int N;
    cin >> N;
	
	if ( N > 2000 ) { cout << "NO" << endl; return; }

    for(int i=1; i<=N; i++) {
        int p;
        cin >> p;
        parent[i] = p;
       
        children[p].push_back(i);
    }

    auto q = func(0);
    RAT sum = 0;
    while(q.size()) {
        RAT f = q.front();
        sum += f;
        q.pop();
    }
   
    //cout << sum << endl;
   
    long long int test = 1;
    REP(xxx, N+1) {
        test *= 2;
        //test = test % MOD;
    }
	//cout << test << endl;
    cout << boost::rational_cast<long long int>(sum * test) % MOD << endl;
}

Compiler output:
a.cc:8:10: fatal error: boost/rational.hpp: No such file or directory
    8 | #include <boost/rational.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <cstdio>
#include <iostream>
#include <cstring>
#include <string>
#include <cmath>
#include <algorithm>
#include <cstdlib>
#include <utility>
#include <map>
#include <stack>
#include <set>
#include <vector>
#include <queue>
#include <deque>
#include <sstream>
#define x first
#define y second
#define mp make_pair
#define pb push_back
#define pf push_front
#define LL long long
#define Pair pair<int,int>
#define LOWBIT(x) x & (-x)
using namespace std;

const int MOD=1e9+7;
const int INF=2e9;
const int magic=348;
const LL LINF=2e16;
const double eps=1e-10;
const int Ni=500000004;

inline int getint()
{
	char ch;
	while ((ch=getchar())<'0' || ch>'9') {}
	int res=ch-'0';
	while ((ch=getchar())>='0' && ch<='9') res=res*10+ch-'0';
	return res;
}

struct node
{
	LL x,y,z;
};

vector<int> v[200048];
vector<node> q[200048];
int deq_num[200048],tot=0;
int n;

bool cmp(int x,int y)
{
	return q[deq_num[x]].size()<q[deq_num[y]].size();
}

void dfs(int cur)
{
	node ins;int sz=v[cur].size();
	if (sz==0)
	{
		deq_num[cur]=++tot;
		ins.x=ins.y=Ni;ins.z=0;
		q[tot].pb(ins);
		return;
	}
	int i,j,j1,j2,num1,num2,xx,yy,zz;
	for (i=0;i<sz;i++) dfs(v[cur][i]);
	//sort(v[cur].begin(),v[cur].end(),cmp);
	for (i=1;i<sz;i++) if (!cmp(v[cur][i-1],v[cur][i])) swap(v[cur][i-1],v[cur][i]);
	for (i=0;i<=sz-2;i++)
	{
		num1=deq_num[v[cur][i]];num2=deq_num[v[cur][sz-1]];
		for (j=0;j<q[num1].size();j++)
		{
			j1=q[num1].size()-1-j;j2=q[num2].size()-1-j;
			xx=q[num2][j2].x;yy=q[num2][j2].y;zz=q[num2][j2].z;
			q[num2][j2].x=(xx*q[num1][j1].x)%MOD;
			q[num2][j2].y=((xx*q[num1][j1].y)%MOD+(yy*q[num1][j1].x)%MOD)%MOD;
			q[num2][j2].z=((xx*q[num1][j1].z)%MOD+(yy*q[num1][j1].y)%MOD+(yy*q[num1][j1].z)%MOD+(zz*q[num1][j1].x)%MOD+(zz*q[num1][j1].y)%MOD+(zz*q[num1][j1].z))%MOD;
		}
	}
	deq_num[cur]=deq_num[v[cur][sz-1]];int Num=deq_num[cur];
	for (i=0;i<q[Num].size();i++)
	{
		q[Num][i].x=(q[Num][i].x+q[Num][i].z)%MOD;
		q[Num][i].z=0;
	}
	ins.x=ins.y=Ni;ins.z=0;
	q[Num].pb(ins);
}

int mypow()
{
	LL res=1;int i;
	for (i=1;i<=n+1;i++) res=(res*2)%MOD;
	return int(res);
}

int main ()
{
	int i,x;
	n=getint();
	for (i=1;i<=n;i++)
	{
		x=getint();
		v[x].pb(i);
	}
	dfs(0);
	int Num=deq_num[0];LL ans=0;
	for (i=0;i<q[Num].size();i++) ans=(ans+q[Num][i].y)%MOD;
	ans=(ans*mypow())%MOD;
	cout<<ans<<endl;
	return 0;


Compiler output:
a.cc: In function 'int main()':
a.cc:114:18: error: expected '}' at end of input
  114 |         return 0;
      |                  ^
a.cc:101:1: note: to match this '{'
  101 | {
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
const int mod = 1e9 + 7;
int n, m, p[200010],id[200010],ans;
vector <int> son[200010],f[200010],g[200010],s,tim;
 
int qpow(int a, int b)
{
	int x = a;  
	a = 1;
	while (b)
	{
		if (b & 1) a = 1LL * a * x % mod;
		x = 1LL * x * x % mod, b >>= 1;
	}
	return a;
}
 
void dfs(int x)
{
	int hs = -1, ID;
	for (auto y : son[x])
	{
		dfs(y);
		if ((hs < 0) || (f[id[y]].size() > f[id[hs]].size())) hs = y;
	}
	if (hs < 0)
	{
		id[x] = ++ m;
		f[m].push_back(1);
		g[m].push_back(1);
		return;
	}
	ID = id[x] = id[hs];
	for (auto y : son[x])
		if (y != hs)
		{
			int d = f[ID].size() - f[id[y]].size();
			for (int i = 0; i < (int)f[id[y]].size(); i ++)
			{
				if (tim[i + d] != x) s[i + d] = (qpow(2, g[ID][i + d]) + mod - f[ID][i + d]) % mod, tim[i + d] = x;
				f[ID][i + d] = 1LL * f[ID][i + d] * (qpow(2, g[id[y]][i]) + mod - f[id[y]][i]) % mod;
				f[ID][i + d] = (f[ID][i + d] + 1LL * s[i + d] * f[id[y]][i]) % mod;
				g[ID][i + d] += g[id[y]][i];
				s[i + d] = 1LL * s[i + d] * (qpow(2, g[id[y]][i]) + mod - f[id[y]][i]) % mod;
			}
		}
	f[id[x]].push_back(1);
	g[id[x]].push_back(1);
}
 
 
int main()
{
	scanf("%d", &n);
	s.resize(n + 1);
	tim.resize(n + 1, -1);
	rep(i, 1, n)
		p[i] = read(),
		son[p[i]].push_back(i);
	dfs(0);
	for (int i = 0; i < f[id[0]].size(); i ++)
		ans = (ans + 1LL * f[id[0]][i] * qpow(2, n + 1 - g[id[0]][i])) % mod;
	printf("%d", ans);
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:59:13: error: 'i' was not declared in this scope
   59 |         rep(i, 1, n)
      |             ^
a.cc:59:9: error: 'rep' was not declared in this scope
   59 |         rep(i, 1, n)
      |         ^~~
Language: C++

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

#define DEBUG(x) cout<<#x<<": "<<x<<endl;
#define DEBUG_VEC(v) cout<<#v<<":";for(int i=0;i<v.size();i++) cout<<" "<<v[i]; cout<<endl

typedef long long ll;
#define vi vector<int>
#define vl vector<ll>
#define vii vector< vector<int> >
#define vll vector< vector<ll> >
#define vs vector<string>
#define pii pair<int,int>
#define pis pair<int,string>
#define psi pair<string,int>
#define pll pair<ll,ll>
const int inf = 1000000001;
const ll INF = 1e18 * 2;
#define MOD 1000000007
#define mod 1000000009
#define pi 3.14159265358979323846
#define Sp(p) cout<<setprecision(15)<< fixed<<p<<endl;
int dx[4] = { 1,0,-1,0 }, dy[4] = { 0,1,0,-1 };
int dx2[8] = { 1,1,0,-1,-1,-1,0,1 }, dy2[8] = { 0,1,1,1,0,-1,-1,-1 };

#define N 200050
vi d(N + 1, inf);
vi child(N + 1); //sのこの数
vl num(N + 1, 0); //深さiが何個あるか
vll fukasa(N + 1,vl()); //深さiのやつのリスト
vii G(N + 1, vi());
vl fact(N);
int n;

vll one(N + 1, vl(2));

void dfs1(int s, int now) {
	d[s] = now;
	child[s] = G[s].size();
	for (int i = 0; i < G[s].size(); i++) {
		dfs1(G[s][i], now + 1);
	}
	return;
}

ll mod_pow(ll x, ll p, ll M) {
	ll a = 1;
	while (p) {
		if (p % 2)
			a = a*x%M;
		x = x*x%M;
		p /= 2;
	}
	return a;
}

ll mod_inverse(ll a, ll m) {
	return mod_pow(a, m - 2, m);
}

ll nCr(ll n, ll r) {
	ll ret = fact[n];
	ret = (ret*mod_inverse(fact[r], MOD)) % MOD;
	ret = (ret*mod_inverse(fact[n - r], MOD)) % MOD;
	return ret;
}

pll dfs2(int s) {
	if (child[s] == 0) {
		one[s][0] = one[s][1] = 1;
		return pll(1, 1);
	}
	vector<pll> list(child[s]);
	ll mul = 1;
	for (int i = 0; i < list.size(); i++) {
		list[i] = dfs2(G[s][i]);
		mul *= list[i].second;
	}
	ll temp = 0;
	for (int i = 0; i < list.size(); i++) {
		temp += mul / list[i].second * list[i].first % MOD;
	}
	return pll(temp, mod_pow(2, temp) - temp);
}

int main() {
	int i, j;
	cin >> n;

	fact[0] = 1;
	for (i = 1; i <= n + 10; i++) {
		fact[i] = (fact[i - 1] * i) % MOD;
	}
	
	vi p(n + 1);
	for (i = 1; i <= n; i++) {
		cin >> p[i];
		G[p[i]].push_back(i);
	}
	dfs1(0, 0);

	
	for (i = 0; i <= n; i++) {
		num[d[i]]++;
		fukasa[d[i]].push_back(i);
	}
	auto ans = dfs2(0);
	cout << ans.first << endl;
}

Compiler output:
a.cc: In function 'std::pair<long long int, long long int> dfs2(int)':
a.cc:83:33: error: too few arguments to function 'll mod_pow(ll, ll, ll)'
   83 |         return pll(temp, mod_pow(2, temp) - temp);
      |                          ~~~~~~~^~~~~~~~~
a.cc:46:4: note: declared here
   46 | ll mod_pow(ll x, ll p, ll M) {
      |    ^~~~~~~
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include "loquat/math/modulus_integer.hpp"

using namespace std;
static constexpr int MOD = 1000000007;
using mint = loquat::modulus_integer<MOD>;

int main(){
	ios_base::sync_with_stdio(false);
	int n;
	cin >> n;
	++n;
	vector<int> p(n);
	for(int i = 1; i < n; ++i){ cin >> p[i]; }
	vector<vector<int>> conn(n);
	for(int i = 1; i < n; ++i){ conn[p[i]].push_back(i); }
	vector<mint> one(n), all(n);
	for(int i = 0; i < n; ++i){
		one[i] = 1;
		all[i] = 2;
	}
	mint total = 1;
	for(int i = 0; i < n; ++i){ total *= 2; }
	mint answer = 0;
	for(int i = 0; i < n; ++i){
		answer += one[0] * (total / all[0]);
		for(int u = 0; u < n; ++u){
			mint acc_other = 1, acc_all = 1;
			for(const int v : conn[u]){
				acc_other *= all[v] - one[v];
				acc_all *= all[v];
			}
			mint new_one = 0;
			for(const int v : conn[u]){
				new_one += (acc_other / (all[v] - one[v])) * one[v];
			}
			one[u] = new_one;
			all[u] = acc_all;
		}
	}
	cout << answer << endl;
	return 0;
}



Compiler output:
a.cc:5:10: fatal error: loquat/math/modulus_integer.hpp: No such file or directory
    5 | #include "loquat/math/modulus_integer.hpp"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

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

#define int long long

#define pb push_back
#define mp make_pair
#define st first
#define nd second
typedef pair < int , int > pp;
const int mod = 1e9 + 7;
const int N   = 2e2 + 2;

unordered_map < string , vector<pp> > M;

int A[N],T[N],n,k,j,i,ii,mn,x,las,ans;
string has;

int f(int l, int r){
    if(l == -1) return 0;
    int i, t=0;
    for(i=60; i>=0; i--){
        t += ((r >> i) & 1) > 0;
        if((l >> i) & 1 != (r >> i) & 1)
            break;
    }
    return t;
}

signed main(){
    cin >> n >> k;
    for(i=1;i<=n;i++) cin >> A[i];
    sort(A+1 , A+n+1);

    for(j=0;j<=60;j++){
        for(i=1;i<=n;i++) T[i] = A[i] - ((A[i] >> j) << j);
        sort(T+1 , T+n+1);
        T[0] = -1;
        T[n+1] = (1LL << j) - 1;
        for(i=0;i<=n;i++){
            if(T[i] == T[i+1]) continue;
            mn = A[1] >> j;
            if(A[1] - ((A[1] >> j) << j) <= T[i]) mn--;
            if(mn == -1) assert(0);
            has = "";
            for(ii=2;ii<=n;ii++){
                x = A[ii] >> j;
                if(A[ii] - ((A[ii] >> j) << j) <= T[i]) x--;
                x -= mn;
                for(; x ; x /= 255) has += (char)(x%255);
                has += (char)255;
            }
    
            if(k >= f(T[i] , T[i+1]) + j)
                M[has].pb(mp(max(0LL , mn-k+f(T[i] , T[i+1])+j) , mn));
        }
    }
    
    for(auto t: M){
        vector< pp > &r = t.nd;
        sort(r.begin() , r.end());
        las = 0;
        for(auto x: r){
            x.st = max(x.st , las);
            ans = (ans + max(0LL , x.nd - x.st + 1)) % mod;
            las = max(las , x.nd+1);
        }
    }
    
    cout << ans;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:47:26: error: 'assert' was not declared in this scope
   47 |             if(mn == -1) assert(0);
      |                          ^~~~~~
a.cc:5:1: note: 'assert' is defined in header '<cassert>'; this is probably fixable by adding '#include <cassert>'
    4 | #include<unordered_map>
  +++ |+#include <cassert>
    5 | using namespace std;
Language: C++

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

typedef long long ll;
const int maxn=360;
const ll mod=1e9+7;
ll n; ll K;
ll a[maxn];
struct node{ ll b,c; }b[maxn];

void chkmin(ll& x,ll y){ if(x>y) x=y; }
void chkmax(ll& x,ll y){ if(x<y) x=y; }

bool cmp1(node A,node B){ return A.c<B.c; }
bool cmp2(node A,node B){ return A.b<B.b || (A.b==B.b && A.c<B.c); }

map<vector<ll>, vector<node> > mp; typedef map<vector<ll>, vector<node> >::iterator it;

ll popmin(ll l,ll r){
	if(l>r) return maxn;
	ll ret=0;
	for(ll i=60;i>=0;i--){
		if((l & (1ll<<i)) ^ (r & (1ll<<i))){
			if(l & ((1ll<<i)-1)) ret++;
			break;
		}
		if(l & (1ll<<i)) ret++;
	}
	return ret;
}

void add(ll x,ll k){
	if(k<0) return;
	vector<ll> vec;
	vec.resize(n);
	ll Min=b[1].b-(1<=x);
	for(ll i=1;i<=n;i++){
		vec[i-1]=b[i].b-(i<=x);
		chkmin(Min, vec[i-1]);
	}
	if(Min<0) return;
	for(ll i=0;i<n;i++) vec[i]-=Min;
	sort(vec.begin(), vec.end());
	mp[vec].push_back( (node){max(Min-k,0ll), Min} );
	// for(int i=0;i<n;i++) printf("%d ", vec[i]); puts("");
	// printf("Min = %d Max = %d\n", max(Min-k, 0ll) ,Min);
}

int main(){

	T=1;
	while(T--){
		mp.clear();
		scanf("%d%lld", &n, &K);
		for(int i=1;i<=n;i++) scanf("%lld", &a[i]);
		for(ll i=0;i<=60;i++){
			for(ll j=1;j<=n;j++){
				b[j].b=a[j]>>i;
				b[j].c=a[j] & ((1ll<<i)-1);
			}
			sort(b+1,b+1+n,cmp1);
			ll Next, l=0, r=0;
			for(ll j=1;j<=n;j=Next+1,l=r+1){
				Next=j;
				while(Next<n && b[Next+1].c==b[j].c) Next++;
				r=b[j].c;
				add(j-1,K-popmin(l,r)-i);
			}
		}

		ll ans=0;
		for(it it=mp.begin();it!=mp.end();it++){
			vector<node> vec=it->second;
			sort(vec.begin(), vec.end(), cmp2);
			ll l=0, r=-1;
			// puts("");
			for(ll i=0;i<vec.size();i++){
				// printf("l = %d r = %d\n", vec[i].b, vec[i].c);
				if(vec[i].b>r){
					l=vec[i].b; r=vec[i].c;
					ans=(ans+r-l+1)%mod;
				}else{
					ans=(ans+vec[i].c-r)%mod;
					r=vec[i].c;
				}
			}
		}
		printf("%lld\n", ans);
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:51:9: error: 'T' was not declared in this scope
   51 |         T=1;
      |         ^
Language: C++

#include <bits/stdc++.h>

using std :: map;
using std :: pair;
using std :: vector;

#define exec_time() (1.0*clock()/CLOCKS_PER_SEC)
#define fst first
#define snd second

typedef long long LL;
typedef pair<LL, LL> Pll;

template <typename T> inline bool maximum(T &a, T b) { return a < b? a = b, 1 : 0; }
template <typename T> inline bool minimum(T &a, T b) { return a > b? a = b, 1 : 0; }
template <typename T> inline
T read(T &x, T f = 0)
{
	char c = getchar(); x = 0;
	for(; !isdigit(c); c = getchar())
		f |= c == '-';
	for(;  isdigit(c); c = getchar())
		x = x*10 + c-'0';
	return x = f? -x : x;
}

const int N = 3.5e2 + 10;
const int mod = 1e9 + 7;
const LL inf = 1LL << 61;

int n; LL K, a[N];
Pll tmp[N];
map<vector<LL>, vector<Pll> > id;
map<vector<LL>, vector<Pll> > ::iterator it;

void add(int &a, int b)
{
	a += b;
	if(a >= mod) a -= mod;
}

int calc(LL l, LL r)
{
	int res = 0;
	for(int i = 59; i >= 0; --i){
		LL idl = l & (1LL << i);
		LL idr = r & (1LL << i);
		if(idl == idr) res += (l >> i) & 1;
		else
		{
			res += (bool)(l & ((1LL<<i)-1));
			break;
		}
	}
	return res;
}

void Insert(int pos, LL rest)
{
	if(rest < 0) return ;

	LL Mn = inf;
	vector<LL> V;

	for(int i = 1; i <= n; ++i){
		V.push_back(tmp[i].snd - (i <= pos));
		minimum(Mn, V[i-1]);
	}
	if(Mn < 0) return ;

	for(int i = 0; i < n; ++i) V[i] -= Mn;
	std::sort(V.begin(), V.end());
	id[V].push_back(Pll(std::max(0LL, Mn-rest), Mn));

	return ;
}

void Init()
{
	id.clear();

	read(n), read(K);
	for(int i = 1; i <= n; ++i) read(a[i]);
	std::sort(a + 1, a + n + 1);

	for(int k = 0; k <= 60; ++k){
		for(int i = 1; i <= n; ++i){
			tmp[i].fst = a[i] & ((1LL << k) - 1);
			tmp[i].snd = a[i] >> k;
		}

		std::sort(tmp + 1, tmp + n + 1);
		LL l = 0, r = 0;
		int lst = 0;

		for(int cur = 1; cur <= n; cur = lst + 1){
			lst = cur;
			while(lst < n && tmp[lst+1].fst == tmp[cur].fst) ++lst;
			r = tmp[cur].fst;
			Insert(cur-1, K - k - calc(l, r));
			l = r + 1;
		}
	}

	return ;
}

void Work()
{
	int Ans = 0;
	for(it = id.begin(); it != id.end(); ++it){
		vector<Pll> o = it -> snd;
		LL l = 0, r = -1;

		std::sort(o.begin(), o.end());
		for(int i = 0; i < (int)o.size(); ++i){
			if(o[i].fst > r){
				add(Ans, (r - l + 1) % mod);
				l = o[i].fst, r = o[i].snd;
			}
			else maximum(r, o[i].snd);
		}
		add(Ans, (r - l + 1) % mod);
	}
	printf("%d\n", Ans);
}

int main()
{
	int T; read(T);
	while(T--){
		Init();
		Work();
	}

	return 0;
}
/

Compiler output:
a.cc:138:1: error: expected unqualified-id before '/' token
  138 | /
      | ^
Language: C++

#include <bits/stdc++.h>
#define mod 1000000007
#define N 2010
#define inf 2000000000000000000ll
#define int long long
#define MI map<vector<ll>,vector<pair<ll,ll> > > :: iterator
using namespace std;
typedef long long ll;
inline int read()
{
	int x=0,f=1; char ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-')f=-1; ch=getchar();}
	while(ch>='0'&&ch<='9'){x=x*10+ch-'0'; ch=getchar();}
	return x*f;
}
struct sp{ll B,C;}F[N];
map <vector<ll> ,vector<pair<ll,ll> > > M;
vector<pair<ll,ll> > tmp;
vector<ll> ttp;
ll n,k,A[N];
inline bool cmp(const sp a,const sp b)
{
	return a.C<b.C;
}
int get(ll a,ll b)
{
    int ret=0;
    for(int i=62;i>=0;i--)
    {
        if(!(a>>i&1)&&(b>>i&1))
        {
            if(a!=0) ret++;
            break;
        }
        else if(a>>i&1)
        {
            a-=1LL<<i;
            b-=1LL<<i;
            ret++;
        }
    }
    return ret;
}
inline void acquire(int x)
{
	for(int i=1;i<=n;i++)
	{
		F[i].B=A[i]/(1ll<<x); 
		F[i].C=A[i]%(1ll<<x);
	}
	F[0].C=-1;
	sort(F+1,F+1+n,cmp); 
	for(int i=1;i<=n;i++) if(F[i-1].C<F[i].C)
	{
		ttp.clear();
		ll bs=getpop(F[i-1].C+1,F[i].C),R=inf;
		for(int j=1;j<i;j++)
			if(F[j].B-1<0) return ;
			else ttp.push_back(F[j].B-1);
		for(int j=i;j<=n;j++)
			ttp.push_back(F[j].B);
		sort(ttp.begin(),ttp.end());
	//	cout << k << endl;
		ll lef=k-x-bs; R=ttp[0];
		if(lef<0) return ;
		for(int i=0;i<(int)ttp.size()-1;i++)
			ttp[i]=ttp[i+1]-ttp[i];
		ttp[ttp.size()-1]=0ll;
		M[ttp].push_back(make_pair(max(0ll,R-lef),R));
	}
}
signed main()
{
	//ll a,b;
	//while(cin>> a>>b) cout << getpop(a,b) << endl;
	n=read(); k=read(); 
	for(int i=1;i<=n;i++)
		A[i]=read();
	for(int i=0;i<=62;i++)
		acquire(i);
	ll Ans=0;
	for(MI it=M.begin();it!=M.end();it++)
	{
		tmp=it->second;
		sort(tmp.begin(),tmp.end());
		ll nl=tmp[0].first,nr=tmp[0].second;
		for(int i=1;i<(int)tmp.size();i++)
		{
			//cout << tmp[i].first << " " <<tmp[i].second << endl;
			if(tmp[i].first>nr)
				Ans+=(nr-nl+1),nl=tmp[i].first;
			Ans%=mod;
			nr=max(nr,tmp[i].second);
		}
		Ans+=(nr-nl+1); Ans%=mod;
	}
	cout << Ans%mod << endl;
	return 0;
}

Compiler output:
a.cc: In function 'void acquire(long long int)':
a.cc:56:23: error: 'getpop' was not declared in this scope; did you mean 'getpt'?
   56 |                 ll bs=getpop(F[i-1].C+1,F[i].C),R=inf;
      |                       ^~~~~~
      |                       getpt
a.cc:64:32: error: 'R' was not declared in this scope
   64 |                 ll lef=k-x-bs; R=ttp[0];
      |                                ^
Language: C++

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

int main() {
  int N,A,B;
    cin >> N >> A >> B;
  
  if((N * A) >= B){
    cout << B << endl;
  }
  
  if((N * A < B){
    cout << N * A << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:17: error: expected ')' before '{' token
   12 |   if((N * A < B){
      |     ~           ^
      |                 )
a.cc:15:1: error: expected primary-expression before '}' token
   15 | }
      | ^
Language: C++

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

int main() {
  int N,A,B
    cin >> N >> A >> B;
  
  if((N * A) >= B){
    cout << B << endl;
  }
  
  if((N * A < B){
    cout << N * A << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:5: error: expected initializer before 'cin'
    6 |     cin >> N >> A >> B;
      |     ^~~
a.cc:8:17: error: 'B' was not declared in this scope
    8 |   if((N * A) >= B){
      |                 ^
a.cc:12:15: error: 'B' was not declared in this scope
   12 |   if((N * A < B){
      |               ^
a.cc:12:17: error: expected ')' before '{' token
   12 |   if((N * A < B){
      |     ~           ^
      |                 )
a.cc:15:1: error: expected primary-expression before '}' token
   15 | }
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N, A, B;
  cin >> N >> A >> B;
  int x = N * A
  if (x >= B){
    cout << B << endl;
  }
  else{
    cout << x << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: expected ',' or ';' before 'if'
    8 |   if (x >= B){
      |   ^~
a.cc:11:3: error: 'else' without a previous 'if'
   11 |   else{
      |   ^~~~
Language: C++

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

int main() {

  int N, A, B;
  cin >> N >> A >> B;
  
  if (N * A < B) {
    cout << N * A <<endl;
  }
  else if (N * A == B) {
    cout << B <<endl;
  }
  else {
    cout << B <<endl;
  ]
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:3: error: expected primary-expression before ']' token
   17 |   ]
      |   ^
a.cc:19:2: error: expected '}' at end of input
   19 | }
      |  ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N, A, B;
  cin >> N >> A >> B;
  if (N*A <= B){
    cout << N * A << endl;
    else 
      cout << B << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:5: error: expected '}' before 'else'
    9 |     else
      |     ^~~~
a.cc:7:16: note: to match this '{'
    7 |   if (N*A <= B){
      |                ^
Language: C++

#include <iostream>
using namespace std;
int main(void){
    // Your code here!
  int a;
  int b;
  int c;
  cin>>a>>b>>c;
  if((a*b)>=c){
    cout<<c<<endl;
  }else((a*b)<c){
    cout<<a*b<<endl;
  }
  

  
    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:17: error: expected ';' before '{' token
   11 |   }else((a*b)<c){
      |                 ^
      |                 ;
Language: C++

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

int main() {
  int A,B,B;
  cin >> A >> B >> N;
  
  
  if (A*B <=  N ) {
    cout << N << endl;
  }else{
    cout << A*B << endl;
  }

}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:11: error: redeclaration of 'int B'
    5 |   int A,B,B;
      |           ^
a.cc:5:9: note: 'int B' previously declared here
    5 |   int A,B,B;
      |         ^
a.cc:6:20: error: 'N' was not declared in this scope
    6 |   cin >> A >> B >> N;
      |                    ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main() {
	int n;
	cin >> n;
	int now = n;
	int count = 0;
	wihle (now > 0) {
		count += now % 10;
		now /= 10;
	}
	if (now % count == 0) {
		cout << "Yes" << endl;
	} else {
		cout << "No" << endl;
	}
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: 'wihle' was not declared in this scope
   10 |         wihle (now > 0) {
      |         ^~~~~
Language: Java

import java.util.*;
public class Main {
 
   static boolean isHarshad(int n) {
      
      Scanner scanner = new Scanner(System.in);
      int c = scanner.nextInt;
      
      int sum = 0;
      int d = 0;
      
      while (c > 0) {
         d = c % 10;
         sum = sum + d;
         c = c / 10;
      }
      return (n % sum == 0);
   }
 
   public static void main(String[] args) {
 
      int count = 0;
      int number = 1;
      while (count != 50) {
         if (isHarshad(number)) {
            System.out.println(number);
            count++;
         }
         number++;
      }
   }
}


Compiler output:
Main.java:7: error: cannot find symbol
      int c = scanner.nextInt;
                     ^
  symbol:   variable nextInt
  location: variable scanner of type Scanner
1 error
Language: Java

import java.util.*;
public class Main {
 
   static boolean isHarshad(int n) {
      
      Scanner scanner = new Scanner(System.in);
      int c = input.nextInt;
      
      int sum = 0;
      int d = 0;
      
      while (c > 0) {
         d = c % 10;
         sum = sum + d;
         c = c / 10;
      }
      return (n % sum == 0);
   }
 
   public static void main(String[] args) {
 
      int count = 0;
      int number = 1;
      while (count != 50) {
         if (isHarshad(number)) {
            System.out.println(number);
            count++;
         }
         number++;
      }
   }
}


Compiler output:
Main.java:7: error: cannot find symbol
      int c = input.nextInt;
              ^
  symbol:   variable input
  location: class Main
1 error
Language: C++

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

int main() {
  int n,a,b;
  cin >> n >> a >> b;
   if (n*a <= b) {
     cout << n*a << endl;
   }
  even {
    cout << b << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:3: error: 'even' was not declared in this scope
   10 |   even {
      |   ^~~~
Language: C++

#include <bits/stsc++.h>
using namespace std;
int main(){
  int N,A,B;
  cin >> N >> A >> B;
  if (N * A > B || N * A == B) {
    cout << B << endl;
  } else if (N * A < B){
    cout << N * A << endl;
  } else {
    cout << "error" << endl;
  }
  return 0;
}

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

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

int main() {
    int N, A, B, x;
    cin >> N >> A >> B ;

    if ( (N * A) > B) {
        x = N * A ;
    }
    else if ( (N * A) < B)
        x = B ;
    }
    else {
        x = N * A ;
    }
cout << x << endl ;
}

Compiler output:
a.cc:14:5: error: expected unqualified-id before 'else'
   14 |     else {
      |     ^~~~
a.cc:17:1: error: 'cout' does not name a type
   17 | cout << x << endl ;
      | ^~~~
a.cc:18:1: error: expected declaration before '}' token
   18 | }
      | ^
Language: C++

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

int main() {
    int N, A, B, x;
    cin >> N >> A >> B ;

    if ( (N * A) > B) {
        x = N * A ;
    }
    else if ( (N * A) < B)
        x = B ;
    }
    else {
        x = N * A
    }
cout << x << endl ;
}

Compiler output:
a.cc:14:5: error: expected unqualified-id before 'else'
   14 |     else {
      |     ^~~~
a.cc:17:1: error: 'cout' does not name a type
   17 | cout << x << endl ;
      | ^~~~
a.cc:18:1: error: expected declaration before '}' token
   18 | }
      | ^
Language: C++

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

int main() {
    int N, A, B, x;
    cin >> N >> A >> B ;

    if ( (N * A) > B) {
        x = N * A
    }
    else {
        x = B
    }
cout << x << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:18: error: expected ';' before '}' token
    9 |         x = N * A
      |                  ^
      |                  ;
   10 |     }
      |     ~             
a.cc:12:14: error: expected ';' before '}' token
   12 |         x = B
      |              ^
      |              ;
   13 |     }
      |     ~
Language: C++

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

int main() {
    int N, A, B, x;
    cin >> N >> A >> B ;

    if ( (N * A) > B) {
        cout << N * A << endl;
    }
    else {
        cout << B << endl;
    }
]

Compiler output:
a.cc: In function 'int main()':
a.cc:14:1: error: expected primary-expression before ']' token
   14 | ]
      | ^
a.cc:14:2: error: expected '}' at end of input
   14 | ]
      |  ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

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

int main() {
    int N, A, B, x;
    cin >> N >> A >> B ;

    x = max( (N * A), B)
    cout << x << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:25: error: expected ';' before 'cout'
    8 |     x = max( (N * A), B)
      |                         ^
      |                         ;
    9 |     cout << x << endl;
      |     ~~~~
Language: C++

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

int main(){
  int N,A,B;
  int PLAN1.PLAN2;
  
  cin >> N >> A >> B;
  
  //プラン1,2の料金をそれぞれ計算
  PLAN1 = N + A;
  PLAN2 = B;
  
  if ( A < B ){
    cout << A << endl;
  }
  else if(A > B){
    cout << B << endl;
  }
  else{
    cout << A << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:12: error: expected initializer before '.' token
    6 |   int PLAN1.PLAN2;
      |            ^
a.cc:11:3: error: 'PLAN1' was not declared in this scope
   11 |   PLAN1 = N + A;
      |   ^~~~~
a.cc:12:3: error: 'PLAN2' was not declared in this scope
   12 |   PLAN2 = B;
      |   ^~~~~
Language: C++

#includ <bits/stdc++.h>

using namespace std;

int main () {
  int n , a , b;
  cin>>n>>a>>b;
  if (n*a<b){
    cout<<n*a;
  }else {
    cout<<b;
   }
} 

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #includ; did you mean #include?
    1 | #includ <bits/stdc++.h>
      |  ^~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:7:3: error: 'cin' was not declared in this scope
    7 |   cin>>n>>a>>b;
      |   ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #includ <bits/stdc++.h>
a.cc:9:5: error: 'cout' was not declared in this scope
    9 |     cout<<n*a;
      |     ^~~~
a.cc:9:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:11:5: error: 'cout' was not declared in this scope
   11 |     cout<<b;
      |     ^~~~
a.cc:11:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

#include <bits/stdc++.h>

using namespace std;
int main(){
  int a,b,n;
  cout <<" enter n : ";
  cin>>n
    cout<<endl<<" enter a : ";
  cin>>a;
  cout<<endl<<" enter b : ";
  cin>>b;
  int k=a*n
    if (k<b){
      cout<<k;
    }else {
      cout<<b;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: expected ';' before 'cout'
    7 |   cin>>n
      |         ^
      |         ;
    8 |     cout<<endl<<" enter a : ";
      |     ~~~~ 
a.cc:13:5: error: expected ',' or ';' before 'if'
   13 |     if (k<b){
      |     ^~
a.cc:15:6: error: 'else' without a previous 'if'
   15 |     }else {
      |      ^~~~
Language: C++

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

int main() {
  int N, A, B;
  cin >> N >> A >> B ;

  if ( (A * N) >= B) ) {
    cout << "B" << endl;
  }
  
  else if ((A * B) < B)) {
    cout << "A * B" << endl;
  }

}
  


Compiler output:
a.cc: In function 'int main()':
a.cc:8:22: error: expected primary-expression before ')' token
    8 |   if ( (A * N) >= B) ) {
      |                      ^
a.cc:12:24: error: expected primary-expression before ')' token
   12 |   else if ((A * B) < B)) {
      |                        ^
Language: C++

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

int main() {
  int n, a, b;
  cin >> n >> a >> b;

  if (n * a =< b) {
    cout << n * a << endl;
  }
  else {
    cout << b << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:14: error: expected primary-expression before '<' token
    8 |   if (n * a =< b) {
      |              ^
Language: C++

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

int main() {
  int N, A, B;
  cin >> N >> A >> B>>;

  if ( A*N >B ) {
    cout << "B" << endl;
    }
  else if ( N*A == B ) {
    cout << "B" << endl;
    }
  else if ( A*N < B ) {
    cout << "A*N" << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:23: error: expected primary-expression before ';' token
    6 |   cin >> N >> A >> B>>;
      |                       ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() 
{
  int N;
  int A;
  int B;
  
  cin >> N >> A >> B;
  if(N * A < B)
  {
    cout << N * A << endl;
  }
  else if(N * A > B)
  {
    cout << B << endl;
  }
    else if(N * A == B)
  {
    cout << B << endl;
}

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

#include <bits/stdc++.h>
#include<iostream>
using namespace std;
 
int main() {
   int a,b,c;
   cin >>a>>b>>c;
  a= a*b;
  if(a>c)else cout << c;
  else cout << a;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:10: error: expected primary-expression before 'else'
    9 |   if(a>c)else cout << c;
      |          ^~~~
Language: C++

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

int main() {
  int A, B ,C;
  cin >> A >> B >> C >> D;

  if (A * B < C ) {
    cout << A * B << endl;
  }
  }
  else {
    cout << C << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:25: error: 'D' was not declared in this scope
    6 |   cin >> A >> B >> C >> D;
      |                         ^
a.cc: At global scope:
a.cc:12:3: error: expected unqualified-id before 'else'
   12 |   else {
      |   ^~~~
a.cc:15:1: error: expected declaration before '}' token
   15 | }
      | ^