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

#include <iomanip>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <cassert>
#include <string>
#include <set>
#include <map>
#include <random>
#include <bitset>
#include <string>
#include <unordered_set>
#include <unordered_map>
#include <deque>
#include <queue>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()

using namespace std;
using ll = long long;
using ul = unsigned long long;
using ld = long double;

const int N = 18, P = 1 << N;
int a[N], b[N];
int dp[P][N], pc[N];

int main() {
#ifdef ONPC
    freopen("a.in", "r", stdin);
#endif
    ios_base::sync_with_stdio(0); cin.tie(0);
	int n;
    cin >> n;
    rep(i, n)
        cin >> a[i];
    rep(i, n)
        cin >> b[i];
    int pw = 1 << n, lx, nx, np;
    rep(i, pw)
        rep(j, n)
            if (i & (1 << j))
                pc[i]++;
    rep(i, n)
        rep(j, pw)
            dp[j][i] = 1e8;
    rep(i, n)
        dp[1 << i][i] = 0;
    rep(i, pw) {
        int c = pc[i];
        rep(j, n) {
            if (!(i & (1 << j)))
                continue;
            lx = ((c - 1 - j) % 2 ? b[j] : a[j]);
            rep(k, n) {
                if (i & (1 << k))
                    continue;
                nx = ((c - k) % 2 ? b[k] : a[k]);
                if (nx >= lx) {
                    np = i | (1 << k);
                    dp[np][k] = min(dp[np][k], dp[i][j] + pc[i >> k]);
                }
            }
        }
    }
    int ans = P;
    rep(i, n)
        ans = min(ans, dp[pw - 1][i]);
    if (ans > n * n)
        ans = -1;
    cout << ans;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:35:35: error: 'cin' was not declared in this scope
   35 |     ios_base::sync_with_stdio(0); cin.tie(0);
      |                                   ^~~
a.cc:18:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
   17 | #include <queue>
  +++ |+#include <iostream>
   18 | #define rep(i, n) for (int i = 0; i < (n); i++)
a.cc:74:5: error: 'cout' was not declared in this scope
   74 |     cout << ans;
      |     ^~~~
a.cc:74:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

/*
 _     _                             
| |__ | |__   __ _  __ _ _   _  __ _ 
| '_ \| '_ \ / _` |/ _` | | | |/ _` |
| |_) | | | | (_| | (_| | |_| | (_| |
|_.__/|_| |_|\__,_|\__, |\__, |\__,_|
                   |___/ |___/       
*/
#include<bits/stdc++.h>

#define ll          long long
#define pb          push_back
#define ppb         pop_back
#define	endl		'\n'
#define mii         map<ll int,ll int>
#define pii         pair<ll int,ll int>
#define vi          vector<ll int>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (ll int)x.size()
#define hell        1000000007
#define lbnd        lower_bound
#define ubnd        upper_bound
#define bs          binary_search
#define mp          make_pair
#define what_is(x)  cerr << #x << " is " << x << endl;
using namespace std;

#define N  100005

int n;

int a[20],b[20];

int ass[20];

int mini=1e9;

solve()
{
	vector<pair<int,int>> v;
	for(int i=0;i<n;i++)
	{
		if(ass[i]) v.pb({b[i],1});
		else v.pb({a[i],0});
	}
	int swaps=0;
	for(int i=0;i<n;i++)
	{
		for(int j=i+1;j<n;j++)
		{
			if(v[i].F>v[j].F) 
			{
				swaps++;
			}
		}
	}
	map<int,int> dde,ddo;
	vector<pair<int,int>> vs=v; sort(all(vs));
	for(int i=0;i<n;i++)
	{
		if(i%2==0) dde[vs[i].F]++;
		else ddo[vs[i].F]++;
	}
	map<int,int> cce,cco;
	for(int i=0;i<n;i++)
	{
		if(ass[i]==1)
		{
			if(i%2==1) cce[v[i].F]++;
			else cco[v[i].F]++;
		}
		else
		{
			if(i%2==0) cce[v[i].F]++;
			else cco[v[i].F]++;
		}
	}
	bool isok=1;
	for(int i=1;i<=50;i++) if(cce[i]!=dde[i]||cco[i]!=ddo[i]) isok=0;
	if(isok) mini=min(mini,swaps);
}

void fun(int idx)
{
	if(idx==n)
	{
		int cnt=0;
		for(int i=0;i<n;i++) cnt+=ass[i];
		if(cnt%2==0) solve();
	}
	else
	{
		ass[idx]=0;
		fun(idx+1);
		ass[idx]=1;
		fun(idx+1);
	}
}

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	int TESTS=1;
	// cin>>TESTS;
	while(TESTS--)
	{
		cin>>n;
		for(int i=0;i<n;i++) cin>>a[i];
		for(int i=0;i<n;i++) cin>>b[i];
		fun(0);
		if(mini!=1e9) cout<<mini<<endl;
		else cout<<-1<<endl;
	}
	return 0;
}

Compiler output:
a.cc:40:1: error: ISO C++ forbids declaration of 'solve' with no type [-fpermissive]
   40 | solve()
      | ^~~~~
a.cc: In function 'int solve()':
a.cc:83:1: warning: no return statement in function returning non-void [-Wreturn-type]
   83 | }
      | ^
Language: C++

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

int mergecount(vector<int> &a) {
    int count = 0;
    int n = a.size();
    if (n > 1) {
        vector<int> b(a.begin(), a.begin() + n/2);
        vector<int> c(a.begin() + n/2, a.end());
        count += mergecount(b);
        count += mergecount(c);
        for (int i = 0, j = 0, k = 0; i < n; ++i)
            if (k == c.size())       a[i] = b[j++];
            else if (j == b.size())  a[i] = c[k++];
            else if (b[j] <= c[k])   a[i] = b[j++];
            else                   { a[i] = c[k++]; count += n/2 - j; }
    }
    return count;
}

int main() {
    int N;
    cin >> N;
    vector<int>A(N);
    vector<int>B(N);
    for (int i = 0; i < N; ++i) {
        cin >> A[i];
    }
    for (int i = 0; i < N; ++i) {
        cin >> B[i];
    }
    vector<int>f(N);
    for (int i = 0; i < N; ++i) {
        f[i] = i;
    }
    int ans = INT_MAX;
    vector<int>num(N);

    do {
        int flag = 0;
        for (int i = 0; i < N; ++i) {
            if (abs(f[i] - i) % 2) {
                num[i] = B[f[i]];
            } else {
                num[i] = A[f[i]];
            }
            if (i == 0) continue;
            if (num[i] < num[i-1]) {
                flag = 1;
                break;
            }
        }
        if (flag == 0) {
            vector<int>f1 = f;
            ans = min(ans, mergecount(f1););
        }
    } while (std::next_permutation(f.begin(), f.end()));

    if (ans == INT_MAX) ans = -1;
    cout << ans << "\n";
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:56:42: error: expected ')' before ';' token
   56 |             ans = min(ans, mergecount(f1););
      |                      ~                   ^
      |                                          )
