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

//Link : https://codeforces.com/contest/1253

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define N 200005
/*
#include <limits.h>
INT_MAX
LLONG_MAX
*/

bool vis[N];
int c[N],sz[N];
vector<int> adj[N];

int getSize(int node,int par) {
  sz[node] = 1;
  for(int ch : adj[node]) {
    if(vis[ch] || ch==par) {
      continue;
    }
    getSize(ch,node);
    sz[node] += sz[ch];
  }
  return sz[node];
}

int getCentroid(int allSz,int node,int par) {
  int maxSubSize = allSz - sz[node];
  for(int ch : adj[node]) {
    if(vis[ch] || ch==par) {
      continue;
    }
    maxSubSize = max(maxSubSize, sz[ch]);
    int ret = getCentroid(allSz,ch,node);
    if(ret!=-1) {
      return ret;
    }
  }
  if(maxSubSize*2<= allSz) {
    return node;
  } else {
    return -1;
  }
}

bool isPainted[N];
ll all[N];
void paintAll(int node,int par,int ad) {
  bool painted = false;
  if(!isPainted[c[node]]) {
    painted = true;
    isPainted[c[node]] = true;
    all[c[node]] += ad*sz[node];
  }
  for(int ch : adj[node]) {
    if(vis[ch] || ch==par) {
      continue;
    }
    paintAll(ch,node,ad);
  }
  if(painted) {
    isPainted[c[node]] = false;
  }
}


ll out[N];

void paintColor(int node,int par,ll weight) {
  bool painted = false;
  if(!isPainted[c[node]]) {
    painted = true;
    isPainted[c[node]] = true;
    out[c[node]] += (ll)(weight-all[c[node]])*sz[node];
  }
  for(int ch : adj[node]) {
    if(vis[ch] || ch==par) {
      continue;
    }
    paintColor(ch,node,weight);
  }
  if(painted) {
    isPainted[c[node]] = false;
  }
}

int csz[N];
void solveCentroid(int centroid) {
  int size = getSize(centroid,0);
  out[c[centroid]] += 1;
  int tmpSize = size-1;
  vis[centroid] = true;
  int ad = 1;
  isPainted[c[centroid]] = true;
  for(int ch : adj[centroid]) {
    if(vis[ch]) {
      continue;
    }
    int u = getSize(ch,centroid);
    csz[ch] = u;
    out[c[centroid]] += (ll)u*ad;
    ad += u;
    paintAll(ch,centroid,1);
  }
  for(int ch : adj[centroid]) {
    if(vis[ch]) {
      continue;
    }
    int u = csz[ch];
    paintAll(ch,centroid,-1);
    paintColor(ch,centroid,size - u);
  }
  isPainted[c[centroid]] = false;
  for(int ch : adj[centroid]) {
    if(vis[ch]) {
      continue;
    }
    int size = getSize(ch,centroid);

    int cent = getCentroid(size,ch,centroid);
    assert(cent!=-1);
    solveCentroid(cent);
  }
}

void solve() {
  int n;
  scanf("%d ", &n);
  for(int i=1;i<=n;++i) {
    scanf("%d ", &c[i]);
  }
  for(int i=0;i<n-1;++i) {
    int x,y;
    scanf("%d %d ", &x,&y);
    adj[x].push_back(y);
    adj[y].push_back(x);
  }
  int size = getSize(1,0);
  int cent = getCentroid(n,1,0);
  solveCentroid(cent);
  for(int i=1;i<=n;++i) {
    printf("%lld\n", out[i]);
  }
}

int main() {
    //freopen("input.txt","r",stdin);
    solve();
    return 0;
}


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

#include<iostream>
#include<vector>
#include<set>
#include<queue>
#include<map>
#include<algorithm>
#include<cstring>
#include<string>
#include<cassert>
#include<cmath>
#include<climits>
#include<iomanip>
#include<stack>
#include<unordered_map>
#include<bitset>
#include<limits>
#include<complex>
#include<array>
#include<numeric>
#include<functional>

using namespace std;
#define ll long long
#define ull unsigned long long
#define rrep(i,m,n) for(ll (i)=(ll)(m);(i)>=(ll)(n);(i)--)
#define rep(i,m,n) for(ll (i)=(ll)(m);i<(ll)(n);i++)
#define REP(i,n) rep(i,0,n)
#define FOR(i,c) for(decltype((c).begin())i=(c).begin();i!=(c).end();++i)
#define all(hoge) (hoge).begin(),(hoge).end()
typedef pair<ll, ll> P;
constexpr ll MOD = 1000000007;
constexpr ll INF = 1LL << 61;
typedef vector<ll> Array;
typedef vector<Array> Matrix;

struct Edge {//グラフ
	ll to, cap, rev;
	Edge(ll _to, ll _cap, ll _rev) {
		to = _to; cap = _cap; rev = _rev;
	}
};
typedef vector<Edge> Edges;
typedef vector<Edges> Graph;
void add_edge(Graph& G, ll from, ll to, ll cap, bool revFlag, ll revCap) {//最大フロー求める Ford-fulkerson
	G[from].push_back(Edge(to, cap, (ll)G[to].size()));
	if (revFlag)G[to].push_back(Edge(from, revCap, (ll)G[from].size() - 1));//最小カットの場合逆辺は0にする
}

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


	ll n;
	cin >> n;
	Graph g(n);
	Array c(n);
	REP(i, n)cin >> c[i], c[i]--;
	REP(i, n - 1) {
		ll a, b;
		cin >> a >> b;
		a--; b--;
		add_edge(g, a, b, 1, true, 1);
	}
	Matrix mat(n, Array(1, n));
	Array num(n, 0);

	auto dfs = [&](auto dfs,ll v, ll par)->ll {
		ll ret = 0;
		ll now = num[c[v]];
		REP(i, g[v].size()) {
			ll to = g[v][i].to;
			if (to == par)continue;
			mat[c[v]].push_back(0);
			num[c[v]] = mat[c[v]].size() - 1;
			ll tmp = dfs(dfs, to, v);
			mat[c[v]][num[c[v]]] += tmp;
			ret += tmp;

		}
		ret++;
		num[c[v]] = now;
		mat[c[v]][num[c[v]]] -= ret;
		return ret;
	};

	dfs(dfs, 0, -1);
	REP(i, n) {
		ll ans = n * (n + 1) / 2;
		REP(j, mat[i].size()) {
			ans -= mat[i][j] * (mat[i][j] + 1) / 2;
		}
		cout << ans << "\n";
	}

	return 0;
}


Compiler output:
main.c:1:9: fatal error: iostream: No such file or directory
    1 | #include<iostream>
      |         ^~~~~~~~~~
