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

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

int main(void) {
    int N;
    cin >> N;
    vector< int > a(N - 1), b(N - 1), c(N);
    vector< int > count(N);
    for (int i = 0; i < N; ++i) {
        count[i] = 0;
    }
    for (int i = 0; i < N - 1; ++i) {
        int at, bt;
        cin >> at >> bt;
        a[i] = min(at, bt);
        b[i] = max(at, bt);
        count[at]++;
        count[bt]++;
    }
    vector< pair< int, int > > cc(N);
    for (int i = 0; i < N; ++i) {
        cc[i] = make_pair(count[i], i);
    }
    for (int i = 0; i < N; ++i) {
        cin >> c[i];
    }
    sort(cc.begin(), cc.end());
    reverse(cc.begin(), cc.end());
    sort(c.begin(), c.end());
    reverse(c.begin(), c.end());
    vector< int > ans(N);
    for (int i = 0; i < N; ++i) {
        ans[cc[i].second] = c[i];
    }
    int sum = 0;
    for (int i = 0; i < N - 1; ++i) {
        sum += min(ans[a[i] - 1] - ans[b[i] - 1]);
    }
    cout << sum << endl;
    for (int i = 0; i < N; ++i) {
        cout << ans[i] << " ";
    }
    cout << "\n";

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:37:19: error: no matching function for call to 'min(__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type)'
   37 |         sum += min(ans[a[i] - 1] - ans[b[i] - 1]);
      |                ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 1 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   template argument deduction/substitution failed:
a.cc:37:19: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   37 |         sum += min(ans[a[i] - 1] - ans[b[i] - 1]);
      |                ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   candidate expects 2 arguments, 1 provided
Language: C++

#include <algorithm>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits.h>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <string>
#include <string.h>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,n) for(int i=1;i<=n;i++)
#define ll long long
#define eps LDBL_EPSILON
#define moder 1000000007
#define double long double
#define INF LLONG_MAX/10000
#define P pair<int,int>
#define prique priority_queue
using namespace std;
int n, a[10010], b[10010], c[10010], ans[10010];
P d[10010];
vector<int> vec[10010];
int used[10010];
void dfs(int s, int p) {
	for (int i : vec[s]) {
		if (!used[i]) {
			used[i] = p + 1;
			dfs(i, p + 1);
		}
	}
}
signed main() {
	cin >> n;
	rep(i, n - 1) {
		cin >> a[i] >> b[i];
		vec[a[i]].push_back(b[i]);
		vec[b[i]].push_back(a[i]);
	}
	rep(i, n)cin >> c[i];
	dfs(1, 0);
	REP(i, n) {
		d[i] = make_pair(used[i], i);
	}
	sort(c, c + n, greater<int>());
	sort(d + 1, d + n + 1);
	REP(i, n) {
		ans[d[i]] = c[i - 1];
	}
	int sum = 0;
	rep(i, n) {
		sum += min(ans[a[i]], ans[b[i]]);
	}
	cout << sum << endl;
	REP(i, n - 1)cout << ans[i] << " ";
	cout << ans[n] << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:53:20: error: no match for 'operator[]' (operand types are 'int [10010]' and 'std::pair<int, int>')
   53 |                 ans[d[i]] = c[i - 1];
      |                    ^
Language: C++

#include <bits/stdc++.h>

#define REP(i, e) for(int (i) = 0; (i) < (e); ++(i))
#define FOR(i, b, e) for(int (i) = (b); (i) < (e); ++(i))
#define ALL(c) (c).begin(), (c).end()
#define SIZE(x) ((int)(x).size())
#define MIN(c) (*min_element(ALL(c))) 
#define MAX(c) (*max_element(ALL(c)))
#define ACC(c) (accumulate(ALL(c), 0))
#define SLL(x, n) ((x) << (n))
#define SRL(x, n) ((x) >> (n))
#define MIN2(a, b) ((a) < (b)) ? (a) : (b)
#define MAX2(a, b) ((a) > (b)) ? (a) : (b)
#define MP(a, b) (make_pair((a), (b)))
#define ENDL "\n"
#define PRINT(x) cout << (x) << ENDL

using namespace std;
using ll = long long;
using pint = pair<int, int>;

inline int in(int& a) {return scanf("%d", &a);}
inline void out(int n) {printf("%d\n", n);}
auto pint_compare = [](pint x, pint y) -> bool{return (x.second < y.second);};

int N, index;
int c[10000];
int d[10000][10000];
bool visited[10000];
vector<int> adj[10000];

int dfs(int s, int node, int prev){
    if(visited[node]) return 0;
    visited[node] = true;
    d[node][s] = c[index];
    index--;
    int ret = MIN2(prev, d[node][s]);
    for(auto next : adj[node]){
        ret += dfs(s, next, d[node][s]);
    }
    return ret;
}

signed main(){
    cin >> N;
    int a, b;
    REP(i, N - 1){
        cin >> a >> b;
        adj[a - 1].push_back(b - 1);
        adj[b - 1].push_back(b - 1);
    }
    REP(i, N){
        cin >> c[i];
    }
    sort(c, c + N);
    int M = 0, s = 0;
    REP(i, N){
        REP(i, N) visited[i] = false;
        index = N - 1;
        int m = dfs(i, 0, 0);
        if(m > M){
            M = m;
            s = i;
        }
    }
    PRINT(M);
    REP(i, N){
        cout << d[i][s];
        if(i < N - 1) cout << " ";
    }
    cout << ENDL;
    return 0;
}

Compiler output:
a.cc:26:8: error: 'int index' redeclared as different kind of entity
   26 | int N, index;
      |        ^~~~~
In file included from /usr/include/string.h:462,
                 from /usr/include/c++/14/cstring:43,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:121,
                 from a.cc:1:
/usr/include/strings.h:50:20: note: previous declaration 'const char* index(const char*, int)'
   50 | extern const char *index (const char *__s, int __c)
      |                    ^~~~~
a.cc: In function 'int dfs(int, int, int)':
a.cc:35:19: error: invalid types 'int [10000][<unresolved overloaded function type>]' for array subscript
   35 |     d[node][s] = c[index];
      |                   ^
a.cc:36:10: error: no post-decrement operator for type
   36 |     index--;
      |          ^~
a.cc: In function 'int main()':
a.cc:59:21: error: overloaded function with no contextual type information
   59 |         index = N - 1;
      |                     ^
Language: C++

#include <algorithm>
#include <cstdio>
#include <iostream>
#include <cfloat>
#include <climits>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <queue>
#include <sstream>
#include <stack>
#include <time.h>
#include <vector>
#include <complex>
#include <map>
#include <set>
#include <iomanip>
#include <math.h>
#include <stdlib.h>
#include <list>
#include <utility>
#include <memory>
#include <cstring>
#include <fstream>
#include <numeric>
#include <assert.h>
#include <bitset>
#include <ios> 
#include <bits/stdc++.h>
using namespace std;
int id;
typedef long long ll;
vector <int> g[100004];
int a[100004];
int val[100004];
void dfs(int pos,int no){
	val[pos]=a[id--];
	for (int i=0;i<g[pos].size();i++) if(g[pos][i]!=no) dfs(g[pos][i],pos);
}
int main(){
	int n,m;cin>>n>>m;
	for (int i=0;i<n-1;i++){
		int x,y;
		cin>>x>>y;
		g
	}vector<int> ans;
	for (int i=0;i<n;i++) cin>>a[i];
	ll res=0;
	sort (a,a+n);
	for (int i=0;i<n-1;i++) res+=a[i];
	cout<<res;
	id=n-1;
	dfs(1,-1);
	for (int i=1;i<=n;i++) cout<<val[i]<<" ";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:45:18: error: expected ';' before '}' token
   45 |                 g
      |                  ^
      |                  ;
   46 |         }vector<int> ans;
      |         ~
Language: C++

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> p;
const int INF = (1 << 28);
const int dx[4] = {0,1,0,-1}, dy[4] = {-1,0,1,0};
const int Dx[8] = {0,1,1,1,0,-1,-1,-1}, Dy[8] = {-1,-1,0,1,1,1,0,-1};
#define yes cout << "Yes" << endl
#define YES cout << "YES" << endl
#define no cout << "No" << endl
#define NO cout << "NO" << endl
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
int n;
vector<int> G[10001];
int c[10001];

void add_edge(int u,int v){
    G[u].push_back(v);
    G[v].push_back(u);
}
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >> n;
    for(int i=0;i<n-1;i++){
        int a, b;
        cin>>a>>b;
        add_edge(a,b);
    }
    for(int i=0;i<n;i++){
        cin>>c[i];
    }
    sort(c,c+n);
    ll ans=0;
    int ansr[n];
    bool used[n];
    for(int i=0;i<n;i++){
        used[i]=false;
    }
    for(int i=0;i<n;i++){
        int maxed;
        int msize=100000;
        int minj;
        for(int j=1;j<=n;j++){
            if(G[j].size()<msize&&G[j].size()!=0){
                minj=j;
                msize=G[j].size();
            }
        }
        if(msize!=100000){
        used[minj-1]=true;
        ansr[minj-1]=c[i];
        ans+=msize*c[i];
        int gs=G[minj].size();
        for(int k=0;k<gs;k++){
            if(G[G[minj][k]].size()!=0) continue;

            for(int h=0;h<G[G[minj][k]].size();h++){
            if(G[G[minj][k]][h]==G[minj][k]){
            G[G[minj][k]].erase(G[G[minj][k]].begin()+h);
            break;
            }
        }    
        G[minj].erase(G[minj].begin(),G[minj].begin()+gs);
        }
        else{
            bool ca=false;
            int d=0;
            while(ca==false&&d!=n){
                if(used[d]==false){
                    used[d]=true;
                    ansr[d]=c[i];
                    ca=true;
                }
                d++;
            }
        }
    }
    cout << ans << "\n";
    for(int i=0;i<n;i++){
        cout<<ansr[i]<<" ";
    }
    cout<<"\n";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:88:9: error: expected '}' before 'else'
   88 |         else{
      |         ^~~~
a.cc:72:26: note: to match this '{'
   72 |         if(msize!=100000){
      |                          ^
Language: C++

#include<iostream>
#include<vector>
#include<bits/stdc++.h>
using namespace std;
int sum[10010]={0};
struct node{
    int a,b;
};
int c[10010]={0};
int num[10010]={0};
int main()
{
    node t[10010];
    int n;
    cin >> n;
    int a,b;
    for(int i=0;i<n-1;++i){
    cin >> t[i].a>> t[i].b;
    }
    for(int i=0;i<n;i++)
    cin>>c[i];
    sort(c,c+n);
    int index1=0;
    long long res=0;
    for(int i=n-2;i>=0;i--){
        res+=c[index1];
        num[t[i].b]=c[index1++];
    }
    num[t[0].a]=c[index1];
    cout << res << endl;
    for(int i=1;i<=n;i++){
        cout << num[i] << " \n"[i==n];
    }
    return 0#include<iostream>
#include<vector>
#include<bits/stdc++.h>
using namespace std;
int sum[10010]={0};
struct node{
    int a,b;
};
int c[10010]={0};
int num[10010]={0};
int main()
{
    node t[10010];
    int n;
    cin >> n;
    int a,b;
    for(int i=0;i<n-1;++i){
    cin >> t[i].a>> t[i].b;
    }
    for(int i=0;i<n;i++)
    cin>>c[i];
    sort(c,c+n);
    int index1=0;
    long long res=0;
    for(int i=n-2;i>=0;i--){
        res+=c[index1];
        num[t[i].b]=c[index1++];
    }
    num[t[0].a]=c[index1];
    cout << res << endl;
    for(int i=1;i<=n;i++){
        cout << num[i] << " \n"[i==n];
    }
    return 0;
}

Compiler output:
a.cc:34:13: error: stray '#' in program
   34 |     return 0#include<iostream>
      |             ^
a.cc: In function 'int main()':
a.cc:34:13: error: expected ';' before 'include'
   34 |     return 0#include<iostream>
      |             ^~~~~~~~
      |             ;
a.cc:34:14: error: 'include' was not declared in this scope
   34 |     return 0#include<iostream>
      |              ^~~~~~~
a.cc:34:30: error: expected primary-expression before '>' token
   34 |     return 0#include<iostream>
      |                              ^
a.cc:37:1: error: expected primary-expression before 'using'
   37 | using namespace std;
      | ^~~~~
a.cc:44:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   44 | int main()
      |         ^~
a.cc:44:9: note: remove parentheses to default-initialize a variable
   44 | int main()
      |         ^~
      |         --
a.cc:44:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:45:1: error: a function-definition is not allowed here before '{' token
   45 | {
      | ^
a.cc:68:2: error: expected '}' at end of input
   68 | }
      |  ^
a.cc:12:1: note: to match this '{'
   12 | {
      | ^
Language: C++

#include<iostream>
#include<vector>
using namespace std;
int sum[10010]={0};
struct node{
    int a,b;
};
int c[10010]={0};
int num[10010]={0};
int main()
{
    node t[10010];
    int n;
    cin >> n;
    int a,b;
    for(int i=0;i<n-1;++i){
    cin >> t[i].a>> t[i].b;
    }
    for(int i=0;i<n;i++)
    cin>>c[i];
    sort(c,c+n);
    int index1=0;
    long long res=0;
    for(int i=n-2;i>=0;i--){
        res+=c[index1];
        num[t[i].b]=c[index1++];
    }
    num[t[0].a]=c[index1];
    cout << res << endl;
    for(int i=1;i<=n;i++){
        cout << num[i] << " \n"[i==n];
    }
    return 0;
}

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

#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<bits/stdc++.h>
#include<cmath>
#include<bitset>
using namespace std;



int par[100000];　//親
int rank[100000]; //木の深さ
  
//n要素で初期化
void init(int n){
  for(int i=0; i<n; ++i){
    par[i]=i;
    rank[i]=0;
  }
}

//木の親を求める
int find(int x){
  if(par[x]==x) return x;
  else return par[x]=find(par[x]);
}


//xとyの属する集合を併合
void unite(int x, int y){
  x=find(x);
  y=find(y);
  if(x==y) return;
  if(rank[x]<rank[y]) par[x]=y;
  else{
    par[y]=x;
    if(rank[x]==rank[y]) rank[x]++;
  }
}

//xとyが同じ集合に属するか否か
bool same(int x, int y){
  return find(x)==find(y);
}



void solve(){
  int N;
  cin>>N;
  
  //Union-Find木を初期化
  init(N);
  
  
  
  
  
}

Compiler output:
a.cc:12:17: error: extended character 　 is not valid in an identifier
   12 | int par[100000];　//親
      |                 ^
a.cc:12:17: error: '\U00003000' does not name a type
   12 | int par[100000];　//親
      |                 ^~
a.cc: In function 'void init(int)':
a.cc:19:10: error: redeclaration of 'auto i'
   19 |     rank[i]=0;
      |          ^
a.cc:17:11: note: 'int i' previously declared here
   17 |   for(int i=0; i<n; ++i){
      |           ^
a.cc:19:13: error: class template argument deduction failed:
   19 |     rank[i]=0;
      |             ^
a.cc:19:13: error: no matching function for call to 'rank(int)'
In file included from /usr/include/c++/14/bits/move.h:37,
                 from /usr/include/c++/14/bits/exception_ptr.h:41,
                 from /usr/include/c++/14/exception:166,
                 from /usr/include/c++/14/ios:41,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/type_traits:1437:12: note: candidate: 'template<class> rank()-> std::rank< <template-parameter-1-1> >'
 1437 |     struct rank
      |            ^~~~
/usr/include/c++/14/type_traits:1437:12: note:   candidate expects 0 arguments, 1 provided
/usr/include/c++/14/type_traits:1437:12: note: candidate: 'template<class> rank(std::rank< <template-parameter-1-1> >)-> std::rank< <template-parameter-1-1> >'
/usr/include/c++/14/type_traits:1437:12: note:   template argument deduction/substitution failed:
a.cc:19:13: note:   mismatched types 'std::rank< <template-parameter-1-1> >' and 'int'
   19 |     rank[i]=0;
      |             ^
a.cc: In function 'void unite(int, int)':
a.cc:35:10: error: expected unqualified-id before '[' token
   35 |   if(rank[x]<rank[y]) par[x]=y;
      |          ^
a.cc:38:12: error: expected unqualified-id before '[' token
   38 |     if(rank[x]==rank[y]) rank[x]++;
      |            ^
a.cc:38:33: error: expected initializer before '++' token
   38 |     if(rank[x]==rank[y]) rank[x]++;
      |                                 ^~
a.cc:38:33: error: expected ';' before '++' token
Language: C++

#include "pch.h"
#include <string>
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <queue>

using namespace std;

void d()
{
	int N;
	cin >> N;
	vector<pair<int, int>> ab(N-1);
	for (int i = 0; i < N-1; i++) {
		int a, b;
		cin >> a >> b;
		ab[i] = pair<int, int>(a-1, b-1);
	}
	vector<int> c(N);
	for (int i = 0; i < N; i++) {
		cin >> c[i];
	}

	// 全nodeのrankを求める
	vector<int> rank(N);
	for (int i = 0; i < N; i++) {
		rank[i] = 0;
	}
	for (int i = 0; i < N-1; i++) {
		rank[ab[i].first]++;
		rank[ab[i].second]++;
	}

	sort(c.begin(), c.end(), greater<int>());

	// rankの最も大きいものをrootとしてcの最大入れる
	int maxNode = 0;
	for (int i = 1; i < N - 1; i++) {
		if (rank[maxNode] < rank[i])
			maxNode = i;
	}

	int count = 0;
	vector<int> res(N);
	priority_queue<pair<int, int>> queue;
	queue.push(pair<int, int>(rank[maxNode], maxNode));
	vector<bool> reach(N); // そのノードを処理したかどうかを覚える
	for (int i = 0; i < N; i++) {
		reach[i] = false;
	}
	reach[maxNode] = true;
	while (queue.size() > 0) {
		int current = queue.top().second;
		queue.pop();

		res[current] = c[count++];
		
		// 現在のnodeとの間にedgeがあるnodeを抽出
		for (pair<int, int> t : ab) {
			if (t.first == current && ! reach[t.second]) {
				queue.push(pair<int, int>(rank[t.second], t.second));
				reach[t.second] = true;
			}
			if (t.second == current && ! reach[t.first]) {
				queue.push(pair<int, int>(rank[t.first], t.first));
				reach[t.first] = true;
			}
		}
	}

	long long int sum = 0;
	for (int i = 1; i < N; i++) {
		sum += c[i];
	}

	cout << sum << endl;
	cout << res[0];
	for (int i = 1; i < N; i++) {
		cout << " " << res[i];
	}
	cout << endl;
}

int main()
{
	d();
}



Compiler output:
a.cc:1:10: fatal error: pch.h: No such file or directory
    1 | #include "pch.h"
      |          ^~~~~~~
compilation terminated.
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
    int number;
    cin >> number;
    vector<set<int> > list(number);
    vector<int> pointc;
    vector<int> pointa;
    int answer=0;
    
    for(int i=0;i<number-1;i++){
        int s,t;
        cin >> s >> t;
        list.at(s).insert(t);
        list.at(t).insert(s);
    }
    
    for(int i=0;i<number;i++){
        cin >> pointc.at(i);
    }
    
    sort(pointc.begin(),pointc.end(),greater<>());
    
    for(int i=1;i<number;i++){
        answer +=pointc.at(i);
    }
    while(pointc.size()!=0){
        for(int i=0;i<number;i++){
            if(list.at(i).size()==1){
                int j=list.at(i).size();
                int k=pointc.end();
                pointa.at(i)=k;
                pointc.pop_back();
                list.at(j).erase(i+1);
            }
        }
    }
    cout << answer << endl;
    for(int i=0;i<number;i++){
        cout << pointa.at(i);
    }
    cout << endl;
}









Compiler output:
a.cc: In function 'int main()':
a.cc:31:33: error: cannot convert 'std::vector<int>::iterator' to 'int' in initialization
   31 |                 int k=pointc.end();
      |                       ~~~~~~~~~~^~
      |                                 |
      |                                 std::vector<int>::iterator
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
    int number;
    cin >> number;
    vector<set<int>> list(number);
    vector<int> pointc;
    vector<int> pointa;
    int answer=0;
    
    for(int i=0;i<number-1;i++){
        int s,t;
        cin >> s >> t;
        list.at(s).insert(t);
        list.at(t).insert(s);
    }
    
    for(int i=0;i<number;i++){
        cin >> pointc.at(i);
    }
    
    sort(pointc.begin(),pointc.end(),greater<>());
    
    for(int i=1;i<number;i++){
        answer +=pointc.at(i);
    }
    while(pointc.size()!=0){
        for(int i=0;i<number;i++){
            if(list.at(i).size()==1){
                int j=list.at(i).size();
                int k=pointc.end();
                pointa.at(i)=k;
                pointc.pop_back();
                list.at(j).erase(i+1);
            }
        }
    }
    cout << answer << endl;
    for(int i=0;i<number;i++){
        cout << pointa.at(i);
    }
    cout << endl;
}









Compiler output:
a.cc: In function 'int main()':
a.cc:31:33: error: cannot convert 'std::vector<int>::iterator' to 'int' in initialization
   31 |                 int k=pointc.end();
      |                       ~~~~~~~~~~^~
      |                                 |
      |                                 std::vector<int>::iterator
Language: C++

#pragma GCC optimize("Ofast")
#include <set>
#include <map>
#include <cmath>
#include <stack>
#include <queue>
#include <vector>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <algorithm>
#define endl '\n'
#define fast ios::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#define zy 2333333
#define bql 2147483647
const int MAXN=10005;
using namespace std;
int n;
vector<int> v[MAXN];
int c[MAXN];
int ans=0;
int index=0;
int xans[MAXN];

bool cmp(int x,int y){return x>y;}

void dfs(int no,int father)
{
	xans[no]=++index;
	for (int i=0;i<v[no].size();i++)
	{
		int u=v[no][i];
		if (u!=father)
		{
			dfs(u,no);
		}
	}
}
int main()
{
	fast;
	cin>>n;
	for (int i=1;i<n;i++)
	{
		int x,y;
		cin>>x>>y;
		v[x].push_back(y);
		v[y].push_back(x);
	}

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

	sort(c+1,c+1+n,cmp);

	for (int i=2;i<=n;i++)
	{
		ans+=c[i];
	}
	cout<<ans<<endl;

	dfs(1,-1);
	for (int i=1;i<=n;i++)
	{
		cout<<c[xans[i]]<<" ";
	}
	cout<<endl;
	return 0;
}


Compiler output:
a.cc:23:5: error: 'int index' redeclared as different kind of entity
   23 | int index=0;
      |     ^~~~~
In file included from /usr/include/string.h:462,
                 from /usr/include/c++/14/cstring:43,
                 from a.cc:10:
/usr/include/strings.h:50:20: note: previous declaration 'const char* index(const char*, int)'
   50 | extern const char *index (const char *__s, int __c)
      |                    ^~~~~
a.cc: In function 'void dfs(int, int)':
a.cc:30:20: error: no pre-increment operator for type
   30 |         xans[no]=++index;
      |                    ^~~~~
Language: C++

#include <iostream>
#include <vector>
#include <utility>

using namespace std;

struct node {
	vector<int> v;
	int c;
};

node tree[10005];

int main() {
	
	int n; cin >> n;
	int a, b;
	vector<int> c(n);
	vector<pair<int, int> > cnt(n + 1, make_pair(0, 0));
	for (int i = 0; i < n; ++i) cnt[i].second = i + 1;
	for (int i = 0; i < n - 1; ++i) {
		cin >> a >> b;
		tree[a].v.push_back(b);
		cnt[a].first++; cnt[b].first++;
	}
	for (int i = 0; i < n; ++i) cin >> c[i];
	sort(c.begin(), c.end(), greater<int>());
	for (int i = 0; i < n; ++i) tree[cnt[i].second].c = c[i];
	int ans = 0;
	for (int i = 1; i <= n; ++i) {
		for (int j = 0; j < tree[i].v.size(); ++j) {
			if (tree[i].c > tree[tree[i].v[j]].c) ans += tree[tree[i].v[j]].c;
			else ans += tree[i].c;
		}
	}
	cout << ans << endl;
	for (int i = 1; i <= n; ++i) {
		if (i != 1) cout << " ";
		cout << tree[i].c;
	}
	cout << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   27 |         sort(c.begin(), c.end(), greater<int>());
      |         ^~~~
      |         short
Language: C++

#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <cassert>
#include <iostream>
#include <sstream>
#include <fstream>
#include <string>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <utility>
#include <stack>
#include <numeric>
#include <algorithm>
#include <bitset>
#include <complex>
#include <iomanip>

using namespace std;
typedef long long ll;
typedef long long int llint;
typedef pair<ll, ll> pa;
#define MM 1000000000
#define MOD MM+7
#define MAX 101000
#define MAP 110
#define initial_value -1
#define MAX_T 1001
#define pi pair<int,int>
#define chmax(a,b) (a<b ? a=b:0)
#define chmin(a,b) (a>b ? a=b:0)
#define INF (1 << 29) //536870912

const long double PI = acos(-1);
const ll DEP = 1e18;
int dx[4] = {-1,0,1,0};
int dy[4] = {0,-1,0,1};
int GCD(int x,int y){
    return y ? GCD(y,x%y) : x;
}
string s;
struct edge{int from,to,min_cost;};
vector<edge> vec;
int N,a,b,c[100001];
int dist[10001][10001];
void init(){
    for(int i = 0; i < N; i++){
        for(int j = 0; j < N; j++){
            dist[i][j] = MM;
        }
    }
}
int ans = 0;
void begin(){
    for(int i = 0; i < N; i++){
        E[i] = make_pair(0,i);
    }
}
int main(){
    cin >> N;
    pair<int,int> E[N];
    begin();
    for(int i = 0; i < N-1; i++){
        cin >> a >> b;
        a--; b--;
        dist[a][b] = 1;
        dist[b][a] = 1;
        E[a].first++; E[b].first++;
    }

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

    sort(E,E+N);
    reverse(E,E+N);
    sort(c,c+N);
    reverse(c,c+N);

    for(int i = 0; i < N; i++){
        E[i].first = c[i];
    }
    for(int i = 0; i < N; i++){
        for(int j = 0; j < N; j++){
            if(dist[i][j] == MM) continue;
            ans += min(E[i].first,E[j].second);
            dist[i][j] = MM;
            dist[j][i] = MM;
        }
    }
    cout << ans << endl;
    pair<int,int> check[N];
    for(int i = 0; i < N; i++){
        check[i] = make_pair(E[i].second,E[i].first);
    }
    sort(check,check+N);
    for(int i = 0; i < N; i++){
        cout << check[i].second << " ";
    }
    cout << endl;
}




Compiler output:
a.cc: In function 'void begin()':
a.cc:59:9: error: 'E' was not declared in this scope
   59 |         E[i] = make_pair(0,i);
      |         ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int N;
  cin >> N;
  vector<int> a(N), b(N);
  for(int i=0;i<N;i++){
    cin >> a.at(i) >> b.at(i);
  }
  

Compiler output:
a.cc: In function 'int main()':
a.cc:9:4: error: expected '}' at end of input
    9 |   }
      |    ^
a.cc:3:11: note: to match this '{'
    3 | int main(){
      |           ^
Language: Java

import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int num = sc.nextInt();
        int[] value = new int[num];
        for(int i=0; i<num; i++){
		  value[i] = sc.nextInt();
        }
        /*for(int i=0; i<value.length-1; i++) {
            for(int j=value.length-1; j>i; j--) {
                if(value[j-1] > value[j]) {
                    int tmp = value[j-1];
                    value[j-1] = value[j];
                    value[j] = tmp;
                }
             }
        }*/
        Arrays.sort(value);
        for(int i=0; i<num; i++){
		  System.out.println(value[i]);
        }
		System.out.println((a+b+c) + " " + s);
	}
}

Compiler output:
Main.java:23: error: cannot find symbol
		System.out.println((a+b+c) + " " + s);
		                    ^
  symbol:   variable a
  location: class Main
Main.java:23: error: cannot find symbol
		System.out.println((a+b+c) + " " + s);
		                      ^
  symbol:   variable b
  location: class Main
Main.java:23: error: cannot find symbol
		System.out.println((a+b+c) + " " + s);
		                        ^
  symbol:   variable c
  location: class Main
Main.java:23: error: cannot find symbol
		System.out.println((a+b+c) + " " + s);
		                                   ^
  symbol:   variable s
  location: class Main
4 errors
Language: C++

#include <iostream>
#include <vector>
#include <deque>
using namespace std;
int n;
vector<int> v,ans(100001);
vector<vector<int>> adj(100001);

int main(){
	cin >> n;
	int start=0;
	for (int i=0; i<n-1; ++i){
		int a,b;
		cin >> a >> b;
		a--;
		b--;
		adj[a].emplace_back(b);
		adj[b].emplace_back(a);
	}
	for (int i=0; i<n; ++i){
		if (adj[i].size() == 1)  start=i;
	}
	for (int i=0; i<n; ++i){
		int a;
		cin >> a;
		v.emplace_back(a);
	}
	sort(v.begin(),v.end());
	int ret=0;
	for (int i=0; i<n-1; ++i){
		ret += v[i];
	}
	reverse(v.begin(),v.end());
	cout << ret << '\n';
	vector<bool> vu(n);
	ans[start]=v[0];
	vu[start]=true;
	deque<pair<int,int>> q;
	q.emplace_back(start,0);
	while (!q.empty()){
		auto f=q.front();
		q.pop_front();
		for (auto& i:adj[f.first]){
			if (!vu[i]){
				vu[i]=true;
				f.second++;
				ans[i]=v[f.second];
				q.emplace_back(i,f.second);
			}
		}
	}
	for (int i=0; i<n; ++i){
		cout << ans[i] << ' ';
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   28 |         sort(v.begin(),v.end());
      |         ^~~~
      |         short
a.cc:33:9: error: 'reverse' was not declared in this scope
   33 |         reverse(v.begin(),v.end());
      |         ^~~~~~~
Language: C++

#include <iostream>
#include <vector>
#include <cmath>

using namespace std;
constexpr int MAX_LOG_V = 50;
template<class T> inline bool chmax(T &a, T b){ if(a < b){a = b; return true;} return false;}

struct Edge{
    int to,weight;
    Edge(int t,int w) : to(t), weight(w){}
};

using Edges = vector<Edge>;
using Graph = vector<Edges>;

class Tree{
    public:
        Tree(int size) : mGraph(size), mMemo(size) {}
        void add_edge(int s, int t, int w = 1){
            mGraph[s].emplace_back(t,w);
            mGraph[t].emplace_back(s,w);
        }

        void SetParentAndDepth(int v,int pv, int d){
            mPar[0][v] = pv; // v is pv's 2^0 parent
            mDepth[v] = d;
            for(auto nv : mGraph[v]){
                if(nv.to == pv) continue;
                SetParentAndDepth(nv.to,v,d+1);
            }
        }

        void Init(int root){
            mPar.resize(MAX_LOG_V,vector<int>(mGraph.size()));
            mDepth.resize(mGraph.size());
            SetParentAndDepth(root,-1,0);
            // calc 2^k parent of each vert
            for(int k = 0; k + 1 < MAX_LOG_V; ++k){
                for(int v = 0; v < mGraph.size(); ++v){
                    if(mPar[k][v] < 0) mPar[k+1][v] = -1; // not having parent
                    else mPar[k+1][v] = mPar[k][mPar[k][v]];
                }
            }
        }

        vector<int> GetDepth(){return mDepth;}


    private:
        Graph mGraph;
        Graph mMemo;
        
        // LCA
        vector<vector<int> > mPar;
        vector<int> mDepth;
};

int main(){
    int n,q,k,x,y;
    cin >> n;
    Tree tree(n);
    for(int i = 0; i < n-1; ++i){
        cin >> x >> y;
        --x;--y;
        tree.add_edge(x,y);
    }
    tree.Init(0);
    vector<int> c(n);
    for(int i = 0; i < n; ++i) cin >> c[i];
    sort(c.begin(),c.end(),greater<int>());

    auto depth = tree.GetDepth();
    vector<pair<int,int> > ans;
    for(int i = 0; i < depth.size();++i){
        ans.emplace_back(depth[i],i);
    }
    sort(ans.begin(),ans.end());
    int aa = 0;
    vector<pair<int,int> > aaa;
    for(int i = 0; i <ans.size();++i){
        aaa.emplace_back(ans[i].second,c[i]);
        if(i!=0) aa += c[i];
    }
    cout << aa << endl;
    sort(aaa.begin(),aaa.end());
    for(int i = 0; i < aaa.size(); ++i){
        cout << aaa[i].second << (i==aaa.size()-1 ? '\n' : ' ');
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:71:5: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
   71 |     sort(c.begin(),c.end(),greater<int>());
      |     ^~~~
      |     sqrt
Language: C++

#include<bits/stdc++.h>
using namespace std;
int n,deg[10005],c[10005],a[10005];
vector < int > adj[10005];
int main(){
	int i,j,k;
	scanf("%d",&n);
	for(i=0;i<n-1;++i){
		int u,v;
		scanf("%d%d",&u,&v);
		--u;--v;
		adj[u].push_back(v);
		adj[v].push_back(u);
		++deg[u];
		++deg[v];
	}
	for(i=0;i<n;++i) scanf("%d",c+i);
	sort(c,c+n);
	int ptr=0;
	while(1){
		bool got=0;
		vector < int > vs;
		for(i=0;i<n;++i){
			if(deg[i]==1){
				a[i]=c[ptr++];
				got=1;
				vs.push_back(i);
			}
		}
		for(i=0;i<(int)vs.size();++i){
			deg[vs[i]]=0;
			--deg[adj[vs[i]][0]];
		}
		if(!got) for(i=0;i<n;++i){
			if(!a[i]) a[i]=c[ptr++];9
		}
		if(!got) break;
	}
	int res=0;
	for(i=0;i<n;++i){
		for(j=0;j<(int)adj[i].size();++j){
			res+=min(a[i],a[adj[i][j]]);
		}
	}
	printf("%d\n",res/2);
	for(i=0;i<n;++i) printf("%d ",a[i]);
	printf("\n");
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:50: error: expected ';' before '}' token
   35 |                         if(!a[i]) a[i]=c[ptr++];9
      |                                                  ^
      |                                                  ;
   36 |                 }
      |                 ~
Language: C++

#include <bits/stdc++.h>
#include "../lib/math/comb.hpp"

using namespace std;

#include "../lib/math/modpow.hpp"

#define SZ(x) (int)(x.size())

using ll = long long;
using ld = long double;
using P = pair<int, int>;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
const ld eps = 1e-9;
const ll MOD = 1000003;
const int INF = 1000000000;
const ll LINF = 1ll<<50;

template<typename T>
void printv(const vector<T>& s) {
  for(int i=0;i<(int)(s.size());++i) {
    cout << s[i];
    if(i == (int)(s.size())-1) cout << endl;
    else cout << " ";
  }
}

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

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

  int q; cin >> q;
  Combination<MOD> comb(2000006);
  while(q) {
    q--;
    ll x, d, n; cin >> x >> d >> n;
    if(n >= MOD) {
      cout << 0 << endl;
      continue;
    }

    if(d == 0) {
      cout << mod_pow(x, n, MOD) << endl;
      continue;
    }

    ll tmp = x * comb.getinv(d) % MOD;
    //cout << tmp << endl;
    ll ans = comb.getfact(tmp+n-1) * comb.getfinv(tmp-1) % MOD;
    cout << ans * mod_pow(d, n, MOD) % MOD << endl;

  }
}


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

#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
typedef long long ll;
const ll mod=1000003;
ll pow(ll x,ll y){
  if(y==0) return 1;
  ll res=pow(x,y/2);
  res*=res;
  res%=mod;
  if(y%2==1) res*=x;
  return res%mod;
}
ll gyaku(ll x){
  return pow(x,mod-2);
}
vector<ll> frac,gfrac;
void set_frac(ll n){
  frac.push_back(1);
  gfrac.push_back(1);
  for(ll i=1;i<=n;i++){
    frac.push_back(frac[i-1]*i%mod);
    gfrac.push_back(gyaku(frac[i]));
  }
  frac[0]=0;
  gfrac[0]=0;
}
ll nCr(ll n,ll r){
  ll res=frac[n]*gfrac[r]%mod;
  res*=gfrac[n-r];
  return res%mod;
}
ll solve(ll x,ll d,ll n){
  ll ans=pow(d,n%(mod-1));
  ll X=(x*gyaku(d))%mod;
  if(X+n-1>=mod||X-1<=0) return 0;
  ans*=frac[(X+n-1)%mod];
  ans%=mod;
  ans*=gfrac[(X+mod-1)%mod];
  ans%=mod;
  return ans;
}
int main(){
  ll q;
  cin>>q;
  set_frac(mod+20);
  for(int i=0;i<q;i++){
    ll x,d,n;
    cin>>x>>d>>n;
    //if(n>mod) cout<<0<<endl;
    else cout<<solve(x,d,n)<<endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:52:5: error: 'else' without a previous 'if'
   52 |     else cout<<solve(x,d,n)<<endl;
      |     ^~~~
Language: C++

#include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<n;i++)
#define REPP(i,n) for(int i=1;i<=n;i++)
long long inf=(long long)1E17;
//#define i_7 (long long)(1E9+7)
#define i_7 (long long)(1E6+3)
long mod(long a){
    long long c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
using namespace std;

//typedef long long ll;
long long po(long a, long b){
    if(b==0){
        return 1;
    }
    
    long long z = po(a,b/2);
    z = mod(z*z);
    if(b%2!=0){
        z = mod(a*z);
    }
    return z;
}

//配列のSIZEは問題ごとに定義する必要がある。
const int SIZE=2'000'010;
long long inv[SIZE+1];//各iの逆元を格納する配列。
long long kai[SIZE+1];//i!のmodを格納する配列。
long long invkai[SIZE+1];//各i!の逆元を格納する配列。
const int MOD=i_7;
void invinit(){//上の配列を初期化する関数。
    inv[1]=1;
    for(int i=2;i<=SIZE;i++){
        inv[i] = MOD - ((MOD/i)*inv[MOD%i])%MOD;
    }
    
    kai[0]=invkai[0]=1;
    for(int i=1;i<=SIZE;i++){
        kai[i]=(kai[i-1]*i)%MOD;
        invkai[i]=(invkai[i-1]*inv[i])%MOD;
    }
}

long long comb(long long a, long long b){
    if(b<0 || a<b){
        return 0;
    }
    return mod(kai[a]*mod(invkai[b]*invkai[a-b]));
}

int main(){
  invinit();
  int q;
  cin>>q;
  long long x[q], d[q], n[q];
  long long ans[q];
  REP(i,q){
    cin>>x[i]>>d[i]>>n[i];
    if(d[i] == 0){
      ans[i] = po(x[i], n[i]);
      continue;
    }
    if(n >= 1'000'003){
      ans[i] = 0;
      continue;
    }
    long long y = mod(x[i] * inv[d[i]]);
    ans[i] = po(d[i], n[i]);
    ans[i] *= kai[y+n[i]-1];
    ans[i] = mod(ans[i]);
    ans[i] *= invkai[y-1];
    ans[i] = mod(ans[i]);
  }
  REP(i,q){
    cout<<ans[i]<<endl;
  } 
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:66:10: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   66 |     if(n >= 1'000'003){
      |        ~~^~~~~~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
 
template <class T> using V = vector<T>;
 
template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
 
const long long INF = 1LL << 60;
 
using ll = long long;
using db = long double;
using st = string;
using ch = char;
using bl = bool;
using vll = V<ll>;
using vpll =V<pair<ll,ll>>;
using vst = V<st>;
using vdb = V<db>;
using vch = V<ch>;
using vbl = V<bl>;
using graph = V<V<int>>;
using pq = priority_queue<ll>;


 
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define rFOR(i,a,b) for(ll i=(a);i>=(b);i--)
#define oFOR(i,a,b) for(ll i=(a);i<(b);i+=2)
#define bgn begin()
#define en end()
#define SORT(a) sort((a).bgn,(a).en)
#define REV(a) reverse((a).bgn,(a).en)
#define M(a,b) max(a,b)
#define rM(a,b) min(a,b)
#define fi first
#define se second
#define sz size()
#define gcd(a,b) __gcd(a,b)
#define co(a) cout<<a<<endl;
#define pb(a) push_back(a);
  
 

ll Sum(ll n) {
ll m=0;
  while(n){
    m+=n%10;
    n/=10;
  }
  return m;
}

const int MAX = 510000;
const int MOD = 1000000007;


vll div(ll n){
  vll ret;
  for(ll i=1;i*i<=n;i++){
    if(n%i==0){
      ret.push_back(i);
      if(i*i!=n){
        ret.push_back(n/i);
      }
    }
  }
  SORT(ret);
  return (ret);
}

ll modpow(ll a,ll n,ll mod){
  ll ans=1;
  while(n>0){
    if(n&1){
      ans=ans*a%mod;
    }

    a=a*a%mod;
    
    n>>=1;
  }

  return ans;
}

ll inv(ll x, ll mod){
  return modpow(x, mod-2, mod);
}
void Solve();

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


/****************************************\
| Thank you for viewing my code:)        |
| Written by RedSpica a.k.a. RanseMirage |
| Twitter:@asakaakasaka                  | 
\****************************************/
 

void Solve(){
  ll q;
    cin>>q;
  ll Mod=1000003;
  vll table(Mod);
  
  table[0]=1;
  table[1]=1;
  FOR(i,2,Mod){
    table[i]=1;
    table[i]*=table[i-1]*i;
    table[i]%=Mod;
  }

  FOR(i,0,q){
    ll ans=1;
    ll x,d,n;
      cin>>x>>d>>n;
    ll invd=inv(d,Mod); 
    
    if(n>=Mod){
      cout<<0<<endl;
    }
    
    else if(d==0){
      cout<<modpow(x,n,Mod)<<endl;
    }  
    
    else if((x*invd+n-1)%Mod<=n-1){
      cout<<0<<endl;
    }
    else{
    ans*=table[(x*invd+n-1)%Mod];
    ans*=inv(retable[(x*invd-1+Mod)%Mod], Mod);
    ans%=Mod;
    ans*=modpow(d,n,Mod);
    ans%=Mod;
    cout<<ans<<endl;
    }
  }
}


Compiler output:
a.cc: In function 'void Solve()':
a.cc:152:14: error: 'retable' was not declared in this scope; did you mean 'table'?
  152 |     ans*=inv(retable[(x*invd-1+Mod)%Mod], Mod);
      |              ^~~~~~~
      |              table
Language: C++

#include <bits/stdc++.h>
#define pb push_back
#define int long long
#define mp make_pair
#define inf 1000003
#define LINF 1000000000000000007LL
#define ll long long
using namespace std;
int ka[2145140],inv[2145140];
void setkaijo(int n){
	ka[0]=1;
	for(int i=1;i<=n;i++){
		ka[i] = ka[i-1] * i;
		ka[i] %= inf;
	}
}
int modpow(int x,int k){
	// x ^ k mod inf
	int p2[55],res=1;
	p2[0]=1;p2[1]=x%inf;
	for(int i=2;i<=50;i++){
		p2[i]=p2[i-1]*p2[i-1];
		p2[i] %= inf;
	}
	for(int i=1;i<=50;i++){
		if(k%2==1){
			res *= p2[i];
			res %= inf;
		}
		k /= 2;
	}
	return res;
}
void setinv(int n){
	for(int i=0;i<=n;i++){
		inv[i] = modpow(ka[i],(ll)inf-2);
	}
}
int comb(int n,int k){
	if( k<0 || n<0 || k>n)return 0;
	if(k==0 || k==n)return 1;
	int res = (ka[n] * inv[k]) % inf;
	res = (res*inv[n-k]) % inf;
	return res;
}

signed main(){
	int q;
	setkaijo(2145140);
	setinv(2145140);
	cin>>q;
	for(int i=0;i<q;i++){
		int x,d,n;
		cin>>x>>d>>n;
		if( d == 0 ){
			cout<<modpow(x,n)<<endl;
		}
		else{
			int st = ( x * modpow(d,(ll)inf-2) ) % inf;
			int go = (st + n - 1)%inf;
			else{
				int tmp = (ka[go]*inv[st-1])%inf;
				tmp *= modpow(d,n);
				tmp %= inf;
				cout<<tmp<<endl;
			}
		}
	}		
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:61:25: error: 'else' without a previous 'if'
   61 |                         else{
      |                         ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int Q,A;
  cin >> Q;
  vector<int> poi(2);
  for(int i=2;i<Q;i++){
    cin >>;
  }
  for(int i=0;i<3;i++){
    cin >> poi.at(i);
  }
  A=poi.at(0)*(poi.at(0)+poi.at(1))*(poi.at(0)+poi.at(2))*(poi.at(0)+poi.at(1)+poi.at(2));
  cout << A <<endl;
  cout << A%1000003 << endl;
}

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

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

int ProgMul(int x, d, n){ //初項x, 公差n, 項数nの数列の積を返す関数
	int AllMul =0;
	for( int i = 0; i < n; i++ ){
		AllMul *= (x + (n - 1) * d);
	}
	AllMul %= 1000003;
	return AllMul;
}

int main(){
	int Q;
	cin >> Q;
	vector<int> x(Q);
	vector<int> d(Q);
	vector<int> n(Q);
	
	for( int i = 0; i < Q; i++ ){
		cin >> x.at(i) >> d.at(i) >> n.at(i);
	}
	
	for( int i = 0; i < Q; i++ ){
		int ans = ProgMul(x.at(i), d.at(i), n.at(i));
		cout << ans << endl;
	}
}

Compiler output:
a.cc:4:20: error: 'd' has not been declared
    4 | int ProgMul(int x, d, n){ //初項x, 公差n, 項数nの数列の積を返す関数
      |                    ^
a.cc:4:23: error: 'n' has not been declared
    4 | int ProgMul(int x, d, n){ //初項x, 公差n, 項数nの数列の積を返す関数
      |                       ^
a.cc: In function 'int ProgMul(int, int, int)':
a.cc:6:29: error: 'n' was not declared in this scope
    6 |         for( int i = 0; i < n; i++ ){
      |                             ^
a.cc:7:42: error: 'd' was not declared in this scope
    7 |                 AllMul *= (x + (n - 1) * d);
      |                                          ^
Language: C++

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

using namespace std;

typedef long long ll;

const ll MOD = 1000003;
const ll max_n = 2000010;

ll fact_[max_n];
bool fact_init = false;

ll mod(ll a, ll b){
  a %= b;
  return a < 0 ? a + b : a;
}

ll powmod(ll a, ll b){
  if(b == 0) return 1;
  if(b & 1) {
    return a * powmod(a, b - 1) % MOD;
  } else {
    ll d = powmod(a, b / 2) % MOD;
    return d * d % MOD;
  }
}

ll sub(ll a, ll b){
  a %= MOD, b %= MOD;
  a -= b;
  return a < 0 ? a + MOD : a;
}

ll inv(ll a){
	return powmod(a, MOD - 2);
}

ll fact(ll n){
    if(!fact_init){
		fact_[0] = 1;
		fact_[1] = 1;

		for(ll i = 2; i < max_n; i++){
			fact_[i] = fact_[i-1] * i;
			fact_[i] %= MOD;
		}

		fact_init = true;
	}

    return fact_[n];
}

ll comb(ll n, ll k){

	ll ret = fact(n);
	ret *= powmod(fact(k),MOD-2);
	ret %= MOD;
	ret *= powmod(fact(n-k),MOD-2);
	ret %= MOD;
	return ret;

	// X^(-1) = X^(p-2) (mod p) (Fermat's little theorem)
}
int main()
{
	cin.tie(0);
	ios::sync_with_stdio(false);

	int Q;
    cin >> Q;

    rep(i, Q){
        ll x, d, n;
        cin >> x >> d >> n;

        if(x == 0 || n >= MOD;){
            cout << 0 << endl;
            continue;
        }

        if(d == 0){
            cout << powmod(x, n) << endl;
            continue;
        }
        
        ll y = x * inv(d) % MOD;
        ll ans = fact(y + n - 1) * inv(fact(y - 1)) % MOD * powmod(d, n) % MOD;
        cout << ans << endl;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:78:31: error: expected primary-expression before ')' token
   78 |         if(x == 0 || n >= MOD;){
      |                               ^
Language: C++

#include <bits/stdc++.h>
#define N 1000003
#define MAX 1100000
using namespace std;

long long factorial[MAX] = {0}, finverse[MAX] = {0},
          inverse[MAX] = {0};

void smodfact() {
  factorial[0] = factorial[1] = 1;
  finverse[0] = finverse[1] = 1;
  inverse[1] = 1;
  for(int i = 2; i < MAX; ++i) {
    factorial[i] = factorial[i - 1] * i % N;
    inverse[i] = N - (inverse[N % i] * (N / i)) % N;
    finverse[i] = finverse[i - 1] * inverse[i] % N;
  }
}

long long calccomb(long long n, long long k) {
  if(n == k && n == 0) return 1;
  if(n < 0 || k < 0 || n < k) return 0;
  return factorial[n] * finverse[k] % N * finverse[n - k] %
         N;
}

long long n, d, q, x;
long long memo[64] = {0};

long long solve();
long long calc(long long now);

int main() {
  smodfact();
  cin >> q;
  for(int i = 0; i < q; ++i) {
    cin >> x >> d >> n;
    cout << solve() << endl;
  }
  return 0;
}

long long solve() {
  long long ans = 0;
  if(d == 0)
    ans = calc(x);
  else{
      x *= inverse[d];
      x %= N;
    else if((x + n + N - 1) % N > (x + N - 1) % N && n < N) {
      ans = factorial[(x + n + N - 1) % N] *
        finverse[(x + N - 1) % N] % N * calc(d) % N;
    }
  }
  return ans;
}

long long calc(long long now) {
  long long ans = 1, nown = n;
  memo[0] = now;
  for(long long i = 1; i < 33; ++i)
    memo[i] = memo[i - 1] * memo[i - 1] % N;
  for(long long i = 32; i >= 0; --i)
    if((1LL << i) <= nown) {
      nown -= 1LL << i;
      ans *= memo[i];
      ans %= N;
    }
  return ans;
}


Compiler output:
a.cc: In function 'long long int solve()':
a.cc:50:5: error: 'else' without a previous 'if'
   50 |     else if((x + n + N - 1) % N > (x + N - 1) % N && n < N) {
      |     ^~~~