a.cc:56:43: error: expected primary-expression before ')' token
   56 |             ans = min(ans, mergecount(f1););
      |                                           ^
Language: C++

#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
const ll inf=17441744174417;
struct BIT{
private:
  vector<ll> vec;
  ll n;
public:
  BIT(ll siz){
    n=siz;
    vec.resize(n+3,0);
  }
  void add(ll ps,ll x){
    ps++;
    while(ps<=n){
      vec[ps]+=x;
      ps+=ps&(-ps);
    }
  }
  ll sum(ll ps){
    ps++;
    ll res=0;
    while(ps>0){
      res+=vec[ps];
      ps-=ps&(-ps);
    }
    return res;
  }
};
ll tento_0(vector<ll> kv,ll bt){
  ll n=kv.size(),res=0;

  vector<ll> comp;
  for(int i=0;i<n;i++) comp.push_back(kv[i]);
  sort(comp.begin(),comp.end());
  comp.erase(unique(comp.begin(),comp.end()),comp.end());

  vector<ll> vec;
  for(int i=0;i<n;i++){
    ll pos=lower_bound(comp.begin(),comp.end(),kv[i])-comp.begin();
    vec.push_back(pos+1);
  }


  BIT b(n+5);
  bool f=false;
  for(int i=0;i<n;i++){
    ll val=vec[i];
    ll ad=b.sum(n+3)-b.sum(val);
    res+=ad;

    ll kn=((bt>>i)&1);
    ll kn2=ad%2;
    if(kn2!=kn){
      if(b.sum(val)-b.sum(val-1)>0){
        f=false;
        res++;
      }
      else f=true;
    }
    b.add(val,1);
  }
  return (f?inf;res);
}
int main(){
  ll n;
  cin>>n;
  vector<P> vec;
  vector<ll> kvec;
  for(int i=0;i<n;i++){
    ll a;
    cin>>a;
    kvec.push_back(a);
  }
  for(int i=0;i<n;i++){
    ll b;
    cin>>b;
    vec.push_back(P(kvec[i],b));
  }
  ll ans=inf;
  for(int i=0;i<(1<<n);i++){
    vector<ll> kv;
    for(int j=0;j<n;j++){
      if(((i>>j)&1)==1) kv.push_back(vec[j].second);
      else kv.push_back(vec[j].first);
    }
    ll kans=tento_0(kv,i);
    ans=min(ans,kans);
    //cout<<kans<<" "<<i<<": ";
    //for(int j=0;j<n;j++) cout<<kv[j]<<" ";
    //cout<<endl;
  }
  cout<<(ans==inf?-1:ans)<<endl;
}


Compiler output:
a.cc: In function 'll tento_0(std::vector<long long int>, ll)':
a.cc:68:16: error: expected ':' before ';' token
   68 |   return (f?inf;res);
      |                ^
      |                :
a.cc:68:16: error: expected primary-expression before ';' token
a.cc:68:16: error: expected ')' before ';' token
   68 |   return (f?inf;res);
      |          ~     ^
      |                )
a.cc:68:20: error: expected ';' before ')' token
   68 |   return (f?inf;res);
      |                    ^
      |                    ;
Language: C++

#include <iostream>
#include <vector>
#include <queue>
using namespace std;
typedef pair<int, int> P;

template <typename T>
struct BIT
{
    int n;
    vector<T> bit;
    
    BIT(){}
    
    BIT(int n) : n(n){
        bit.resize(n + 1);
    }
    
    T sum(int i){
        i++;
        T res = 0;
        while(i){
            res += bit[i];
            i -= (i & -i);
        }
        return res;
    }
    
    void add(int i, T x){
        i++;
        while(i <= n){
            bit[i] += x;
            i += (i & -i);
        }
    }
};

int main()
{
    int n;
    cin >> n;
    int a[20][2];
    for(int i = 0; i < n; i++) cin >> a[i][0];
    for(int i = 0; i < n; i++) cin >> a[i][1];
    int ans = 10000000;
    for(int b = 0; b < (1 << n); b++){
        P p[20];
        for(int i = 0; i < n; i++){
            p[i] = P(a[i][(b >> i) & 1], i);
        }
        sort(p, p + n);
        BIT<int> bit(51);
        int s = 0;
        bool f = true;
        for(int i = 0; i < n; i++){
            s += i - bit.sum(p[i].second);
            bit.add(p[i].second, 1);
        }
        for(int i = 0; i < n; i++){
            if(abs(i - p[i].second) % 2 != ((b >> i) & 1)){
                bool g = false;
                for(int j = i + 1; j < n; j++){
                    if(p[i].first != p[j].first) break;
                    if(abs(j - p[j].second) % 2 != ((b >> j) & 1)){
                        g = true;
                        s += j - i;
                        for(int k = j; k >= i; k--) p[k].second++;
                        break;
                    }
                }
                if(!g){
                    f = false;
                    break;
                }
            }
        }
        if(f) ans = min(ans, s);
    }
    if(ans == 10000000) cout << -1 << endl;
    else cout << ans << endl;
}

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

    cout << (ans == P ? -1 : ans / 2);
}



Compiler output:
a.cc:1:5: error: 'cout' does not name a type
    1 |     cout << (ans == P ? -1 : ans / 2);
      |     ^~~~
a.cc:2:1: error: expected declaration before '}' token
    2 | }
      | ^
Language: C++

#include <algorithm>
#include <iostream>
#include <string>
#include <random>
#include <cassert>
#include <cstring>
#include <chrono>
#include <set>
#include <map>

using namespace std;

typedef long long ll;
typedef vector<int> vi;

int DFS(int v, int cur, int mi, vi& d, vi& color, vi& len, vector<vector<pair<int, int>>>& g) {
  if (color[v] != -1) return 0;
  color[v] = cur;
  int result = 1;
  for (auto p : g[v]) {
    int w = p.first;
    if (d[w] != mi) continue;
    len[p.second] = mi;
    result += DFS(w, cur ^ 1, mi, d, color, len, g);
  }
  return result;
}

bool DFS2(int v, vi& d, vi& color, vi& len, vector<vector<pair<int, int>>>& g) {
  if (colov[v] == -2) return false;
  if (color[v] != -1) return true;
  color[v] = -2;
  for (auto p : g[v]) {
    int w = p.first;
    if (d[w] < d[v] || d[w] == d[v] && DFS2(w, d, color, len, g)) {
      len[p.second] = d[v];
      color[v] = color[w] ^ 1;
      return true;
    }
  }
  return false;
}