compilation terminated.
Language: C

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

#define int long long

const int N = 4e5 + 5;
typedef long long ll;

int n, first[N], c[N], cnt, top[N], f[N];
ll ans[N], siz[N], d[N];
struct Edge {
	int to, next;
} e[N<<1];

void add(int u, int v) {
	e[cnt] = (Edge) {v, first[u]};
	first[u] = cnt++;
}

void Dfs1(int u) {
	if(top[c[u]] == 0) {
		ans[c[u]] += n*(n - 1ll)/2 + 1ll;
		for(int i = first[u]; i != -1; i = e[i].next) {
			int v = e[i].to;
			if(v == f[u]) continue;
			ans[c[u]] -= siz[v]*(siz[v] - 1)/2;
		}
		ans[c[u]] -= (n - siz[u])*(n - siz[u] - 1)/2;
	}
	else {
		ans[c[u]] += (d[u] - d[top[c[u]]] - 1ll)*siz[u] + (siz[u] - 1)*siz[u]/2 + 1ll;
		for(int i = first[u]; i != -1; i = e[i].next) {
			int v = e[i].to;
			if(v == f[u]) continue;
			ans[c[u]] -= siz[v]*(siz[v] - 1ll)/2;
		}
	}
	for(int i = first[u]; i != -1; i = e[i].next) {
		int v = e[i].to;
		if(v == f[u]) continue;
		top[c[u]] = u;
		Dfs1(v);
	}
}

void Dfs(int u, int fa, int dep) {
	siz[u] = 1;
	f[u] = fa;
	d[u] = dep;
	for(int i = first[u]; i != -1; i = e[i].next) {
		int v = e[i].to;
		if(v == fa) continue;
		Dfs(v, u, d[u] + 1);
		siz[u] += siz[v];
	}
}

signed main() {
	cin>>n;
	memset(first, -1, sizeof(first));
	for(int i = 1; i <= n; i++) cin>>c[i];
	for(int i = 1; i < n; i++) {
		int u, v;
		cin>>u>>v;
		add(u, v);
		add(v, u);
	}
	Dfs(1, -1, 1);
	Dfs1(1);
	for(int i = 1; i <= n; i++)
		cout<<ans[i]<<endl;
	return 0;
}

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

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

#define int long long

const int N = 2e5 + 5;
typedef long long ll;

int n, first[N], c[N], cnt, top[N], f[N];
ll ans[N], siz[N], d[N];
struct Edge {
	int to, next;
} e[N<<1];

void add(int u, int v) {
	e[cnt] = (Edge) {v, first[u]};
	first[u] = cnt++;
}

void Dfs1(int u) {
	if(top[c[u]] == 0) {
		ans[c[u]] += n*(n - 1)/2 + 1;
		for(int i = first[u]; i != -1; i = e[i].next) {
			int v = e[i].to;
			if(v == f[u]) continue;
			ans[c[u]] -= siz[v]*(siz[v] - 1)/2;
		}
		ans[c[u]] -= (n - siz[u])*(n - siz[u] - 1)/2;
	}
	else {
		ans[c[u]] += (d[u] - d[top[c[u]]] - 1)*siz[u] + (siz[u] - 1)*siz[u]/2 + 1;
		for(int i = first[u]; i != -1; i = e[i].next) {
			int v = e[i].to;
			if(v == f[u]) continue;
			ans[c[u]] -= siz[v]*(siz[v] - 1)/2;
		}
	}
	for(int i = first[u]; i != -1; i = e[i].next) {
		int v = e[i].to;
		if(v == f[u]) continue;
		top[c[u]] = u;
		Dfs1(v);
	}
}

void Dfs(int u, int fa, int dep) {
	siz[u] = 1;
	f[u] = fa;
	d[u] = dep;
	for(int i = first[u]; i != -1; i = e[i].next) {
		int v = e[i].to;
		if(v == fa) continue;
		Dfs(v, u, d[u] + 1);
		siz[u] += siz[v];
	}
}

signed main() {
	cin>>n;
	memset(first, -1, sizeof(first));
	for(int i = 1; i <= n; i++) cin>>c[i];
	for(int i = 1; i < n; i++) {
		int u, v;
		cin>>u>>v;
		add(u, v);
		add(v, u);
	}
	Dfs(1, -1, 1);
	Dfs1(1);
	for(int i = 1; i <= n; i++)
		cout<<ans[i]<<endl;
	return 0;
}

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

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

const int N = 2e5 + 5;
typedef long long ll;

int n, first[N], c[N], cnt, top[N], d[N], f[N];
ll ans[N], siz[N];
struct Edge {
	int to, next;
} e[N<<1];

void add(int u, int v) {
	e[cnt] = (Edge) {v, first[u]};
	first[u] = cnt++;
}

void Dfs1(int u) {
	if(top[c[u]] == 0) {
		ans[c[u]] += n*(n - 1)/2 + 1;
		for(int i = first[u]; i != -1; i = e[i].next) {
			int v = e[i].to;
			if(v == f[u]) continue;
			ans[c[u]] -= siz[v]*(siz[v] - 1)/2;
		}
		ans[c[u]] -= (n - siz[u])*(n - siz[u] - 1)/2;
	}
	else ans[c[u]] += (d[u] - d[top[c[u]]])*siz[u];
	for(int i = first[u]; i != -1; i = e[i].next) {
		int v = e[i].to;
		if(v == f[u]) continue;
		top[c[u]] = u;
		Dfs1(v);
	}
}

void Dfs(int u, int fa, int dep) {
	siz[u] = 1;
	f[u] = fa;
	d[u] = dep;
	for(int i = first[u]; i != -1; i = e[i].next) {
		int v = e[i].to;
		if(v == fa) continue;
		Dfs(v, u, d[u] + 1);
		siz[u] += siz[v];
	}
}

int main() {
	cin>>n;
	memset(first, -1, sizeof(first));
	for(int i = 1; i <= n; i++) cin>>c[i];
	for(int i = 1; i < n; i++) {
		int u, v;
		cin>>u>>v;
		add(u, v);
		add(v, u);
	}
	Dfs(1, -1, 1);
	Dfs1(1);
	for(int i = 1; i <= n; i++)
		cout<<ans[i]<<endl;
	return 0;
}

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

#include<bits/stdc++.h>
using namespace std;
using UL = unsigned long;
using ULL = unsigned long long;
using LL = long long;
#define rep(i, n) for(UL i = 0; i < (n); i++)

struct Problem {
    UL N;
    vector<UL> C;
    vector<vector<UL>> E;

    vector<ULL> ans;
    vector<UL> F;

    void Concat(map<UL, UL>& d, const map<UL, UL>& s) {
        for (auto i : s) d[i.first] += i.second;
    }

    pair<UL, map<UL, UL>> DFS(UL p) {
        F[p] = 1;
        map<UL, UL> tmp;
        UL Vcount = 0;
        for (UL e : E[p]) {
            if (F[e]) continue;
            auto buf = DFS(e);
            ULL backN = buf.first - buf.second[C[p]];
            ULL forwdN = Vcount - tmp[C[p]];
            ans[C[p]] += backN * forwdN;
            ans[C[p]] -= (ULL)tmp[C[p]] * buf.second[C[p]];
            Concat(tmp, buf.second);
            Vcount += buf.first;
        }
        Vcount++;
        ULL backN = N - Vcount + 1;
        ULL forwdN = Vcount - tmp[C[p]];
        ans[C[p]] += backN * forwdN;
        tmp[C[p]] = Vcount;
        return { Vcount, move(tmp) };
    }

    void Solve() {
        cin >> N;
        C.resize(N); rep(i, N) { cin >> C[i] C[i]--; }
        E.resize(N);
        rep(i, N - 1) {
            UL U, V; cin >> U >> V; U--; V--;
            E[U].push_back(V);
            E[V].push_back(U);
        }
        ans.resize(N);
        F.resize(N);
        DFS(0);
        rep(i, N) cout << ans[i] << endl;
    }
};
int main() {
    unique_ptr<Problem> p(new Problem());
    p->Solve();
    return 0;
}


Compiler output:
a.cc: In member function 'void Problem::Solve()':
a.cc:44:46: error: expected ';' before 'C'
   44 |         C.resize(N); rep(i, N) { cin >> C[i] C[i]--; }
      |                                              ^
Language: C

#include <bits/stdc++.h>
using namespace std;
 
 
void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}
 
template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif
 
#define rep(i, n)    for(int i = 0; i < (n); ++i)
#define repA(i, a, n)  for(int i = a; i <= (n); ++i)
#define repD(i, a, n)  for(int i = a; i >= (n); --i)
#define trav(a, x) for(auto& a : x)
#define all(x) x.begin(), x.end()
#define sz(x) (int)(x).size()
#define fill(a)  memset(a, 0, sizeof (a))
#define fst first
#define snd second
#define mp make_pair
#define pb push_back
typedef long double ld;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;

void pre(){


}
 
void solve(){
 
 
}

vector<ll> c,g[200009],s,s2,dp;
map<ll,ll> dfs(int u, int p){
    map<ll, ll> m;
    vector<ll> w;
    s[u]=1;
    trav(v,g[u])if(v!=p){
        map<ll, ll> m2=dfs(v,u);
        s[u]+=s[v];
        if(m2.find(c[u])!=m2.end()) w.pb(s[v]-m2[c[u]]);
        else w.pb(s[v]);
        if(sz(m2)>sz(m))swap(m2,m);
        trav(it,m2)m[it.fst]+=it.snd;
    }
    //debug(u, p);
    //trav(it,m)cout<<"("<<it.fst<<", "<<it.snd<<"), ";
    //cout<<endl;
    //debug(w);
    ll su=0;
    rep(i,sz(w))su+=w[i];
    rep(i,sz(w))su-=w[i],dp[c[u]]+=su*1ll*w[i];
    s2[u]=s[u]-m[c[u]];
    m[c[u]]=s[u];
    return m;
}
int main() {
	cin.sync_with_stdio(0); cin.tie(0);
	cin.exceptions(cin.failbit);
	pre();

    int n;cin>>n;
    c.resize(n,0);
    s.resize(n,0);
    s2.resize(n,0);
    dp.resize(n,0);
    rep(i,n)cin>>c[i],c[i]--;
    rep(i,n-1){
        int u,v;cin>>u>>v;
        u--,v--;
        g[u].pb(v),g[v].pb(u);
    }
    rep(i,n)if(sz(g[i])<=1){dfs(i,-1);break;}
    rep(i,n)dp[c[i]] += s2[i]*1ll*(n-s[i]+1);
    rep(i,n)cout<<dp[i]<<'\n';

	return 0;
}
 



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

#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define all(x) (x).begin(),(x).end()
#define ln '\n'
constexpr long long MOD = 1000000007LL;
//constexpr long long MOD = 998244353LL;
typedef long long ll;
typedef unsigned long long ull; 
typedef pair<int, int> pii;
typedef pair<long long, long long> pll;
template<class T, class U> inline bool chmax(T &a, U b) { if (a < b) { a = b; return true;} return false; }
template<class T, class U> inline bool chmin(T &a, U b) { if (a > b) { a = b; return true;} return false; }
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

vector<int> G[201010];
int c[201010];
ll ans[201010];
ll sub[201010];
map<int, vector<int>> dic[201010];
void dfs(int v, int pv) {
    for (auto nv : G[v]) {
        if (nv==pv) continue;
        dfs(nv,v);
        sub[v] += sub[nv];
        if (!dic[nv].count(c[v])) ans[c[v]] += (sub[nv])*(sub[nv]+1)/2;
        else {
            for (auto j : dic[nv][c[v]]) {
                ans[c[v]] += (sub[nv]-sub[j])*(sub[nv]-sub[j]+1)/2;
            }
        }
        if (dic[v].size() < dic[nv].size()) {
            swap(dic[v],dic[nv]);
        }
        for (auto A : dic[nv]) {
            for (auto j : A.second) {
                dic[v][A.first].emplace_back(j);
            }
        }
    }
    dic[v][c[v]].clear();
    dic[v][c[v]].emplace_back(v);
    sub[v]++;
    return;
}
int main() {
    ios::sync_with_stdio(false); cin.tie(nullptr);
    ll N; cin >> N;
    set<int> zzz;
    rep(i,N) {
        cin >> c[i];
        --c[i];
        zzz.emplace(c[i]);
    }
    rep(i,N-1) {
        int u,v; cin >> u >>  v;
        --u; --v;
        G[u].emplace_back(v);
        G[v].emplace_back(u);
    }
    dfs(0,-1);
    //rep(i,N) cout << ans[i] << ln;
    for (auto i : dic[0]) {
        ll val = 0;
        for (auto j : i.second) {
            val += sub[j];
        }
        ans[i.first] += (sub[0]-val)*(sub[0]-val+1)/2;
    }
    rep(i,N) {
        if (!zzz.count(i)) cout << 0 << ln;
        else cout << (N+1)*N/2 - ans[i] << ln;
    }
}




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