int main()
{
  int n, m;
  cin >> n >> m;
  vector<int> d(n), color(n, -1);
  int mi = 1e9;
  for (int i = 0; i < n; ++i) {
    cin >> d[i];
    mi = min(mi, d[i]);
  }
  vector<vector<pair<int, int>>> g(n);
  vector<int> a(m), b(m), len(m);
  for (int i = 0; i < m; ++i) {
    cin >> a[i] >> b[i];
    a[i]--;
    b[i]--;
    g[a[i]].push_back(make_pair(b[i], i));
    g[b[i]].push_back(make_pair(a[i], i));
    len[i] = 1e9;
  }
  for (int i = 0; i < n; ++i) if (d[i] == mi && color[i] == -1) {
    int comp = DFS(i, 0, mi, d, color, len, g);
    if (comp == 1) {
      cout << -1 << endl;
      return 0;
    }
  }
  vector<pair<int, int>> v;
  for (int i = 0; i < n; ++i) v.push_back(make_pair(d[i], i));
  sort(v.begin(), v.end());
  for (auto q : v) {
    int i = q.second;
    if (!DFS2(i, d, color, len, g)) {
      cout << -1 << endl;
      return 0;
    }
  }
  for (int i = 0; i < n; ++i) {
    char cur = 'B';
    if (color[i]) cur = 'W';
    cout << cur;
  }
  cout << endl;
  for (int i = 0; i < m; ++i) cout << len[i] << endl;
  return 0;
}


Compiler output:
a.cc: In function 'bool DFS2(int, vi&, vi&, vi&, std::vector<std::vector<std::pair<int, int> > >&)':
a.cc:30:7: error: 'colov' was not declared in this scope; did you mean 'color'?
   30 |   if (colov[v] == -2) return false;
      |       ^~~~~
      |       color
Language: C++

#include <cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#define ll long long
#define inf 0x3f3f3f3f
#define maxn 100010
inline ll read()
{
    ll x=0; char c=getchar(),f=1;
    for(;c<'0'||'9'<c;c=getchar())if(c=='-')f=-1;
    for(;'0'<=c&&c<='9';c=getchar())x=x*10+c-'0';
    return x*f;
}
inline void write(ll x)
{
    static int buf[20],len; len=0;
    if(x<0)x=-x,putchar('-');
    for(;x;x/=10)buf[len++]=x%10;
    if(!len)putchar('0');
    else while(len)putchar(buf[--len]+'0');
}
inline void writeln(ll x){write(x); putchar('\n');}
inline void writesp(ll x){write(x); putchar(' ');}
int u[2*maxn],v[2*maxn];
std::vector<int> nxt[maxn];
int a[maxn],fa[maxn],col[maxn],id[maxn];
int n,m;
int cmp(int x,int y){return a[x]<a[y];}
void dfs(int now)
{
    // printf("%d %d\n",now,col[now]);
    for(int i=0;i<nxt[now].size();i++)
        if(!col[nxt[now][i]]){
            col[nxt[now][i]]=-col[now];
            dfs(nxt[now][i]);
        }
}
int main()
{
	n=read(); m=read();
    for(int i=1;i<=n;i++)
        a[i]=read();
    for(int i=1;i<=m;i++){
        u[i]=read(); v[i]=read();
        nxt[u[i]].push_back(v[i]);
        nxt[v[i]].push_back(u[i]);
    }
    for(int i=1;i<=n;i++){
        int mn=inf,mnid=0;
        for(int j=0;j<nxt[i].size();j++)
            if(a[nxt[i][j]]<mn){
                mn=a[nxt[i][j]];
                mnid=nxt[i][j];
            }
        if(mn>a[i]){
            puts("-1");
            return 0;
        }
        fa[i]=mnid;
    }
    // for(int i=1;i<=n;i++)
    //     writesp(fa[i]);
    // putchar('\n');
    for(int i=1;i<=n;i++)
        nxt[i].clear();
    for(int i=1;i<=n;i++){
        nxt[i].push_back(fa[i]);
        nxt[fa[i]].push_back(i);
    }
    for(int i=1;i<=n;i++)
        if(!col[i]){
            col[i]=1;
            dfs(i);
        }
    for(int i=1;i<=n;i++)
        if(col[i]==1)putchar('B');
        else putchar('W');
    putchar('\n');
    for(int i=1;i<=m;i++)
        if(fa[u[i]]==v[i]||fa[v[i]]==u[i])writeln(std::max(a[u[i]],a[v[i]]));
        else writeln(1e9);
    return 0;
}

Compiler output:
a.cc:27:6: error: 'vector' in namespace 'std' does not name a template type
   27 | std::vector<int> nxt[maxn];
      |      ^~~~~~
a.cc:6:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    5 | #include <algorithm>
  +++ |+#include <vector>
    6 | #define ll long long
a.cc: In function 'void dfs(int)':
a.cc:34:19: error: 'nxt' was not declared in this scope
   34 |     for(int i=0;i<nxt[now].size();i++)
      |                   ^~~
a.cc: In function 'int main()':
a.cc:47:9: error: 'nxt' was not declared in this scope
   47 |         nxt[u[i]].push_back(v[i]);
      |         ^~~
a.cc:52:23: error: 'nxt' was not declared in this scope
   52 |         for(int j=0;j<nxt[i].size();j++)
      |                       ^~~
a.cc:67:9: error: 'nxt' was not declared in this scope
   67 |         nxt[i].clear();
      |         ^~~
a.cc:69:9: error: 'nxt' was not declared in this scope
   69 |         nxt[i].push_back(fa[i]);
      |         ^~~
Language: Java

import java.util.*;

public class ProblemE {
    public static final int MAX_WEIGHT = 1_000_000_000;

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int m = scanner.nextInt();
        int[] d = new int[n];
        int[] toMin = new int[n];
        int[] curMin = new int[n];
        int[] edgeMin = new int[n];
        Arrays.fill(curMin, Integer.MAX_VALUE);

        for (int i = 0; i < n; i++) {
            d[i] = scanner.nextInt();
        }

        int u, v;
        for (int i = 0; i < m; i++) {
            u = scanner.nextInt()-1;
            v = scanner.nextInt()-1;
            if(curMin[u]>d[v]){
                toMin[u] = v;
                curMin[u] = d[v];
                edgeMin[u] = i;
            }
            if(curMin[v]>d[u]){
                toMin[v] = u;
                curMin[v] = d[u];
                edgeMin[v] = i;
            }
        }

        for (int i = 0; i < n; i++) {
            if(d[i]<curMin[i]){
                System.out.println(-1);
                return;
            }
        }
        
        Boolean[] nodeColors = new Boolean[n];
        Integer[] edgeWeights = new Integer[m];
        Stack<Integer> stack = new Stack<>();