#include <bits/stdc++.h>
using namespace std;
#define all(V) V.begin(),V.end()
#define ll long long
#define MOD 1000000007

vector<ll> G[200010];
stack<ll> col[200010];
ll C[200010];
ll ans[200010];

ll seg[524288];
ll app[200010];

void raq(ll s = 0, ll t = 262143, ll v = 1, ll k = 1, ll l = 0, ll r = 262143) {
	if (t < l || r < s)return;
	if (s <= l && r <= t) {
		seg[k] += v;
		return;
	}
	raq(s, t, v, k * 2, l, (l + r) / 2);
	raq(s, t, v, k * 2 + 1, (l + r) / 2 + 1, r);
}

ll gets(ll x) {
	x += 262144;
	ll ans = 0;
	while (x) {
		ans += seg[x];
		x /= 2;
	}
	return ans;
}

void pini(ll x, ll v) {
	raq(x, x, v - gets(x));
}

ll alc = 0;

void euler(ll c, ll p) {

	for (ll i : G[c]) {
		if (i == p)continue;
		col[C[c]].top() = gets(C[c]);
		col[C[c]].push(0);
		pini(C[c], 0);
		raq();
		raq(C[i], C[i], -1);
		euler(i, c);
	}

	if (p == 0)return;
	ll gc = gets(C[p]);
	ans[C[p]] += gc * (gc - 1LL) / 2LL;
	col[C[p]].pop();
	pini(C[p], col[C[p]].top());
	return;
}

ll main() {
	for (ll i = 0;i < 200010;i++)ans[i] = app[i] = C[i] = 0;
	for (ll i = 0;i < 524288;i++)seg[i] = 0;
	ll N, a, b;
	cin >> N;
	for (ll i = 1;i <= N;i++) {
		cin >> C[i];
		app[C[i]]++;
	}
	for (ll i = 1;i < N;i++) {
		cin >> a >> b;
		G[a].push_back(b);
		G[b].push_back(a);
	}
	ll st = 0;
	for (ll i = 1;i <= N;i++) {
		if (G[i].size() == 1)st = i;
	}
	for (ll i = 1;i <= N;i++) {
		if (i == C[st])col[i].push(0);
		col[i].push(1);
	}
	raq();
	pini(st, 0);
	euler(st, 0);
	for (ll i = 1;i <= N;i++) {
		ll gc = gets(i);
		ans[i] += gc * (gc - 1LL) / 2LL;
	}
	for (ll i = 1;i <= N;i++) {
		if (app[i] == 0)cout << 0 << endl;
		else
			cout << N * (N - 1LL) / 2LL - ans[i] + app[i] << endl;
	}
}

Compiler output:
cc1plus: error: '::main' must return 'int'
Language: C

#include<bits/stdc++.h> 
using namespace std;
typedef long long ll;
template<typename T1,typename T2> bool chmin(T1 &a,T2 b){if(a<=b)return 0; a=b; return 1;}
template<typename T1,typename T2> bool chmax(T1 &a,T2 b){if(a>=b)return 0; a=b; return 1;}

vector<vector<int>> v(200020);
ll n,c[200020];
vector<vector<ll>> cnt(200020);
ll sum[200020];
ll rem[200020];

int dfs(int p, int pre){
    int ret = 1;
    for(auto i:v[p]){
        if(i != pre){
            int t = dfs(i,p);
            cnt[p].push_back(t);
            ret += t;
        }
    }
    rem[p] = n - ret;
    return ret;
}

ll ans[200020];
ll used[200020];

void f(int p, int pre){
    // ans[c[p]] += rem[p] - used[c[p]];
    ll ret = 0;
    for(auto i:cnt[p]) ret += i;
    ans[c[p]] += ret * (rem[p] - used[c[p]]);
    ans[c[p]] += rem[p]+1 -used[c[p]] + ret;
    for(auto i:cnt[p]){
        ret -= i;
        ans[c[p]] += i*ret;
    }
    // used[c[p]] += rem[p] - used[c[p]] + 1;
    //cerr << "db " << p << " " << c[p] << " " << ans[c[p]] << endl;
    int k = 0;
    for(auto i:v[p]){
        if(i != pre){
            used[c[p]] = n - cnt[p][k];
            // sum[c[p]] = rem[c[p]] - used[c[p]];
            f(i,p);
            k++;
        }
    }

}


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

    cin>>n;
    for(int i=0;i<n;i++){
        cin>>c[i];
        c[i]--;
    }
    for(int i=1;i<n;i++){
        int a,b;
        cin>>a>>b;
        a--,b--;
        v[a].push_back(b);
        v[b].push_back(a);
    }
    for(int i=0;i<n;i++){
        sum[i]=n;
    }
    dfs(0,-1);
    f(0,-1);
    for(int i=0;i<n;i++){
        cout << ans[i] << "\n";
    }
}

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

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

using namespace std;
//using namespace __gnu_pbds;

#define LL       long long
#define PR       pair<LL, LL>
#define READ(f)  freopen(f, "r", stdin)
#define WRITE(f) freopen(f, "w", stdout)

const int N = 3e5 + 5;
const int MOD = 1e9 + 7;
const double PI = 2 * acos(0.0);
//template<typename T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

int color[N], lev[N], sub[N];
vector<int> go[N], g[N];

void dfs(int u, int p, int h) {
    lev[u] = h;
    int tmp = 1;
    for (auto v : g[u]) if (v != p) {
        dfs(v, u, h + 1);
        tmp += sub[v];
    }
    sub[u] = tmp;
}

bool cmp(int x, int y) {
    return lev[x] < lev[y];
}

int main() {
//    ios::sync_with_stdio(false);
//    cin.tie(0);
    int n;
    cin >> n;
    for (int i = 1; i <= n; i++) {
        cin >> color[i];
        go[color[i]].push_back(i);
    }
    for (int i = 1; i < n; i++) {
        int u, v;
        cin >> u >> v;
        g[u].push_back(v);
        g[v].push_back(u);
    }
    int start = 1;
    for (int i = 1; i <= n; i++) {
        if (g[i].size() == 1) {
            start = i;
            break;
        }
    }
    dfs(start, 0, 1);
    for (int i = 1; i <= n; i++) {
        sort(go[i].begin(), go[i].end(), cmp);
    }
    for (int i = 1; i <= n; i++) {
        LL cnt = 0, ans = 0;
//        cout << "COLOR: " << i << endl;
        for (auto j : go[i]) {
            LL up = n - sub[j] + 1 - cnt;
            LL down = sub[j];
            LL tmp = up * down;
            ans += tmp;
//            cout << "UP: " << up << "  DOWN: " << down << "  NODE: " << j << endl;
            cnt += up;
        }
        cout << ans << '\n';
    }
    return 0;
}


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

#include <iostream>
#include <vector>
using namespace std;
using Graph = vector<vector<int>>;

vector<int> depth;
vector<int> subtree_size;
int count;
vector<int> num;

void dfs(const Graph &G, int v, int p, int d) {
    depth[v] = d;
    for (auto nv : G[v]) {
        if (nv == p) continue; // nv が親 p だったらダメ
        dfs(G, nv, v, d+1);
    }

    // 帰りがけ時に、部分木サイズを求める
    subtree_size[v] = 1; // 自分自身
    for (auto c : G[v]) {
        if (c == p) continue;
        subtree_size[v] += subtree_size[c]; // 子のサイズを加える
    }
  
  	if (d == 1){
      	num[count] = subtree_size[v];
      	count++;
    }
}

int main() {
  	long long int N;
  	cin >> N;
  	long long int c[N];
  
  	for (int i = 0; i < N; i++) cin >> c[i];
  	Graph G(N);
  	for (int i = 0; i < N-1; ++i) {
        int a, b;
        cin >> a >> b;
        G[a].push_back(b);
        G[b].push_back(a);
    }
  
  	int color[N];
  	for (int i = 0; i < N; i++) color[i] = 0;
  	vector<int> col[N];
  	for (int i = 0; i < N; i++) {
      	col[c[i]][color[c[i]]] = i;
      	color[c[i]]++;
    }
  
  	int res = 0;
  	
  	for (int i = 0; i < N; i++){
      	res = 0;
      	for (int j = 0; j < color[i]){
  			int root = col[i][j];
      		count = 0;
    		depth.assign(N, 0);
    		subtree_size.assign(N, 0);
          	num.assign(N, 0);
    		dfs(G, root, -1, 0);
      		int res = 0;
      		for (int p = 0; p < count - 1; p++){
          		for (int q = p + 1; q < count; q++){
              		res += num[p] * num[q];
            	}
              	res += num[p];
        	}
          	res++;
        }
      	cout << res << endl;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:57:37: error: expected ';' before ')' token
   57 |         for (int j = 0; j < color[i]){
      |                                     ^
      |                                     ;
Language: C++

#include <iostream>
#include <vector>
using namespace std;
using Graph = vector<vector<int>>;

vector<int> depth;
vector<int> subtree_size;
int count;
vector<int> num;

void dfs(const Graph &G, int v, int p, int d) {
    depth[v] = d;
    for (auto nv : G[v]) {
        if (nv == p) continue; // nv が親 p だったらダメ
        dfs(G, nv, v, d+1);
    }

    // 帰りがけ時に、部分木サイズを求める
    subtree_size[v] = 1; // 自分自身
    for (auto c : G[v]) {
        if (c == p) continue;
        subtree_size[v] += subtree_size[c]; // 子のサイズを加える
    }
  
  	if (d == 1){
      	num[count] = subtree_size[v];
      	count++;
    }
}

int main() {
  	long long int N;
  	cin >> N;
  	long long int c[N];
  
  	for (int i = 0; i < N; i++) cin >> c[i];
  	for (int i = 0; i < N-1; ++i) {
        int a, b;
        cin >> a >> b;
        G[a].push_back(b);
        G[b].push_back(a);
    }
  
  	int color[N];
  	for (int i = 0; i < N; i++) color[i] = 0;
  	vector<int> col[N];
  	for (int i = 0; i < N; i++) {
      	col[c[i]][color[c[i]]] = i;
      	color[c[i]]++;
    }
  
  	int res = 0;
  	
  	for (int i = 0; i < N; i++){
      	res = 0;
      	for (int j = 0; j < color[i]){
  			int root = col[i][j];
      		count = 0;
    		depth.assign(N, 0);
    		subtree_size.assign(N, 0);
          	num.assign(N, 0);
    		dfs(G, root, -1, 0);
      		int res = 0;
      		for (int i = 0; i < count - 1; i++){
          		for (int j = i + 1; j < count; j++){
              		res += num[i] * num[j];
            	}
              	res += num[i];
        	}
          	res++;
        }
      	cout << res << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:40:9: error: 'G' was not declared in this scope
   40 |         G[a].push_back(b);
      |         ^
a.cc:56:37: error: expected ';' before ')' token
   56 |         for (int j = 0; j < color[i]){
      |                                     ^
      |                                     ;
a.cc:62:21: error: 'G' was not declared in this scope
   62 |                 dfs(G, root, -1, 0);
      |                     ^
Language: C++

#include<iostream>
#include<stdio.h>
using namespace std;
using ll=long long;
#include<algorithm>
#include<set>
#include<vector>
#define rep(i,n) for(int i=0;i<(n);i++)
using P=pair<int,int>;
#include<cmath>


int main(){
  int k;
  cin>>k;
  int ans=0;
rep(i,k)rep(j,k)rep(n,k){
  int g=gcd(j,n);
  ans+=gcd(i,g);
}
cout<<ans<<endl;
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:9: error: 'gcd' was not declared in this scope
   18 |   int g=gcd(j,n);
      |         ^~~
Language: C++

#include<iostream>
using namespace std;
int main()
{
  char n[3];
  cin>>n[3];
  if(n[0]=='7'||n[1]=='7'||n[2]=='7')
  {
    cout<<"Yes"<<endl;
    else
      cout<<"No"<<endl;
  }
  return 0;
}
  


Compiler output:
a.cc: In function 'int main()':
a.cc:10:5: error: expected '}' before 'else'
   10 |     else
      |     ^~~~
a.cc:8:3: note: to match this '{'
    8 |   {
      |   ^
a.cc: At global scope:
a.cc:13:3: error: expected unqualified-id before 'return'
   13 |   return 0;
      |   ^~~~~~
a.cc:14:1: error: expected declaration before '}' token
   14 | }
      | ^
Language: C++

#include<iostream>
using namespace std;
int main()
{
  char n[4];
  cin>>n[4];
  if(n[0]=='7'||n[1]=='7'||n[2]=='7')
  {
    cout<<"Yes"<<endl;
    else
      cout<<"No"<<endl;
  }
  return 0;
}
  


Compiler output:
a.cc: In function 'int main()':
a.cc:10:5: error: expected '}' before 'else'
   10 |     else
      |     ^~~~
a.cc:8:3: note: to match this '{'
    8 |   {
      |   ^
a.cc: At global scope:
a.cc:13:3: error: expected unqualified-id before 'return'
   13 |   return 0;
      |   ^~~~~~
a.cc:14:1: error: expected declaration before '}' token
   14 | }
      | ^
Language: C++

#include<iostream>
using namespace std;
int main()
{
  char n[4];
  cin>>n[4];
  for(n[0]=='7'||n[1]=='7'||n[2]=='7')
  {
    cout<<"Yes"<endl;
    else
      cout<<"No"<<endl;
  }
  return 0;
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:7:38: error: expected ';' before ')' token
    7 |   for(n[0]=='7'||n[1]=='7'||n[2]=='7')
      |                                      ^
      |                                      ;
a.cc:13:3: error: expected primary-expression before 'return'
   13 |   return 0;
      |   ^~~~~~
a.cc:12:4: error: expected ';' before 'return'
   12 |   }
      |    ^
      |    ;
   13 |   return 0;
      |   ~~~~~~
a.cc:13:3: error: expected primary-expression before 'return'
   13 |   return 0;
      |   ^~~~~~
a.cc:12:4: error: expected ')' before 'return'
   12 |   }
      |    ^
      |    )
   13 |   return 0;
      |   ~~~~~~
a.cc:7:6: note: to match this '('
    7 |   for(n[0]=='7'||n[1]=='7'||n[2]=='7')
      |      ^
Language: Java

import java.util.Scanner;

public class Main2 {
	public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        Main m = new Main(sc);
        m.show(m.solve());
        sc.close();
    }
    
	//フィールド
    Scanner sc;
    String N;
    
    //入力
    Main(Scanner sc) {
        this.sc = sc;
        this.N = sc.next();
    }
    
    //解答処理
    private String solve() {
        String answer = "No";
        String[] list = N.split("");
        
        for (int i=0; i<N.length(); i++) {
        	if (list[i].equals("7")) {
        		answer = "Yes";
        		break;
        	}
        }
        
        return answer;
    }
    
    //出力
    public void show(String answer) {
        System.out.println(answer);
    }

}


Compiler output:
Main.java:16: error: invalid method declaration; return type required
    Main(Scanner sc) {
    ^
1 error
Language: C++

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

int main(){
	string n;
  	cin >> n;
  	if(n.at(0) == '7' || n.at(1) == '7' || n.at(2) == '7') cout << "Yes" << endl;
  	else cout << "No" endl;
 }

Compiler output:
a.cc: In function 'int main()':
a.cc:8:26: error: expected ';' before 'endl'
    8 |         else cout << "No" endl;
      |                          ^~~~~
      |                          ;
Language: C++

#include <iostream>
#include <cstring>
using namespace std;
int main(){
  int N;
  cin >> N;
  string s = to_string(N);
  bool isSeven = false;
  for (auto x: s) {
  if (x == '7'){
    isSeven = true;
  break;
}
  if (isSeven) cout << "Yes";
  else cout << "No";
}

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

#include <iostream>
#include <cstring>
using namespace std;
int main(){
  int N;
  cin >> N;
  string s = to_string(N);
  bool isSeven = false;
  for (auto x: s) {
  if x == '7':
    isSeven = true;
  break;
}
  if (isSeven) cout << "Yes";
  else cout << "No";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:6: error: expected '(' before 'x'
   10 |   if x == '7':
      |      ^
      |      (
Language: C

#include<stdio.h>

int main(void){
  int N;
  scanf("%d",&N);
  int a,b,c;
  a=N%10;
  N/=10;
  b=N%10;
  N/=10;
  c=N%10;
  if(a==7 || b=7 || c==7){
    printf("Yes\n");
  }else{
    printf("No\n");
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:12:15: error: lvalue required as left operand of assignment
   12 |   if(a==7 || b=7 || c==7){
      |               ^
Language: C++

#include <bits/stdc++.h>
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <math.h>
#define fi first
#define se second
#define rep(i,n) for(ll i=0;i<(n);i++)
#define rrep(i,n) for(ll i = 1; i <= (n); ++i)
#define drep(i,n) for(ll i = (n)-1; i >= 0; --i)
#define all(v) v.begin(),v.end()
#define len(x) (ll)(x).length()
#define maxs(x,y) x = max(x,y)
#define mins(x,y) x = min(x,y)
#define pb push_back
#define sz(x) (ll)(x).size()
#define v(T) vector<T>
#define vv(T) vector<vector<T>>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
ll gcd(ll a,ll b){if(a%b==0){return b;}else{return(gcd(b,a%b));}}
ll lcm(ll a,ll b){return a*b/gcd(a,b);}
const int INF=1e9;
const ll MX = 1e18;
const int MOD=INF+7;
const int di[] = {-1,0,1,0};
const int dj[] = {0,-1,0,1};
const double PI=acos(-1);
 
int main() {
  string n;
  cin>>n;
  rep(i,3){
    if(n[i]=='7'){
      cout<<"Yes"<<endl;
      return 0
    }
  }
  cout<<"No"<<endl;
}

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

#include <bits/stdc++.h>
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <math.h>
#define fi first
#define se second
#define rep(i,n) for(ll i=0;i<(n);i++)
#define rrep(i,n) for(ll i = 1; i <= (n); ++i)
#define drep(i,n) for(ll i = (n)-1; i >= 0; --i)
#define all(v) v.begin(),v.end()
#define len(x) (ll)(x).length()
#define maxs(x,y) x = max(x,y)
#define mins(x,y) x = min(x,y)
#define pb push_back
#define sz(x) (ll)(x).size()
#define v(T) vector<T>
#define vv(T) vector<vector<T>>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
ll gcd(ll a,ll b){if(a%b==0){return b;}else{return(gcd(b,a%b));}}
ll lcm(ll a,ll b){return a*b/gcd(a,b);}
const int INF=1e9;
const ll MX = 1e18;
const int MOD=INF+7;
const int di[] = {-1,0,1,0};
const int dj[] = {0,-1,0,1};
const double PI=acos(-1);
 
int main() {
  string n;
  cin>>n;
  rep(i,3){
    if(s[i]=='7'){
      cout<<"Yes"<<endl;
      return 0
    }
  }
  cout<<"No"<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:39:8: error: 's' was not declared in this scope
   39 |     if(s[i]=='7'){
      |        ^
a.cc:41:15: error: expected ';' before '}' token
   41 |       return 0
      |               ^
      |               ;
   42 |     }
      |     ~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int a;
  cin >>a;
  if(a%10==7||a/100==7||(a-a/100-a%10)/10==7){
    cout <<"Yes" << enl;
  }
  else
    cout <<"No" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:21: error: 'enl' was not declared in this scope; did you mean 'ynl'?
    7 |     cout <<"Yes" << enl;
      |                     ^~~
      |                     ynl
Language: C++

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

int main(){

  int a;
  cin >>a;
  string s;
  s=to_string(a);
  if(s.count(srting.begin(),string.end(),'7')){
    cout << "Yes" <<endl;
  }
  else 
    cout <<"No" <<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:8: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'count'
   10 |   if(s.count(srting.begin(),string.end(),'7')){
      |        ^~~~~
a.cc:10:14: error: 'srting' was not declared in this scope
   10 |   if(s.count(srting.begin(),string.end(),'7')){
      |              ^~~~~~
a.cc:10:35: error: expected primary-expression before '.' token
   10 |   if(s.count(srting.begin(),string.end(),'7')){
      |                                   ^
Language: C++

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

int main(){

  int a;
  cin >>a;
  string s;
  s=to_string(a);
  if(s.count('7')){
    cout << "Yes" <<endl;
  }
  else 
    cout <<"No" <<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:8: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'count'
   10 |   if(s.count('7')){
      |        ^~~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;
using ll = long long;
using vl = vector<ll>;
using pll = pair<ll, ll>;

#define rep(i, n) for (ll i = 0, xxx_rep_end = (n); i < xxx_rep_end; ++i)
#define all(x) (x).begin(), (x).end()

template <class T1, class T2>
inline bool chmax(T1 &a, const T2 &b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
template <class T1, class T2>
inline bool chmin(T1 &a, const T2 &b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}

constexpr ll INF = 0x3f3f3f3f3f3f3f3fLL;
constexpr ll mod = 1000000007;

int main() {
    ll S;
    cim >> S;
    for (int i = 0; i < 3; ++i) {
        if (S % 10 == 7) {
            cout << "Yes" << endl;
            return 0;
        }
        S /= 10;
    }
    cout << "No" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:5: error: 'cim' was not declared in this scope
   33 |     cim >> S;
      |     ^~~
Language: C

#include<bits/stdc++.h>
using namespace std;
int main()
{
    string s;
    cin>>s;
    int fl=1;
    for(char c: s){
        if(c=='7'){
            cout<<"YES"<<endl;
            fl=0;
            break;
        }
    }
    if(fl)cout<<"NO"<<endl;
}


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

//HOW YOU DOI'N........................JT
//Could this code be more bad..........CB
//I know...............................MG
//Hii..................................RG
//Noooooooo............................RG
//I wish I could but I don't want to...PB

//That's what she said.................MS


#include <bits/stdc++.h>

#define fast                          \
    ios_base::sync_with_stdio(false); \
    cin.tie(0);                       \
    cout.tie(0);

#define ll long long
#define ld long double
#define pb push_back
#define mkpr make_pair
#define fi(i,a,b) for (ll i=a;i<b;i++)
#define vll vector<ll>
#define vch vector<char>
#define vst vector<string>
#define vpll vector<pll>
#define vvl vector<vector<ll>>
#define rev(v) reverse(v.begin(),v.end())
#define srt(v) sort(v.begin(),v.end())
#define rsrt(v) sort(v.rbegin(), v.rend())
#define mxe(v) *max_element(v.begin(),v.end())
#define pii pair<int, int>
#define pll pair<ll, ll>
#define ff first
#define ss second
#define mll map<ll, ll>
#define gcd(a, b) __gcd(a, b)
#define lcm(a, b) ((a)*1ll * (b)) / gcd(a, b)
#define nl "\n"
#define sp " "
#define sz(x)  (int)x.size()

using namespace std;

double PI = (acos(-1));
ll md = 1000000007;
//ll md = 998244353;

ll pw(ll a, ll b){ll c=1,m=a;while (b){if (b&1)c=(c*m);m=(m*m);b/=2;}return c;}
ll pwmd(ll a, ll b){ll c = 1, m = a;while (b){if (b & 1)c = ((c * m)) % md;m = (m * m) % md;b /= 2;}return c;}
ll modinv(ll n){return pwmd(n, md - 2);}
ll min(ll a,ll b){if(a>=b)return b;return a;}
ll nc2(ll n){return (1ll * n * (n - 1)) / 2;}
ll nsum(ll n){return (1ll * n * (n + 1)) / 2;}
bool prime(ll a){for(int i=2;i*i<=a;i++){if(a%i==0)return false;}return true;}

#define MAX_SIZE 1005
void Sieve(vector<int> &primes){bool IsPrime[MAX_SIZE];memset(IsPrime, true, sizeof(IsPrime));
for (int p = 2; p * p < MAX_SIZE; p++){if (IsPrime[p] == true){
			for (int i = p * p; i < MAX_SIZE; i += p)IsPrime[i] = false;}}
	for (int p = 2; p < MAX_SIZE; p++)if (IsPrime[p])primes.push_back(p);}


vector<char> sml={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
vector<char> cap={'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'};



// Lets start ...

void solve(){
    string n;
    cin>>n;
    fi(i,0,sz(s)){
        if(s[i]=='7'){
            cout<<"Yes";
            return;
        }
    }
    cout<<"No";

}



int main(){
    //vector<int> primes;
    //Sieve(primes);

    fast
    ll tests=1;
    //cin>>tests;
    while(tests--){
        solve();
    }

    return 0;
    }

// Done:)









Compiler output:
a.cc: In function 'void solve()':
a.cc:74:15: error: 's' was not declared in this scope
   74 |     fi(i,0,sz(s)){
      |               ^
a.cc:22:33: note: in definition of macro 'fi'
   22 | #define fi(i,a,b) for (ll i=a;i<b;i++)
      |                                 ^
a.cc:74:12: note: in expansion of macro 'sz'
   74 |     fi(i,0,sz(s)){
      |            ^~
Language: C++

#include <iostream>
using namespace std;

int main()
{
	int a = 0, n;
	for (int i = 1; i < 4; i++)
		if (n[i] == 7)
			a++;
	if (a > 0)
		cout << "Yes";
	else
		cout << "No";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:22: error: invalid types 'int[int]' for array subscript
    8 |                 if (n[i] == 7)
      |                      ^
Language: C++

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

int main(){
  int N;cin>>N;
  bool ans=false;
  while(N>0){
    int X=N%10;
    if(X==7){
      ans=true;
      break;
    }
    N/=10;
  }
  if(can) cout<<"Yes"<<endl;
  else cout<<"No"<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:6: error: 'can' was not declared in this scope; did you mean 'tan'?
   15 |   if(can) cout<<"Yes"<<endl;
      |      ^~~
      |      tan
Language: C

#include<stdio.h>
int main()
{
    int n,i,in,a=0,p=0,u;
    scanf("%d",&n);
    for(i=1;i<=n;i++)
    {
        scanf("%d",&in);
        p+=in;
        if(in>a)
        a=in;
    }
    u=t-a+(a/2);
    printf("%d\n",u);
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:13:7: error: 't' undeclared (first use in this function)
   13 |     u=t-a+(a/2);
      |       ^
main.c:13:7: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
int main()
{
    int n,i,in,s=0,t=0,u;
    scanf("%d",&n);
    for(i=1;i<=n;i++)
    {
        scanf("%d",&in);
        p+=in;
        if(in>a)
        a=in;
    }
    u=t-a+(a/2);
    printf("%d\n",u);
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:9:9: error: 'p' undeclared (first use in this function)
    9 |         p+=in;
      |         ^
main.c:9:9: note: each undeclared identifier is reported only once for each function it appears in
main.c:10:15: error: 'a' undeclared (first use in this function)
   10 |         if(in>a)
      |               ^
Language: C++

#include<stdio.h>

int main()

{
   int a;

   scanf("%d",&a);

   if((a/100==7)||(a/10)%10==7||(a%10)==7)
   {
      printf("Yes\n");
   }

   else
   {
      printf("No\n");1
   }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:23: error: expected ';' before '}' token
   17 |       printf("No\n");1
      |                       ^
      |                       ;
   18 |    }
      |    ~
Language: C++

#include<iostream>
using namespace std;
int pow(int m,int n){
     int ret=1;
     for(int i=0;i<n;i++)ret*=m;
     return ret;
}
int main(){
     int N,flag=0;
     for(int i=0;pow(10,i)>=N;i++){
          if (N%pow(10,i)==7)flag+;
          N-=N%pow(10,i);
     }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:35: error: expected primary-expression before ';' token
   11 |           if (N%pow(10,i)==7)flag+;
      |                                   ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  string n; 
  cin >> n;
  if(s.find('7') == string::npos) cout << "Yes" << endl;
  else cout << "No" << endl;
  return 0;
 }


Compiler output:
a.cc: In function 'int main()':
a.cc:7:6: error: 's' was not declared in this scope
    7 |   if(s.find('7') == string::npos) cout << "Yes" << endl;
      |      ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  string n; 
  cin >> n;
  if (n[0] == "7") cout << "Yes" << endl;
  if (n[1] == "7") cout << "Yes" << endl;
  if (n[2] == "7") cout << "Yes" << endl;
  else cout << "No" << endl;
  return 0;
 }

Compiler output:
a.cc: In function 'int main()':
a.cc:7:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    7 |   if (n[0] == "7") cout << "Yes" << endl;
a.cc:8:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    8 |   if (n[1] == "7") cout << "Yes" << endl;
a.cc:9:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    9 |   if (n[2] == "7") cout << "Yes" << endl;
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int i;
  vector<int> vec(n);
  for(i=0;i<3;i++){
  cin>>n(i);
  }
  if(n.at(0)==7 && n.at(2)==7 && n.at(3)==7){
    cout<<"Yes"<<'\n';
  }else{
    cout<<"No"<<'\n';
  return(0);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:19: error: 'n' was not declared in this scope
    5 |   vector<int> vec(n);
      |                   ^
a.cc:14:2: error: expected '}' at end of input
   14 | }
      |  ^
a.cc:3:11: note: to match this '{'
    3 | int main(){
      |           ^
Language: C++

 int main(){
 char s[4];
 scanf("%s",s);
 if(s[0]=='7'||s[1]=='7'||s[2]=='7')puts("Yes");
 else puts("No");
 }

Compiler output:
a.cc: In function 'int main()':
a.cc:3:2: error: 'scanf' was not declared in this scope
    3 |  scanf("%s",s);
      |  ^~~~~
a.cc:4:37: error: 'puts' was not declared in this scope
    4 |  if(s[0]=='7'||s[1]=='7'||s[2]=='7')puts("Yes");
      |                                     ^~~~
a.cc:5:7: error: 'puts' was not declared in this scope
    5 |  else puts("No");
      |       ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  char a[4]; 
  cin >> a;
  
  if(a[0]=="7"||a[1]=="7"||a[2]=="7") cout << "Yes" << endl;
  else cout << "No" << endl;
  return 0;
 }

Compiler output:
a.cc: In function 'int main()':
a.cc:8:10: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    8 |   if(a[0]=="7"||a[1]=="7"||a[2]=="7") cout << "Yes" << endl;
      |      ~~~~^~~~~
a.cc:8:21: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    8 |   if(a[0]=="7"||a[1]=="7"||a[2]=="7") cout << "Yes" << endl;
      |                 ~~~~^~~~~
a.cc:8:32: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    8 |   if(a[0]=="7"||a[1]=="7"||a[2]=="7") cout << "Yes" << endl;
      |                            ~~~~^~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  char a[2]; 
  cin >> a;
  
  if(a[0]=="7"||a[1]=="7"||a[2]=="7") cout << "Yes" << endl;
  else cout << "No" << endl;
  return 0;
 }

Compiler output:
a.cc: In function 'int main()':
a.cc:8:10: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    8 |   if(a[0]=="7"||a[1]=="7"||a[2]=="7") cout << "Yes" << endl;
      |      ~~~~^~~~~
a.cc:8:21: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    8 |   if(a[0]=="7"||a[1]=="7"||a[2]=="7") cout << "Yes" << endl;
      |                 ~~~~^~~~~
a.cc:8:32: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    8 |   if(a[0]=="7"||a[1]=="7"||a[2]=="7") cout << "Yes" << endl;
      |                            ~~~~^~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  char a[2]; 
  cin >> a;
  
  if(a[0]="7"||a[1]="7"||a[2]="7") cout << "Yes" << endl;
  else cout << "No" << endl;
  return 0;
 }

Compiler output:
a.cc: In function 'int main()':
a.cc:8:24: error: lvalue required as left operand of assignment
    8 |   if(a[0]="7"||a[1]="7"||a[2]="7") cout << "Yes" << endl;
      |                     ~~~^~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  string s; 
  cin >> s;
  
  if(s[0] == "7") {
    cout << "Yes" << endl;
  }else if (s[1] == "7") {
    cout << "Yes" << endl;
  }else if(s[2] == "7") {
    cout << "Yes" << endl;
  }else {
    cout << "No" << endl;
  }
  return 0;
 }

Compiler output:
a.cc: In function 'int main()':
a.cc:8:11: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    8 |   if(s[0] == "7") {
a.cc:10:18: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 |   }else if (s[1] == "7") {
a.cc:12:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   12 |   }else if(s[2] == "7") {