        for (int i = 0; i < n; i++) {
            if(nodeColors[i]!=null) continue;
            stack.push(i);
            while (!stack.isEmpty()){
                Integer peeked = stack.peek();
                if(nodeColors[toMin[peeked]]!=null){
                    nodeColors[peeked]=!nodeColors[toMin[peeked]];
                    edgeWeights[edgeMin[peeked]] = d[peeked];
                    stack.pop();
                }else{
                    if(d[toMin[peeked]]== d[peeked]){
                        toMin[toMin[peeked]] = peeked;
                        nodeColors[toMin[peeked]] = true;
                        nodeColors[peeked] = false;
                        edgeWeights[edgeMin[peeked]] = d[peeked];
                        stack.pop();
                    }else{
                        stack.push(toMin[peeked]);
                    }
                }
            }
        }

        for (int i = 0; i < m; i++) {
            if (edgeWeights[i] == null) edgeWeights[i] = MAX_WEIGHT;
        }

        StringBuilder sb = new StringBuilder(m);
        for (boolean color: nodeColors) {
            sb.append(color ? "B" : "W");
        }
        System.out.println(sb.toString());
        for (int w : edgeWeights) {
            System.out.println(w);
        }
    }
}

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

#include<bits/stdc++.h>
using namespace std;
const int N = 222222;
int a[N], vst[N], ans[N], col[N];
vector<pair<int, int> > e[N];
int main() {
	int n, m;
	scanf("%d%d", &n, &m);
	for(int i(1); i <= n; i++) {
		scanf("%d", &a[i]);
	}
	for(int i(1); i <= m; i++) {
		int x, y;
		scanf("%d%d", &x, &y);
		e[x].push_back({y, i});
		e[y].push_back({x, i});
	}
	set<pair<int, int> > st;
	memset(col, -1, sizeof(col));
	for(int i(1); i <= n; i++) {
		for(pair<int, int> tmp : e[i]) {
			int y = tmp.first;
			if(a[i] == a[y]) {
				vst[i] = vst[y] = 1;
				if(col[v] == -1 && col[y] == -1) {
					col[v] = 0; col[y] = 1;
				}else if(col[v] == -1) {
					col[v] = col[y] ^ 1;
				}else if(col[y] == -1) {
					col[y] = col[v] ^ 1;
				}
				ans[tmp.second] = a[i];
				st.insert({a[i], i});
				st.insert({a[y], y});
			}
		}
	}
	for(int i(1); i <= n; i++) {
		if(st.empty()) {
			printf("-1\n");
			exit(0);
		}
		int v = st.begin()->second;
		//printf("v = %d\n", v);
		st.erase(st.begin());
		for(pair<int, int> tmp : e[v]) {
			int y = tmp.first;
			if(!vst[y] && a[y] >= a[v]) {
				st.insert({a[y], y});
				col[y] = col[v] ^ 1;
				vst[y] = 1;
				ans[tmp.second] = a[y];
			}
		}
	}
	for(int i(1); i <= n; i++) printf("%c", col[i] ? 'B' : 'W');
	printf("\n");
	for(int i = 1; i <= m; i++) printf("%d\n", ans[i] ? ans[i] : (int)1e9);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:25:40: error: 'v' was not declared in this scope
   25 |                                 if(col[v] == -1 && col[y] == -1) {
      |                                        ^
Language: C++

#include <cstdio>
#include <iostream>
#include <cassert>
#include <string>
#include <algorithm>
#include <cstring>
#include <utility>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <cmath>
#include <deque>
#include <unordered_map>
#define IOS ios_base::sync_with_stdio(0); cin.tie(0)
using namespace std;
typedef long long LL;
typedef pair<int, int> pii;
typedef pair<LL, LL> pll;
const int MAXN = 123456;
vector<pii> G[MAXN];
int D[MAXN], color[MAXN];
int ans[2 * MAXN];
int A[MAXN], B[MAXN];

int main() {
    int N, M;
    scanf("%d %d", &N, &M);
    vector<pii> V;
    for (int i = 1; i <= N; i++) {
        scanf("%d", &D[i]);
        V.push_back(make_pair(D[i], i));
    }
    for (int i = 0; i < M; i++) {
        int a, b;
        scanf("%d %d", &a, &b);
        A[i] = a;
        B[i] = b;
        G[a].push_back(make_pair(i, b));
        G[b].push_back(make_pair(i, a));
    }
    sort(V.begin(), V.end());
    for (int i = 0; i < N; i++) {
        int cur = V[i].second;
        bool OK = false;
        for (auto j : G[cur]) {
            int to = j.second;
            if (D[to] <= D[cur]) OK = true;
        }
        if (!OK) return assert(false);
    }
    for (int i = 0; i < N; i++) {
        int cur = V[i].second;
        if (color[cur]) continue;
        for (auto j : G[cur]) {
            int to = j.second, idx = j.first;
            if (D[to] > D[cur]) continue;
            if (color[to] == 0) {
                color[to] = 1;
                color[cur] = 2;
            } else if (color[to] == 1) {
                color[cur] = 2;
            } else {
                color[cur] = 1;
            }
            ans[idx] = D[cur];
            break;
        }
    }
    for (int i = 1; i <= N; i++) {
        if (!color[i]) assert(false);
        if (color[i] == 1) printf("B");
        else printf("W");
    }
    puts("");
    for (int i = 0; i < M; i++) {
        if (!ans[i]) ans[i] = (int)1e9;
        printf("%d\n", ans[i]);
    }
    return 0;
}


Compiler output:
In file included from /usr/include/c++/14/cassert:44,
                 from a.cc:3:
a.cc: In function 'int main()':
a.cc:51:25: error: void value not ignored as it ought to be
   51 |         if (!OK) return assert(false);
      |                         ^~~~~~
Language: C++

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

signed main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(20);

    int n,m;
    cin>>n>>m;
    array<int,2> d[n];
    int a[n];
    for(int i=0;i<n;i++){
        cin>>a[i];
        d[i] = {a[i],i};
    }
    sort(d,d+n);
    vector<vector<array<int,2>>> v(n);
    for(int i=0;i<m;i++){
        int a,b;
        cin>>a>>b;
        a--,b--;
        v[a].push_back({b,i});
        v[b].push_back({a,i});
    }
    int c[n];
    for(int i=0;i<n;i++) c[i] = -1;
    int ans[m];
    int INF = 1e9;
    for(int i=0;i<m;i++) ans[i] = INF;
    priority_queue<array<int,2>,vector<array<int,2>>,greater<array<int,2>>> q;
    q.push({d[0][0],d[0][1]});
    bool used[n];
    for(int i=0;i<n;i++) used[i] = 0;
    while(q.size()){
        array<int,2> p = q.top();
        //cerr << p[0] << " " << p[1] << endl;
        q.pop();
        used[p[1]]=1;
        if(c[p[1]]==-1) c[p[1]] = 1;
        for(auto i:v[p[1]]){
            if(c[i[0]]==-1) c[i[0]] = c[p[1]] ^ 1;
            ans[i[1]] = max(a[i[0]], p[0]);
            if(!used[i[0]]){
                used[i[0]]=1
                q.push({a[i[0]],i[0]});
            }
        }
    }
    for(int i=0;i<n;i++){
        bool pos = false;
        for(auto j:v[i]){
            int p = j[0];
            int itr = j[1];
            if(c[p] == c[i]) continue;
            if(ans[itr] < a[i]){
                cout << -1 << endl;
                return 0;
            }
            if(ans[itr] == a[i]) pos = 1;
        }
        if(!pos){
            cout << -1 << endl;
            return 0;
        }
    }
    for(int i=0;i<n;i++){
        if(c[i] == 1) cout << "W";
        else cout << "B";
    }
    cout << "\n";
    for(int i=0;i<m;i++){
        cout << ans[i] << "\n";
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:46:29: error: expected ';' before 'q'
   46 |                 used[i[0]]=1
      |                             ^
      |                             ;
   47 |                 q.push({a[i[0]],i[0]});
      |                 ~            
a.cc:47:38: error: expected primary-expression before ')' token
   47 |                 q.push({a[i[0]],i[0]});
      |                                      ^
Language: C++

#include <iostream>
#include <vector>
using namespace std;
typedef pair<int, int> P;

template <typename T>
struct Edge
{
    int to;
    T cost;
};

template <typename T>
struct WeightedGraph
{
    int n;
    vector<vector<Edge<T>>> g;
    
    WeightedGraph(int n) : n(n){
        g.resize(n);
    }
    
    void init(int n_){
        n = n_;
        g.resize(n_);
    }
    
    void add_edge(int from, int to, T cost){
        g[from].push_back((Edge<T>){to, cost});
    }
};

int main()
{
    int n, m;
    cin >> n >> m;
    int d[100002];
    P p[100002];
    for(int i = 0; i < n; i++){
        cin >> d[i];
        p[i] = P(d[i], i);
    }
    sort(p, p + n);
    WeightedGraph<int> g(n);
    for(int i = 0; i < m; i++){
        int u, v;
        cin >> u >> v;
        u--; v--;
        g.add_edge(u, v, i);
        g.add_edge(v, u, i);
    }
    bool used[100002]{0};
    char c[100002];
    for(int i = 0; i < n; i++) c[i] = 'N';
    int l[200002];
    for(int i = 0; i < n; i++){
        int u = p[i].second;
        used[u] = true;
        int les = 1000000000;
        for(Edge<int> e : g.g[u]){
            int v = e.to;
            les = min(les, d[v]);
            if(used[v]){
                if(d[v] == d[u] && c[v] == 'W' && c[u] == 'N') c[u] = 'B';
                if(c[u] == 'N') c[u] = 'W';
                if(c[v] != c[u]) l[e.cost] = d[u];
                else l[e.cost] = max(1, d[u] - d[v]);
            }
        }
        if(c[u] == 'N' && les > d[u]){
            cout << -1 << endl;
            return 0;
        }
    }
    for(int i = 0; i < n; i++) cout << c[i];
    cout << endl;
    for(int i = 0; i < m; i++) cout << l[i] << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:43:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   43 |     sort(p, p + n);
      |     ^~~~
      |     short
Language: C++

#include <bits/stdc++.h>

using namespace std;

int n, m;
string S;
const int INF = 1e9;
vector<int> D;
vector<vector<array<int, 3>>> E;
vector<int> C;
vector<bool> visited, changed, cleared;

bool dfs(int v, bool color, int from){
    if (visited[v])
        return true;
    visited[v] = true;
    S[v] = color ? 'B' : 'W';
    if (from >= 0 and C[from] == D[v]){
        cleared[v] = true;
        changed[from] = true;
    }
    if (from >= 0 and !changed[from]){
        C[from] = D[v];
        changed[from] = true;
        cleared[v] = true;
    }
    for (const auto &e: E[v]){
        auto to = e[1];
        if (C[e[2]] == D[v]){
            cleared[v] = true;
        }
        if (S[to] != 'a' and S[to] != S[v] and C[e[2]] < D[v])
            return false;
        if (!cleared[v] and !changed[e[2]]){
            if (D[to] <= D[v])
                return false;
          C[e[2]] = D[v];
            changed[e[2]] = true;
            cleared[v] = true;
        }
        if (!dfs(to, 1 - color, e[2]))
            return false;
    }
    return true;
}o

int main(){
    cin >> n >> m;
    D.resize(n);
    copy_n(istream_iterator<int>(cin), n, D.begin());
    E.resize(n);
    for (int i = 0; i < m; i++){
        int u, v;
        cin >> u >> v;
        u--; v--;
        E[u].push_back({D[v], v, i});
        E[v].push_back({D[u], u, i});
    }
    
    for (int i = 0; i < n; i++)
        sort(E[i].begin(), E[i].end());
    for (int i = 0; i < n; i++)
        S.push_back('a');

    C.assign(m, INF);

    int min_v = 0;
    for (int i = 0; i < n; i++){
        if (D[min_v] > D[i])
            min_v = i;
    }

    visited.resize(n);
    changed.resize(m);
    cleared.resize(n);

    if (dfs(min_v, false, -1)){
        cout << S << endl;
        for (const auto &c: C)
            cout << c << endl;
    } else {
        puts("-1");
    }
}


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

#include <map>
#include <algorithm>
#include <cassert>
#include <queue>
#include <vector>
#include <iostream>
using namespace std;

void dfs(const vector<vector<int>> &G, const map<pair<int,int>> &E,
         vector<int> &W, const vector<int> &D, string &C, int v){
  for(auto v_ : G[v]){
    if(C[v_] != '?') continue;
    if(D[v_] <= D[v]) continue;
    pair<int,int> e(v,v_);
    if(v > v_) swap(e.first,e.second);
    int idx = E[e];

    W[idx] = D[v_]-D[v];
    C[v_] = C[v];
    dfs(G,E,W,D,C,v_);
  }
}

int main(){
  const int INF = 1e9;
  int N, M;
  cin >> N >> M;
  vector<int> D(N);
  for(int i = 0; i < N; ++i){
    cin >> D[i];
  }
  map<pair<int,int>,int> E;
  vector<vector<int>> G(N);
  for(int i = 0; i < M; ++i){
    int u, v;
    cin >> u >> v;
    --u,--v;
    if(u > v) swap(u,v);
    E[{u,v}] = i;
    G[u].push_back(v);
    G[v].push_back(u);
  }
  int d_min = *min_element(D.begin(), D.end());
  // if(count(D.begin(), D.end(), d_min) < 2){
  //   cout << -1 << endl;
  //   return 0;
  // }
  priority_queue<pair<int,int>> pq;
  for(int i = 0; i < N; ++i){
    pq.emplace(-D[i],i);
  }
  vector<int> W(M,-1);
  string C(N,'?');
  char c = 'W';
  while(!pq.empty()){
    int v = pq.top().second;
    int d = -pq.top().first;
    pq.pop();
    if(C[v] != '?') continue;
    bool f = false;
    for(auto v_ : G[v]){
      if(D[v_] == D[v])
        f = true;
    }
    if(!f){
      cout << -1 << endl;
      return 0;
    }
    D[v] = 0;
    C[v] = c;
    dfs(G,E,W,D,C,v);
    if(c == 'W') c = 'B';
    else c = 'W';
    C[v] = c;
  }
  for(auto &w : W){
    if(w < 0) w = INF;
  }
  cout << C << endl;
  for(auto w : W){
    cout << w << "\n";
  }
}


Compiler output:
a.cc:9:62: error: wrong number of template arguments (1, should be at least 2)
    9 | void dfs(const vector<vector<int>> &G, const map<pair<int,int>> &E,
      |                                                              ^~
In file included from /usr/include/c++/14/map:63,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_map.h:102:11: note: provided for 'template<class _Key, class _Tp, class _Compare, class _Alloc> class std::map'
  102 |     class map
      |           ^~~
a.cc: In function 'void dfs(const std::vector<std::vector<int> >&, const int&, std::vector<int>&, const std::vector<int>&, std::string&, int)':
a.cc:16:16: error: no match for 'operator[]' (operand types are 'const int' and 'std::pair<int, int>')
   16 |     int idx = E[e];
      |                ^
a.cc: In function 'int main()':
a.cc:71:11: error: invalid initialization of reference of type 'const int&' from expression of type 'std::map<std::pair<int, int>, int>'
   71 |     dfs(G,E,W,D,C,v);
      |           ^
a.cc:9:66: note: in passing argument 2 of 'void dfs(const std::vector<std::vector<int> >&, const int&, std::vector<int>&, const std::vector<int>&, std::string&, int)'
    9 | void dfs(const vector<vector<int>> &G, const map<pair<int,int>> &E,
      |                                        ~~~~~~~~~~~~~~~~~~~~~~~~~~^
Language: C++

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

struct edge{
	int to, num;
};

int main(){
	int N, M; cin >> N >> M;
	vector<pair<int, int>> D;
	int dd[N];
	vector<int> C(M, -1);
	for(int i=0; i<N; i++){
		int d; cin >> d;
		dd[i] = d;
		D[i].push_back({d, i});
	}
	vector<edge> G[N];
	for(int i=0; i<M; i++){
		int u, v; cin >> u >> v;
		u--; v--;
		G[u].push_back({v, i});
		G[v].push_back({u, i});
	}
	sort(d.begin(), d.end());
	vector<int> c(N, -1);
	for(int i=0; i<N; i++){
		if(c[i] != -1) continue;
		int now = d[i].second;
		int cnt = d[i].first;
		for(int j=0; j<G[now].size(); j++){
			if(dd[G[now][j].to] == cnt){
				if(c[G[now][j].to] != -1){
					c[now] = 1-c[G[now][j].to];
					C[G[now][j].to] = cnt;
					break;
				}else{
					c[now] = 0;
					c[G[now][j].to] = 1;
					C[G[now][j].to] = cnt;
					break;
				}
			}else if(dd[G[now][j].to] < cnt){
				c[now] = 1-c[G[now][j].to];
				C[G[now][j].to] = cnt - dd[G[now][j].to];
				break;
			}
		}
		if(c[now] == -1){
			cout << -1 << endl;
			return 0;
		}
	}
	for(int i=0; i<N; i++){
		if(c[i]) cout << 'W';
		else cout << 'B';
	}
	for(int i=0; i<M; i++){
		if(C[i] == -1) cout << 1000000000 << endl;
		else cout << C[i] << endl;
	}
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:22: error: '__gnu_cxx::__alloc_traits<std::allocator<std::pair<int, int> >, std::pair<int, int> >::value_type' {aka 'struct std::pair<int, int>'} has no member named 'push_back'
   19 |                 D[i].push_back({d, i});
      |                      ^~~~~~~~~
a.cc:28:14: error: 'd' was not declared in this scope
   28 |         sort(d.begin(), d.end());
      |              ^
Language: C++

#include "iostream"
#include "climits"
#include "list"
#include "queue"
#include "stack"
#include "set"
#include "functional"
#include "algorithm"
#include "string"
#include "map"
#include "unordered_map"
#include "unordered_set"
#include "iomanip"
#include "cmath"
#include "random"
#include "bitset"
#include "cstdio"
#include "numeric"
#include "cassert"
#include "ctime"

using namespace std;

constexpr long long int MOD = 1000000007;
//constexpr int MOD = 1000000007;
//constexpr int MOD = 998244353;
//constexpr long long int MOD = 998244353;
constexpr long double EPS = 1e-12;

//int N, M, K, H, W, L, R;
long long int N, M, K, H, W, L, R;


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

	cin >> N >> M;
	vector<pair<int, pair<int, int>>>v(N);
	vector<int>w(N);
	for (int i = 0; i < N; i++) {
		cin >> K;
		v[i] = { (int)K,{(int)MOD,i} };
		w[i] = K;
	}
	vector<set<pair<int, int>>>edge(N);
	for (int i = 0; i < M; i++) {
		cin >> L >> R;
		L--, R--;
		edge[L].insert({ R,i });
		edge[R].insert({ L,i });
	}
	for (int i = 0; i < N; i++) {
		for (auto j : edge[i]) {
			v[i].second.first = min(v[i].second.first, w[j.first]);
		}
	}
	sort(v.begin(), v.end());


	vector<int>weight(M);
	string color(N, 'a');
	bool flag = true;
	for (auto i : v) {
		if (i.second.first > i.first) {
			cout << -1 << endl;
			return 0;
		}
		int skip = -1;
		for (auto j : edge[i.second.second]) {
			if (w[j.first] == i.second.first) {
				skip = j.first;
				if (w[j.first] < i.first) {
					color[i.second.second] = color[j.first];
					weight[j.second] = i.first - w[j.first];
				}
				else {
					if (color[j.first] == 'B')color[i.second.second] = 'W';
					else color[i.second.second] = 'B';
					weight[j.second] = i.first;
				}
				break;
			}
		}
		for (auto j : edge[i.second.second]) {
			if (j.first == skip)continue;
			if (weight[j.second])continue;
			if (w[j.first] > i.first)continue;
			weight[j.second] = i.first;
		}
	}
	bool flag = true;
	for (auto i : color)if (i == 'a')flag = false;
	assert(flag);
	cout << color << endl;
	for (auto i : weight)cout << i << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:92:14: error: redeclaration of 'bool flag'
   92 |         bool flag = true;
      |              ^~~~
a.cc:63:14: note: 'bool flag' previously declared here
   63 |         bool flag = true;
      |              ^~~~
Language: C++

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

int main(){
int n,m;
cin>>n>>m;
map<int,int> d;
m=1000000000;
for(int i=1;i<=n;i++){
cin>>x;
d[x]++;
m=min(m,x);
}
if(d[m]<2)cout<<-1<<endl;
}

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

#include <bits/stdc++.h>
#define F(i,a,b) for (int i=a;i<=b;i++)
#define R(i,a,b) for (int i=a;i<int(b);i++)
#define D(i,a,b) for (int i=a;i>=b;i--)
#define go(i,x) for (int i=head[x];i;i=Next[i])
#define pb push_back
#define si size()
#define fi first
#define se second
#define pa pair < ll,ll >
#define ll long long
#define mp make_pair
#define be begin()
#define en end()
#define put putchar('\n')
#define gc getchar
#define pc putchar
#define N 600055
#define mo 998244353
#define inf 1000000007
//#define int ll
#define ret return puts("-1"),0
using namespace std;
inline ll read(){
	ll su=0,f=1;char c=gc();
	for (;c<'0'||c>'9';c=gc()) if (c=='-') f=-1;
	for (;c>='0'&&c<='9';c=gc()) su=su*10+c-'0';
	return su*f;
}
inline void wr(ll x){
	if (x<0) pc('-'),wr(-x);
	else{if (x>=10) wr(x/10);pc(x%10+'0');}
}
inline void wri(ll x){wr(x);pc(' ');}
inline void wrn(ll x){wr(x);put;}
inline void wrn(ll x,ll y){wri(x);wrn(y);}
inline void wrn(ll x,ll y,ll z){wri(x);wrn(y,z);}
int n,m,ans,a[105][105],b[105][105],f[105][105],vis[105],fl[105];
char str[N];
inline void ad(int &x,int k){x+=k;x-=(x>=mo)?mo:0;}
int ksm(ll x,int k){
	int su=1;
	for (;k;k>>=1,x=x*x%mo) if (k&1) su=su*x%mo;
	return su;
}
int fac[N],inv[N];
int C(int n,int m){return (n<m||m<0)?0:1ll*fac[n]*inv[m]%mo*inv[n-m]%mo;}
void init_c(int n){
	fac[0]=1;F(i,1,n) fac[i]=1ll*fac[i-1]*i%mo;
	inv[n]=ksm(fac[n],mo-2);D(i,n-1,0) inv[i]=1ll*inv[i+1]*(i+1)%mo;
}
int init(int n,int m){
	int ans=0;
	F(a,0,n) F(b,0,m){
		int t=1ll*C(n,a)*C(m,b)%mo
		ad(ans,*ksm(m-b+1,a)%mo*ksm(b+1,n-a)%mo);
	}
	return ans;
}
void check(){
	F(i,1,n) F(j,1,m) b[i][j]=a[i][j];
	F(i,1,n) if (vis[i]) F(j,1,m) b[i][j]=-1;
	F(j,1,m) if (vis[n+j]) F(i,1,n) b[i][j]=-1;
	F(i,1,n){
		fl[0]=fl[1]=0;
		F(j,1,m) if (b[i][j]!=-1) fl[b[i][j]]++;
		if (fl[0]==0||fl[1]==0) return;
	}
	F(j,1,m){
		fl[0]=fl[1]=0;
		F(i,1,n) if (b[i][j]!=-1) fl[b[i][j]]++;
		if (fl[0]==0||fl[1]==0) return;
	}
	int a=0,b=0;
	F(i,1,n) if (vis[i]) a++;
	F(i,1,m) if (vis[i+n]) b++;
	ad(ans,f[a][b]);
}
void dfs(int x){
	if (x==n+m+1){
		check();return;
	}
	vis[x]=1;dfs(x+1);vis[x]=0;dfs(x+1);	
}
signed main(){
	n=read();m=read();init_c(1000);
	F(i,1,n){
		scanf("%s",str+1);
		F(j,1,m) a[i][j]=(str[j]=='.')?1:0;
	}
	F(i,0,n) F(j,0,m) f[i][j]=init(i,j);
	F(i,0,n) F(j,0,m) wrn(i,j,f[i][j]);
	dfs(1);
	wrn(ans);
	return 0;
}

Compiler output:
a.cc: In function 'int init(int, int)':
a.cc:56:17: error: expected ',' or ';' before 'ad'
   56 |                 ad(ans,*ksm(m-b+1,a)%mo*ksm(b+1,n-a)%mo);
      |                 ^~
Language: C++

#include <iostream>
#include <algorithm>
using namespace std;
typedef long long ll;
const int m=998244353;
int main() {
  ll h,w; cin>>h>>w; string s[h];
  for(int i=0;i<h;i++) {
    cin>>s[i];
  }
  ll dp[1<<(h+w)]; fill(dp[0], dp[1<<(h+w)], 0); dp[0]=1;
  for(int i=0;i<h+w;i++) {
    for(int j=0;j<(1<<(h+w));j++) {
      for(int p=0;p<h;p++) {
      for(int k=0;k<h;k++) {
        for(int x=0;x<w;j++) {
          dp[j|(1<<p)] = dp[j] * 2;
        }
      }}
      for(int p=0;p<w;p++) {
      for(int k=0;k<h;k++) {
        for(int x=0;x<w;j++) {
          dp[j|(1<<h+p)] = dp[j] * 2;
        }
      }}
    }
  }
  ll sm=0;
  for(int i=0;i<(1<<(h+w));i++) {
    sm = (sm+dp[i]) % m;
  }
  cout<<sm<<endl;
}

Compiler output:
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h: In instantiation of 'typename __gnu_cxx::__enable_if<std::__is_scalar<_Tp>::__value, void>::__type std::__fill_a1(_ForwardIterator, _ForwardIterator, const _Tp&) [with _ForwardIterator = long long int; _Tp = int; typename __gnu_cxx::__enable_if<__is_scalar<_Tp>::__value, void>::__type = void]':
/usr/include/c++/14/bits/stl_algobase.h:998:21:   required from 'void std::__fill_a(_FIte, _FIte, const _Tp&) [with _FIte = long long int; _Tp = int]'
  998 |     { std::__fill_a1(__first, __last, __value); }
      |       ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:1029:20:   required from 'void std::fill(_ForwardIterator, _ForwardIterator, const _Tp&) [with _ForwardIterator = long long int; _Tp = int]'
 1029 |       std::__fill_a(__first, __last, __value);
      |       ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:11:24:   required from here
   11 |   ll dp[1<<(h+w)]; fill(dp[0], dp[1<<(h+w)], 0); dp[0]=1;
      |                    ~~~~^~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:952:9: error: invalid type argument of unary '*' (have 'long long int')
  952 |         *__first = __tmp;
      |         ^~~~~~~~
Language: C++

嘘っぽい　完

Compiler output:
a.cc:1:1: error: extended character 　 is not valid in an identifier
    1 | 嘘っぽい　完
      | ^
a.cc:1:1: error: '\U00005618\U00003063\U0000307d\U00003044\U00003000\U00005b8c' does not name a type
    1 | 嘘っぽい　完
      | ^~~~~~~~~~~~
Language: C++

2^10 * 3^10 * 6 みたいなオーダーで行けそうな気がします

Compiler output:
a.cc:1:1: error: expected unqualified-id before numeric constant
    1 | 2^10 * 3^10 * 6 みたいなオーダーで行けそうな気がします
      | ^
Language: C++

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

char c;

int main() {
    // karakter itu punya kode
    cin >> c; // 'd'
    cout << int(c) << endl; // kode karakter 'd' 
    cout << char(c+1) << endl;  // huruf setelah 'd'
    
    // cek apakah variabel c mengandung huruf kecil
    if ('a' <= c && c <= 'z') {
        cout << "huruf kecil" << endl;
    }
    
    // ubah huruf kecil ke huruf besar
    c = c - 'a' + 'A';
    cout << c << endl;

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

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

int main() {
    // karakter itu punya kode
    cin >> c; // 'd'
    cout << int(c) << endl; // kode karakter 'd' 
    cout << char(c+1) << endl;  // huruf setelah 'd'
    
    // cek apakah variabel c mengandung huruf kecil
    if ('a' <= c && c <= 'z') {
        cout << "huruf kecil" << endl;
    }
    
    // ubah huruf kecil ke huruf besar
    c = c - 'a' + 'A';
    cout << c << endl;

Compiler output:
a.cc: In function 'int main()':
a.cc:6:12: error: 'c' was not declared in this scope
    6 |     cin >> c; // 'd'
      |            ^
a.cc:17:23: error: expected '}' at end of input
   17 |     cout << c << endl;
      |                       ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

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

int alpha,beta;
char c;

int main(){
	cin>>c;
	alpha=(int)c;
	beta=alpha+1;
	cout<<(char)beta<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:9: error: reference to 'beta' is ambiguous
   11 |         beta=alpha+1;
      |         ^~~~
In file included from /usr/include/c++/14/cmath:3906,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:114,
                 from a.cc:1:
/usr/include/c++/14/bits/specfun.h:341:5: note: candidates are: 'template<class _Tpa, class _Tpb> typename __gnu_cxx::__promote_2<_Tp, _Up>::__type std::beta(_Tpa, _Tpb)'
  341 |     beta(_Tpa __a, _Tpb __b)
      |     ^~~~
a.cc:5:11: note:                 'int beta'
    5 | int alpha,beta;
      |           ^~~~
a.cc:12:21: error: reference to 'beta' is ambiguous
   12 |         cout<<(char)beta<<endl;
      |                     ^~~~
/usr/include/c++/14/bits/specfun.h:341:5: note: candidates are: 'template<class _Tpa, class _Tpb> typename __gnu_cxx::__promote_2<_Tp, _Up>::__type std::beta(_Tpa, _Tpb)'
  341 |     beta(_Tpa __a, _Tpb __b)
      |     ^~~~
a.cc:5:11: note:                 'int beta'
    5 | int alpha,beta;
      |           ^~~~
Language: Java

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String c = sc.next();
        String s = "abcdefghijklmnopqrstuvwxyz";
        System.out.print(s.charAt(is(c.charAt(0)) + 1));
    }
    static int is(char c) {
        String s = "abcdefghijklmnopqrstuvwxyz";
        int re;
        for (int i=0; i<26; i++) {
            if (s.charAt(i) == c) {
                re = i;
            }
        }
        return re;
    }
}


Compiler output:
Main.java:18: error: variable re might not have been initialized
        return re;
               ^
1 error
Language: Java

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String c = sc.next();
        String s = "abcdefghijklmnopqrstuvwxyz";
        System.out.print(s.charAt(is(c.charAt(0)) + 1));
    }
    static int is(char c) {
        String s = "abcdefghijklmnopqrstuvwxyz";
        for (int i=0; i<26; i++) {
            if (s.charAt(i) == c) {
                return i;
            }
        }
    }
}


Compiler output:
Main.java:17: error: missing return statement
    }
    ^
1 error
Language: Java

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        char c = sc.nextChar();
        String s = "abcdefghijklmnopqrstuvwxyz";
        System.out.print(s.charAt(is(c) + 1));
    }
    static int is(char c) {
        String s = "abcdefghijklmnopqrstuvwxyz";
        for (int i=0; i<26; i++) {
            if (s.charAt(i) == c) {
                return i;
            }
        }
    }
}


Compiler output:
Main.java:6: error: cannot find symbol
        char c = sc.nextChar();
                   ^
  symbol:   method nextChar()
  location: variable sc of type Scanner
1 error
Language: C++

#include  <stdio.h>

int main()
{
    int 
    printf("%c", 'a' + 1);
    
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:25: error: expression list treated as compound expression in initializer [-fpermissive]
    6 |     printf("%c", 'a' + 1);
      |                         ^
Language: C

#include<stdio.h>
Int main (){
Char ch;
Scanf(%c,&ch);
Printf(%c,ch+1);
Return 0;

}



Compiler output:
main.c:2:1: error: unknown type name 'Int'; did you mean 'int'?
    2 | Int main (){
      | ^~~
      | int
main.c: In function 'main':
main.c:3:1: error: unknown type name 'Char'; did you mean 'char'?
    3 | Char ch;
      | ^~~~
      | char
main.c:4:1: error: implicit declaration of function 'Scanf'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    4 | Scanf(%c,&ch);
      | ^~~~~
      | scanf
main.c:4:7: error: expected expression before '%' token
    4 | Scanf(%c,&ch);
      |       ^
main.c:5:1: error: implicit declaration of function 'Printf'; did you mean 'printf'? [-Wimplicit-function-declaration]
    5 | Printf(%c,ch+1);
      | ^~~~~~
      | printf
main.c:5:8: error: expected expression before '%' token
    5 | Printf(%c,ch+1);
      |        ^
main.c:6:1: error: 'Return' undeclared (first use in this function)
    6 | Return 0;
      | ^~~~~~
main.c:6:1: note: each undeclared identifier is reported only once for each function it appears in
main.c:6:7: error: expected ';' before numeric constant
    6 | Return 0;
      |       ^~
      |       ;