buggy_code stringlengths 11 625k | fixed_code stringlengths 17 625k | bug_type stringlengths 2 4.45k | language int64 0 8 | token_count int64 5 200k |
|---|---|---|---|---|
#include <algorithm>
#include <cmath>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define pb push_back
#define sz(a) (int)a.size()
using namespace std;
ll INF = 1000000007;
int main() {
i... | #include <algorithm>
#include <cmath>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define pb push_back
#define sz(a) (int)a.size()
using namespace std;
ll INF = 1000000007;
int main() {
i... | [["+", 31, 16, 12, 69, 341, 342, 0, 16, 17, 72], ["+", 31, 16, 12, 69, 341, 342, 0, 16, 12, 13]] | 1 | 109 |
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
int main() {
int n;
cin >> n;
int a[n + 1];
for (int i = 2; i <= n; i++)
cin >> a[i];
int v[n + 1];
for (int i = 1; i <= n; i++) {
v[i] = 0;
}
for (int i = 1; i <= n; i++) {
v[a[i]]++;
}
for (int i = 1; i <= n; i++) {
... | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
int main() {
int n;
cin >> n;
int a[n + 1];
for (int i = 2; i <= n; i++)
cin >> a[i];
int v[n + 1];
for (int i = 1; i <= n; i++) {
v[i] = 0;
}
for (int i = 2; i <= n; i++) {
v[a[i]]++;
}
for (int i = 1; i <= n; i++) {
... | [["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]] | 1 | 134 |
#include <bits/stdc++.h>
#define rep(i, n) for (int(i) = 0; (i) < (n); ++(i))
using namespace std;
int main() {
int n;
cin >> n;
vector<int> a(n - 1);
rep(i, n - 1) {
cin >> a[i];
a[i]--;
}
map<int, int> cnt;
rep(i, n - 1) cnt[i] = 0;
rep(i, n - 1) cnt[a[i]]++;
for (auto e : cnt)
cout <... | #include <bits/stdc++.h>
#define rep(i, n) for (int(i) = 0; (i) < (n); ++(i))
using namespace std;
int main() {
int n;
cin >> n;
vector<int> a(n - 1);
rep(i, n - 1) {
cin >> a[i];
a[i]--;
}
map<int, int> cnt;
rep(i, n) cnt[i] = 0;
rep(i, n - 1) cnt[a[i]]++;
for (auto e : cnt)
cout << e.... | [["-", 31, 69, 28, 2, 3, 4, 0, 16, 17, 33], ["-", 31, 69, 28, 2, 3, 4, 0, 16, 12, 13]] | 1 | 117 |
n = int(input())
a = list(map(int, input().split()))
l = [0]*n
for i in range(n-1):
l[a[i]] += 1
print(*l[1:], sep = '\n') | n = int(input())
a = list(map(int, input().split()))
l = [0]*(n+1)
for i in range(n-1):
l[a[i]] += 1
print(*l[1:], sep = '\n')
| [["+", 0, 1, 0, 662, 12, 657, 12, 23, 0, 24], ["+", 0, 662, 12, 657, 12, 23, 0, 657, 17, 72], ["+", 0, 662, 12, 657, 12, 23, 0, 657, 12, 612], ["+", 0, 1, 0, 662, 12, 657, 12, 23, 0, 25]] | 5 | 66 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
int temp;
vector<int> a(n + 1, 0);
for (int i = 0; i < n - 1; i++) {
cin >> temp;
a.at(temp)++;
}
for (int i = 1; i < n + 1; i++) {
cout << a.at(i) << endl;
}
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
int temp;
cin >> n;
vector<int> a(n + 1, 0);
for (int i = 0; i < n - 1; i++) {
cin >> temp;
a.at(temp)++;
}
for (int i = 1; i < n + 1; i++) {
cout << a.at(i) << endl;
}
} | [["+", 0, 14, 8, 9, 0, 1, 0, 16, 31, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 17, 152], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]] | 1 | 90 |
#include <bits/stdc++.h>
#define zcin(type, a) \
type a; \
cin >> a;
#define zcout(a, sep1, b, sep2) cout << a << sep1 << b << sep2;
#define zfor(i, b, n) for (int i = b; i < n; ++i)
#defin... |
#include <bits/stdc++.h>
#define zcin(type, a) \
type a; \
cin >> a;
#define zcout(a, sep1, b, sep2) cout << a << sep1 << b << sep2;
#define zfor(i, b, n) for (int i = b; i < n; ++i)
#defin... | [["+", 31, 16, 31, 2, 3, 4, 0, 16, 17, 72], ["+", 31, 16, 31, 2, 3, 4, 0, 16, 12, 13]] | 1 | 122 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
vector<int> boss(N);
for (int i = 0; i < N; i++)
cin >> boss.at(i);
vector<int> count(N);
for (int i = 0; i < N; i++) {
int a;
a = boss.at(i) - 1;
count.at(a)++;
}
for (int i = 0; i < N; i++)
cout << count.a... | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
vector<int> boss(N - 1);
for (int i = 0; i < N - 1; i++)
cin >> boss.at(i);
vector<int> count(N);
for (int i = 0; i < N - 1; i++) {
int a;
a = boss.at(i) - 1;
count.at(a)++;
}
for (int i = 0; i < N; i++)
cou... | [["+", 0, 43, 49, 50, 51, 4, 0, 16, 17, 33], ["+", 0, 43, 49, 50, 51, 4, 0, 16, 12, 13], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 33], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]] | 1 | 123 |
from itertools import repeat
n = int(input())
lis = list(map(int, input.split()))
d = [[0] for i in repeat(None, n)]
for i in lis:
d[i - 1][0] += 1
for i in d:
print(i[0]) | from itertools import repeat
n = int(input())
lis = list(map(int, input().split()))
d = [[0] for i in repeat(None, n)]
for i in lis:
d[i - 1][0] += 1
for i in d:
print(i[0]) | [["+", 0, 652, 63, 319, 500, 652, 3, 4, 0, 24], ["+", 0, 652, 63, 319, 500, 652, 3, 4, 0, 25]] | 5 | 71 |
#include <algorithm>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namesp... | #include <algorithm>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namesp... | [["-", 0, 43, 49, 50, 51, 4, 0, 16, 17, 33], ["+", 0, 43, 49, 50, 51, 4, 0, 16, 17, 72]] | 1 | 295 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
vector<int> a(n);
for (int i = 1; i < n; i++) {
cin >> a[i];
}
vector<int> number(n);
for (int i = 1; i < n; i++) {
int x = a[i];
number[x]++;
}
for (int i = 0; i < n; i++) {
cout << number[i] << endl;
}
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
vector<int> a(n);
for (int i = 1; i < n; i++) {
cin >> a[i];
}
vector<int> number(n);
for (int i = 1; i < n; i++) {
int x = a[i];
number[x - 1]++;
}
for (int i = 0; i < n; i++) {
cout << number[i] << endl;
}... | [["+", 0, 27, 28, 69, 341, 342, 0, 16, 17, 33], ["+", 0, 27, 28, 69, 341, 342, 0, 16, 12, 13]] | 1 | 115 |
N = int(input())
s = [0 for i in range(N)]
A = list(map(int, input().split()))
print(s)
for i in A:
s[i - 1] += 1
print(*s, sep='\n')
| N = int(input())
s = [0 for i in range(N)]
A = list(map(int, input().split()))
for i in A:
s[i - 1] += 1
print(*s, sep='\n')
| [["-", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 25]] | 5 | 65 |
#include <iostream>
using namespace std;
int main(void) {
int n;
int a[200000];
cin >> n;
int cnt[200000] = {0};
for (int i = 0; i < n; i++) {
cin >> a[i];
}
for (int i = 0; i < n; i++) {
cnt[a[i]]++;
}
for (int i = 0; i < n; i++) {
cout << cnt[i] << endl;
}
return 0;
} | #include <iostream>
using namespace std;
int main(void) {
int n;
int a[200000];
cin >> n;
int cnt[200001] = {0};
for (int i = 0; i < n; i++) {
cin >> a[i];
}
for (int i = 0; i < n; i++) {
cnt[a[i]]++;
}
for (int i = 1; i <= n; i++) {
cout << cnt[i] << endl;
}
return 0;
} | [["-", 8, 9, 0, 43, 49, 50, 49, 80, 81, 13], ["+", 8, 9, 0, 43, 49, 50, 49, 80, 81, 13], ["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 1 | 112 |
n = gets.chomp.to_i
a = gets.chomp.split(" ").map{|i|i.to_i}
cnum = Array.new(n, 0)
a.each do |num|
cnum[num] += 1
end
1.upto(n) do |i|
puts cnum[i]
end | n = gets.chomp.to_i
a = gets.chomp.split(" ").map{|i|i.to_i}
cnum = Array.new(n+1, 0)
a.each do |num|
cnum[num] += 1
end
1.upto(n) do |i|
puts cnum[i]
end | [["+", 0, 662, 12, 652, 3, 4, 0, 738, 17, 72], ["+", 0, 662, 12, 652, 3, 4, 0, 738, 12, 612]] | 4 | 69 |
#pragma GCC optimize("Ofast")
#include <algorithm>
#include <bits/stdc++.h>
#include <cstring>
#include <iostream>
#include <vector>
using namespace std;
typedef long long ll;
int main() {
ll N, a;
int i;
cin >> N;
vector<int> A(N);
for (i = 0; i < N; i++) {
cin >> a;
A[a - 1]++;
}
for (i = 0... | #pragma GCC optimize("Ofast")
#include <algorithm>
#include <bits/stdc++.h>
#include <cstring>
#include <iostream>
#include <vector>
using namespace std;
typedef long long ll;
int main() {
ll N, a;
int i;
cin >> N;
vector<int> A(N, 0);
for (i = 0; i < N - 1; i++) {
cin >> a;
A[a - 1]++;
}
for... | [["+", 8, 9, 0, 43, 49, 50, 51, 4, 0, 21], ["+", 8, 9, 0, 43, 49, 50, 51, 4, 0, 13], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 33], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]] | 1 | 99 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int m[n] = {0};
for (int i = 0; i < n - 1; i++) {
int x;
cin >> x;
m[x]++;
}
for (int i = 1; i <= n; i++)
cout << m[i] << endl;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int m[n + 1] = {0};
for (int i = 0; i < n - 1; i++) {
int x;
cin >> x;
m[x]++;
}
for (int i = 1; i <= n; i++)
cout << m[i] << endl;
} | [["+", 0, 43, 49, 50, 49, 80, 81, 16, 17, 72], ["+", 0, 43, 49, 50, 49, 80, 81, 16, 12, 13]] | 1 | 83 |
n = int(input())
a = list(map(int, input().split()))
arr = [0 for i in range(n)]
for i in a:
arr[a - 1] += 1
for i in range(n):
print(arr[i]) | n = int(input())
a = list(map(int, input().split()))
arr = [0 for i in range(n)]
for i in a:
arr[i - 1] += 1
for i in range(n):
print(arr[i]) | [["-", 0, 1, 0, 677, 31, 206, 206, 657, 31, 22], ["+", 0, 1, 0, 677, 31, 206, 206, 657, 31, 22]] | 5 | 65 |
#include <bits/stdc++.h>
#include <numeric>
#define REP(i, s, n) for (int i = s; i < n; ++i)
#define rep(i, n) REP(i, 0, n)
#define SORT(c) sort((c).begin(), (c).end())
#define SORT_INV(c) sort((c).begin(), (c).end(), greater<int>())
#define IINF INT_MAX
#define LLINF LLONG_MAX
#define DEBUG false
#define LL long lon... | #include <bits/stdc++.h>
#include <numeric>
#define REP(i, s, n) for (int i = s; i < n; ++i)
#define rep(i, n) REP(i, 0, n)
#define SORT(c) sort((c).begin(), (c).end())
#define SORT_INV(c) sort((c).begin(), (c).end(), greater<int>())
#define IINF INT_MAX
#define LLINF LLONG_MAX
#define DEBUG false
#define LL long lon... | [["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]] | 1 | 123 |
import sys
def get_ints(): return map(int, sys.stdin.readline().strip().split())
def get_array(): return list(get_ints())
def input(): return sys.stdin.readline().strip()
n = int(input())
Arr = get_array()
child = [0]*(n)
for index, value in enumerate(Arr, 2):
child[value] += 1
for i in child:
print(i) | import sys
def get_ints(): return map(int, sys.stdin.readline().strip().split())
def get_array(): return list(get_ints())
def input(): return sys.stdin.readline().strip()
n = int(input())
Arr = get_array()
child = [0] * (n)
for index, value in enumerate(Arr, 2):
child[value - 1] += 1
for i in child:
print... | [["+", 0, 1, 0, 677, 31, 206, 206, 657, 17, 33], ["+", 0, 1, 0, 677, 31, 206, 206, 657, 12, 612]] | 5 | 106 |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using ull = unsigned long long;
#define all(x) x.begin(), x.end()
template <typename T1, typename T2> inline void chkmin(T1 &x, const T2 &y) {
if (x > y)
x = y;
}
template <typename T1, typename T2> inline void chkmax(T1... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using ull = unsigned long long;
#define all(x) x.begin(), x.end()
template <typename T1, typename T2> inline void chkmin(T1 &x, const T2 &y) {
if (x > y)
x = y;
}
template <typename T1, typename T2> inline void chkmax(T1... | [["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 33], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]] | 1 | 224 |
t = int(input())
A = list(map(int,input().split()))
B = [-1]*t
for i in range(t-1):
B[A[i]-1] += 1
for i in range(t):
if B[i]!= -1:
print(B[i])
else:
print(0) | t = int(input())
A = list(map(int,input().split()))
B = [0]*t
for i in range(t-1):
B[A[i]-1] += 1
for i in range(t):
if B[i]!= -1:
print(B[i])
else:
print(0) | [["-", 0, 662, 12, 657, 31, 634, 0, 664, 17, 33], ["-", 0, 662, 12, 657, 31, 634, 0, 664, 28, 612], ["+", 0, 1, 0, 662, 12, 657, 31, 634, 0, 612]] | 5 | 84 |
#include <algorithm>
#include <cmath>
#include <fstream>
#include <iostream>
#include <queue>
#include <stdio.h>
#include <string>
#include <tuple>
#include <vector>
#define REP(i, n) for (int i = 0; i < n; i++)
// using ll = long long;
using namespace std;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
... | #include <algorithm>
#include <cmath>
#include <fstream>
#include <iostream>
#include <queue>
#include <stdio.h>
#include <string>
#include <tuple>
#include <vector>
#define REP(i, n) for (int i = 0; i < n; i++)
// using ll = long long;
using namespace std;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
... | [["-", 0, 1, 0, 2, 3, 4, 0, 16, 17, 33], ["-", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13], ["-", 0, 1, 0, 2, 3, 4, 0, 25, 0, 35]] | 1 | 127 |
#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using name... | #include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using name... | [["+", 0, 11, 31, 69, 341, 342, 0, 16, 17, 33], ["+", 0, 11, 31, 69, 341, 342, 0, 16, 12, 13], ["+", 12, 16, 31, 69, 341, 342, 0, 16, 17, 33], ["+", 12, 16, 31, 69, 341, 342, 0, 16, 12, 13], ["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]] | 1 | 134 |
#include <bits/stdc++.h>
#define F first
#define S second
#define pb push_back
#define ll long long
#define mp make_pair
#define pii pair<int, int>
#define mod 1000000007
#define M 1000000
using namespace std;
std::vector<int> adj[10];
void answer() {
ll n, m, ans = 0, x, y;
cin >> n;
ll a[200005] = {};
for (... | #include <bits/stdc++.h>
#define F first
#define S second
#define pb push_back
#define ll long long
#define mp make_pair
#define pii pair<int, int>
#define mod 1000000007
#define M 1000000
using namespace std;
std::vector<int> adj[10];
void answer() {
ll n, m, ans = 0, x, y;
cin >> n;
ll a[200005] = {};
for (... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 1 | 164 |
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define lb lower_bound
#define ub upper_bound
#define ins insert
#define ull unsigned long long
#define repi(i, a) for (... | #pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define lb lower_bound
#define ub upper_bound
#define ins insert
#define ull unsigned long long
#define repi(i, a) for (... | [["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 33], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]] | 1 | 229 |
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep_range(i, s, e) for (int i = (s); i < (int)(e); i++)
#define rep_rev(i, s, e) for (int i = (s)-1; i >= (int)(e); i--)
#define sort_vec(v) sort((v).begin(), (v).end())
typedef int64_t lint;
// lint mod = 9982443... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep_range(i, s, e) for (int i = (s); i < (int)(e); i++)
#define rep_rev(i, s, e) for (int i = (s)-1; i >= (int)(e); i--)
#define sort_vec(v) sort((v).begin(), (v).end())
typedef int64_t lint;
// lint mod = 9982443... | [["+", 0, 11, 31, 69, 341, 342, 0, 16, 17, 33], ["+", 0, 11, 31, 69, 341, 342, 0, 16, 12, 13]] | 1 | 168 |
n = int(input())
arr = {}
s = list(map(int, input().split()))
for i in range(1, n):
arr[i] = arr.get(s[i-1], 0) + 1
for i in range(1, n+1):
print(arr[i] if i in arr else 0)
| n = int(input())
arr = {}
s = list(map(int, input().split()))
for i in range(1, n):
arr[s[i-1]] = arr.get(s[i-1], 0) + 1
for i in range(1, n+1):
print(arr[i] if i in arr else 0)
| [["+", 0, 1, 0, 662, 31, 206, 206, 206, 51, 22], ["+", 0, 1, 0, 662, 31, 206, 206, 206, 0, 70], ["+", 0, 662, 31, 206, 206, 206, 206, 657, 17, 33], ["+", 0, 662, 31, 206, 206, 206, 206, 657, 12, 612], ["+", 0, 1, 0, 662, 31, 206, 206, 206, 0, 73]] | 5 | 84 |
#include <bits/stdc++.h>
using namespace std;
int member[200005];
int main() {
int n;
cin >> n;
for (int i = 1; i <= n; i++) {
int a;
cin >> a;
member[a]++;
}
for (int i = 1; i <= n; i++) {
cout << member[i] << endl;
}
return 0;
} | #include <bits/stdc++.h>
using namespace std;
int member[200005];
int main() {
int n;
cin >> n;
for (int i = 2; i <= n; i++) {
int a;
cin >> a;
member[a]++;
}
for (int i = 1; i <= n; i++) {
cout << member[i] << endl;
}
return 0;
} | [["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]] | 1 | 82 |
#include <algorithm>
#include <cmath> //abs()かfabs()で少数絶対値
#include <cstdlib> //abs()で整数絶対値
#include <functional> //sort第三引数greater<型名>()で降順
#include <iomanip> //cout<<setw(数字) で空白による桁揃え
#include <iostream> //cout<<right で右揃え
#include <queue>
#include <string>
#include <vector>
using namespace std;
using ... | #include <algorithm>
#include <cmath> //abs()かfabs()で少数絶対値
#include <cstdlib> //abs()で整数絶対値
#include <functional> //sort第三引数greater<型名>()で降順
#include <iomanip> //cout<<setw(数字) で空白による桁揃え
#include <iostream> //cout<<right で右揃え
#include <queue>
#include <string>
#include <vector>
using namespace std;
using ... | [["-", 0, 27, 28, 69, 341, 342, 0, 16, 17, 72], ["+", 0, 27, 28, 69, 341, 342, 0, 16, 17, 33]] | 1 | 117 |
n=int(input())
s = list(map(int, input().split()))
z=[]*n
for i in range(len(s)):
z[s[i]-1]+=1
for j in range(n):
print(z[j]) | n=int(input())
s = list(map(int, input().split()))
z=[0]*n
for i in range(len(s)):
k=s[i]-1
z[k]+=1
for j in range(n):
print(z[j]) | [["+", 0, 1, 0, 662, 12, 657, 31, 634, 0, 612], ["-", 8, 196, 0, 1, 0, 677, 31, 206, 51, 22], ["-", 8, 196, 0, 1, 0, 677, 31, 206, 0, 70], ["+", 0, 7, 8, 196, 0, 1, 0, 662, 31, 22], ["+", 0, 7, 8, 196, 0, 1, 0, 662, 0, 32], ["+", 8, 196, 0, 1, 0, 677, 31, 206, 51, 22], ["+", 8, 196, 0, 1, 0, 677, 31, 206, 0, 70], ["+",... | 5 | 68 |
#include <bits/stdc++.h>
#define fast ios::sync_with_stdio(false), cin.tie(0);
#define ll long long
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define endl '\n'
using namespace std;
int main() {
fast;
int n, i;
cin >> n;
int sub[n + 1] = {0}, a;
for (i = 0; i < n; i++) {
... | #include <bits/stdc++.h>
#define fast ios::sync_with_stdio(false), cin.tie(0);
#define ll long long
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define endl '\n'
using namespace std;
int main() {
fast;
int n, i;
cin >> n;
int sub[n + 1] = {0}, a;
for (i = 0; i < n - 1; i++) ... | [["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 33], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]] | 1 | 108 |
#include <bits/stdc++.h>
#define REP(i, x) REPI(i, 0, x)
#define REPI(i, a, b) for (int i = int(a); i < int(b); ++i)
#define ALL(x) (x).begin(), (x).end()
typedef long long ll;
using namespace std;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
int N;
cin >> N;
vector<int> A(N + 1, 0);
int a;
... | #include <bits/stdc++.h>
#define REP(i, x) REPI(i, 0, x)
#define REPI(i, a, b) for (int i = int(a); i < int(b); ++i)
#define ALL(x) (x).begin(), (x).end()
typedef long long ll;
using namespace std;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
int N;
cin >> N;
vector<int> A(N + 1, 0);
int a;
... | [["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13]] | 1 | 128 |
#C
from collections import Counter
n = int(input())
a = list(map(int, input().split()))
m=max(a)
a = Counter(a)
print(a)
for i in range(1, n + 1):
if i <= m:
print(a[i])
else:
print(0)
| #C
from collections import Counter
n = int(input())
a = list(map(int, input().split()))
m = max(a)
a = Counter(a)
# print(a)
for i in range(1, n + 1):
if i <= m:
print(a[i])
else:
print(0)
| [["-", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 25]] | 5 | 76 |
/*
Author : Nishant Gupta 2.0
*/
#include <bits/stdc++.h>
#define LL long long int
#define pb push_back
#define mp make_pair
#define MAX 100005
#define MOD 1000000007
using namespace std;
int main() {
int n, i, x;
cin >> n;
int a[n + 1];
memset(a, 0, sizeof a);
for (i = 0; i < n; i++) {
cin >> x;
... | /*
Author : Nishant Gupta 2.0
*/
#include <bits/stdc++.h>
#define LL long long int
#define pb push_back
#define mp make_pair
#define MAX 100005
#define MOD 1000000007
using namespace std;
int main() {
int n, i, x;
cin >> n;
int a[n + 1];
memset(a, 0, sizeof a);
for (i = 1; i < n; i++) {
cin >> x;
... | [["-", 0, 14, 8, 9, 0, 7, 10, 11, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 10, 11, 12, 13]] | 1 | 109 |
from collections import Counter
N = int(input())
A = list(map(int, input().split()))
l = collections.Counter(A)
for i in range(1, N+1):
print(l[i])
| from collections import Counter
N = int(input())
A = list(map(int, input().split()))
l = Counter(A)
for i in range(1, N+1):
print(l[i]) | [["-", 0, 1, 0, 662, 12, 652, 63, 319, 500, 22], ["-", 0, 1, 0, 662, 12, 652, 63, 319, 0, 131]] | 5 | 56 |
#include <stdio.h>
#include <string.h>
#define lop(i, n) for (i = 0; i < n; i++)
int main() {
int n, i;
int A[200000];
int S[200000] = {0};
A[0] = -1;
scanf("%d", &n);
for (i = 1; i < n; i++) {
scanf("%d", &A[i]);
S[A[i] + 1]++;
}
lop(i, n) { printf("%d\n", S[i]); }
return 0;
} | #include <stdio.h>
#include <string.h>
#define lop(i, n) for (i = 0; i < n; i++)
int main() {
int n, i;
int A[200000];
int S[200000] = {0};
A[0] = -1;
scanf("%d", &n);
for (i = 1; i < n; i++) {
scanf("%d", &A[i]);
S[A[i] - 1]++;
}
lop(i, n) { printf("%d\n", S[i]); }
return 0;
} | [["-", 0, 1, 0, 27, 28, 69, 71, 16, 17, 72], ["+", 0, 1, 0, 27, 28, 69, 71, 16, 17, 33]] | 0 | 120 |
N = int(input())
A = [0]*N
print(A)
for i in [int(s) for s in input().split()]:
A[i-1] +=1
for j in range(N+1):
print(A[j]) | N = int(input())
A = [0]*N
for i in [int(s) for s in input().split()]:
A[i-1] +=1
for j in range(N):
print(A[j]) | [["-", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 25], ["-", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["-", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 64 |
//
// main.cpp
// biggner20200419
//
// Created by zer0 on 2020/04/19.
// Copyright © 2020 zer0. All rights reserved.
//
#include <iostream>
int main(int argc, const char *argv[]) {
int MAX_N = 2 * 100000;
int n;
std::cin >> n;
int a[MAX_N];
int b[MAX_N];
for (int i = 1; i < n; i++) {
a[i] = 0;
... | //
// main.cpp
// biggner20200419
//
// Created by zer0 on 2020/04/19.
// Copyright © 2020 zer0. All rights reserved.
//
#include <iostream>
int main(int argc, const char *argv[]) {
int MAX_N = 2 * 100000;
int n;
std::cin >> n;
int a[MAX_N];
int b[MAX_N];
for (int i = 1; i <= n; i++) {
a[i] = 0;
... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 1 | 159 |
#include <stdio.h>
int main() {
int n;
scanf("%d", &n);
int o[n];
for (int i = 0; i < n; i++) {
o[n] = 0;
}
int a;
for (int i = 0; i < n; i++) {
scanf("%d", &a);
o[a - 1]++;
}
for (int i = 0; i < n; i++) {
printf("%d\n", o[i]);
}
return 0;
}
| #include <stdio.h>
int main() {
int n;
scanf("%d", &n);
int o[n];
for (int i = 0; i < n; i++) {
o[i] = 0;
}
int a;
for (int i = 0; i < n - 1; i++) {
scanf("%d", &a);
o[a - 1]++;
}
for (int i = 0; i < n; i++) {
printf("%d\n", o[i]);
}
return 0;
}
| [["-", 8, 9, 0, 1, 0, 11, 31, 69, 71, 22], ["+", 8, 9, 0, 1, 0, 11, 31, 69, 71, 22], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 33], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]] | 0 | 119 |
N = int( input())
a = list(map(int, input().split(' ')))
l = [0]*N
numpy.sort(a)
for i in a:
l[i-1] += 1
for i in l:
print(i) | import numpy
N = int( input())
a = list(map(int, input().split(' ')))
l = [0]*N
numpy.sort(a)
for i in a:
l[i-1] += 1
for i in l:
print(i) | [["+", 36, 36, 36, 36, 0, 656, 0, 596, 0, 487], ["+", 36, 36, 0, 656, 0, 596, 141, 673, 0, 22]] | 5 | 63 |
import numpy as np
n = int(input())
jousi = list(map(int, input().split()))
a = np.zeros(n)
for i in jousi :
a[jousi[i] -1] += 1
for i in range(len(a)):
print(int(a[i])) | import numpy as np
n = int(input())
jousi = list(map(int, input().split()))
a = np.zeros(n)
for i in range(len(jousi)) :
a[jousi[i] - 1] += 1
for i in range(len(a)):
print(int(a[i])) | [["+", 36, 36, 0, 656, 0, 7, 12, 652, 63, 22], ["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 24], ["+", 0, 7, 12, 652, 3, 4, 0, 652, 63, 22], ["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 25], ["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 25]] | 5 | 74 |
import numpy as np
if __name__ == '__main__':
List = [list(map(int, input().split())) for i in range(2)]
N = List[0][0]
buka = np.array(List[1][:])
l_out = np.zeros(N,dtype=int)
for i in range(N):
l_out[buka[i]-1] += 1
for i in range(N):
print(l_out[i])
| import numpy as np
if __name__ == '__main__':
List = [list(map(int, input().split())) for i in range(2)]
N = List[0][0]
buka = np.array(List[1][:])
l_out = np.zeros(N,dtype=int)
for i in range(N-1):
l_out[buka[i]-1] += 1
for i in range(N):
print(l_out[i])
| [["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 33], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 106 |
#include <bits/stdc++.h>
using namespace std;
int a[11451419];
int b[11451419] = {};
int main() {
int n;
cin >> n;
for (int i = 2; i <= n; i++) {
cin >> a[i];
}
for (int i = 2; i <= n; i++) {
b[a[i]]++;
}
for (int i = 0; i < n; i++) {
cout << b[i] << endl;
}
return 0;
} | #include <bits/stdc++.h>
using namespace std;
int a[11451419];
int b[11451419] = {};
int main() {
int n;
cin >> n;
for (int i = 2; i <= n; i++) {
cin >> a[i];
}
for (int i = 2; i <= n; i++) {
b[a[i]]++;
}
for (int i = 1; i <= n; i++) {
cout << b[i] << endl;
}
return 0;
} | [["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 1 | 110 |
N = int(input())
a = list(map(int, input().split()))
li = [0] * N
print(li)
for i in range(N-1):
li[a[i]-1] = li[a[i]-1] + 1
for i in range(N):
print(li[i])
| N = int(input())
a = list(map(int, input().split()))
li = [0] * N
for i in range(N-1):
li[a[i]-1] = li[a[i]-1] + 1
for i in range(N):
print(li[i])
| [["-", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 25]] | 5 | 82 |
from collections import Counter
a=int(input())
l=list(map(int,input().split()))
d=Counter(l)
print(d)
for i in range(1,a+1):
if i in d:
print(d[i])
else:
print("0") | from collections import Counter
a=int(input())
l=list(map(int,input().split()))
d=Counter(l)
# print(d)
for i in range(1,a+1):
if i in d:
print(d[i])
else:
print("0") | [["-", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 25]] | 5 | 71 |
def function(n, list1):
ans = [0] * n
for i in list1:
ans[i - 1] += 1
string = ""
for i in range(len(ans)):
if i < len(ans) - 1:
string += ans[i] + "\n"
else:
string += ans[i]
return string
n = int(input())
list1 = input().split()
list1 = [int(i) for i in list1]
print(function(n, list... | def function(n, list1):
ans = [0] * n
for i in list1:
ans[i - 1] += 1
string = ""
for i in range(len(ans)):
if i < len(ans) - 1:
string += str(ans[i]) + "\n"
else:
string += str(ans[i])
return string
n = int(input())
list1 = input().split()
list1 = [int(i) for i in list1]
print(funct... | [["+", 0, 1, 0, 677, 12, 657, 31, 652, 63, 22], ["+", 0, 677, 12, 657, 31, 652, 3, 4, 0, 24], ["+", 0, 677, 12, 657, 31, 652, 3, 4, 0, 25], ["+", 8, 196, 0, 1, 0, 677, 12, 652, 63, 22], ["+", 0, 1, 0, 677, 12, 652, 3, 4, 0, 24], ["+", 0, 1, 0, 677, 12, 652, 3, 4, 0, 25]] | 5 | 111 |
#include <iostream>
#include <vector>
using namespace std;
int main() {
int a;
cin >> a;
vector<int> b(a), c(a);
for (int i = 0; i < a; i++) {
cin >> b.at(i);
c.at(b.at(i) - 1)++;
}
for (int i = 0; i < a; i++) {
cout << c.at(i) << endl;
}
} | #include <iostream>
#include <vector>
using namespace std;
int main() {
int a;
cin >> a;
vector<int> b(a - 1), c(a);
for (int i = 0; i < a - 1; i++) {
cin >> b.at(i);
c.at(b.at(i) - 1)++;
}
for (int i = 0; i < a; i++) {
cout << c.at(i) << endl;
}
} | [["+", 0, 43, 49, 50, 51, 4, 0, 16, 17, 33], ["+", 0, 43, 49, 50, 51, 4, 0, 16, 12, 13], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 33], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]] | 1 | 102 |
#include <stdio.h>
int main() {
int shain, i, tmp;
scanf("%d", &shain);
int buka[shain];
int hoge_len = sizeof(buka) / sizeof(buka[0]);
for (int i = 0; i < hoge_len; i++) {
buka[i] = 0;
}
for (i = 0; i < shain - 1; i++) {
tmp = 0;
scanf("%d", &tmp);
buka[tmp] += 1;
}
for (i = 0; i < ... | #include <stdio.h>
int main() {
int shain, i, tmp;
scanf("%d", &shain);
int buka[shain];
int hoge_len = sizeof(buka) / sizeof(buka[0]);
for (int i = 0; i < hoge_len; i++) {
buka[i] = 0;
}
for (i = 0; i < shain - 1; i++) {
tmp = 0;
scanf("%d", &tmp);
buka[tmp - 1] += 1;
}
for (i = 0; ... | [["+", 0, 1, 0, 11, 31, 69, 71, 16, 17, 33], ["+", 0, 1, 0, 11, 31, 69, 71, 16, 12, 13], ["-", 0, 14, 8, 9, 0, 7, 26, 27, 17, 29], ["+", 0, 14, 8, 9, 0, 7, 26, 27, 17, 29]] | 0 | 139 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int arr[n - 1];
for (int i = 0; i < n - 1; i++)
cin >> arr[i];
map<int, int> mp;
for (int i = 0; i < n; i++)
mp[arr[i]]++;
for (int i = 0; i < n; i++) {
int t = i + 1;
auto it = mp.find(t);
if (it != mp.end(... | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int arr[n - 1];
for (int i = 0; i < n - 1; i++)
cin >> arr[i];
map<int, int> mp;
for (int i = 0; i < n - 1; i++)
mp[arr[i]]++;
for (int i = 0; i < n; i++) {
int t = i + 1;
auto it = mp.find(t);
if (it != mp.... | [["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 33], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]] | 1 | 142 |
import collections
n = int(input())
a = list(map(int, input().split()))
c = collections.Counter(a)
l = [str(0) for i in range(n)]
key = list(c.keys())
for i in range(len(list(c.keys()))):
l[key[i]-1] = str(c[i+1])
print('\n'.join(l)) | import collections
n = int(input())
a = list(map(int, input().split()))
c = collections.Counter(a)
l = [str(0) for i in range(n)]
key = list(c.keys())
for i in range(len(list(c.keys()))):
l[key[i]-1] = str(c[key[i]])
print('\n'.join(l)) | [["+", 12, 652, 3, 4, 0, 206, 206, 206, 51, 22], ["+", 12, 652, 3, 4, 0, 206, 206, 206, 0, 70], ["-", 12, 652, 3, 4, 0, 206, 206, 657, 17, 72], ["-", 12, 652, 3, 4, 0, 206, 206, 657, 12, 612], ["+", 12, 652, 3, 4, 0, 206, 206, 206, 0, 73]] | 5 | 108 |
a = int(input())
lists = list(map(int, input().split())) #1行の入力をi[0],i[1]というように空白で分けてを取得し、iに値を入れる
num = [0]*a
def mi(x):
return int(x-1)
y = list(map(mi,lists))
for i in range(a):
#print('y')
# print(i)
num[y[i]] += 1
for i in range(a):
print(num[i])
| a = int(input())
lists = list(map(int, input().split())) #1行の入力をi[0],i[1]というように空白で分けてを取得し、iに値を入れる
num = [0]*a
def mi(x):
return int(x-1)
y = list(map(mi,lists))
for i in range(a-1):
num[y[i]] += 1
for i in range(a):
print(num[i])
| [["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 33], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 91 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int a[n];
int count[n] = {};
for (int i = 0; i < n; i++) {
cin >> a[i];
count[a[i] - 1]++;
}
for (int i = 0; i < n; i++)
cout << count[i] << endl;
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int a[n - 1];
int count[n] = {};
for (int i = 0; i < n - 1; i++) {
cin >> a[i];
count[a[i] - 1]++;
}
for (int i = 0; i < n; i++)
cout << count[i] << endl;
return 0;
}
| [["+", 8, 9, 0, 43, 49, 80, 81, 16, 17, 33], ["+", 8, 9, 0, 43, 49, 80, 81, 16, 12, 13], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 33], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]] | 1 | 94 |
n = int(input())
m = input().split()
m = [int(i) for i in m]
for i in range(n):
l.append(0)
for i in m:
ind = i-1
l[ind] += 1
for i in l:
print(i) | n = int(input())
m = input().split()
m = [int(i) for i in m]
l =[]
for i in range(n):
l.append(0)
for i in m:
ind = i-1
l[ind] += 1
for i in l:
print(i) | [["+", 36, 36, 0, 656, 0, 1, 0, 662, 31, 22], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 0, 32], ["+", 0, 656, 0, 1, 0, 662, 12, 634, 0, 70], ["+", 0, 656, 0, 1, 0, 662, 12, 634, 0, 73]] | 5 | 68 |
#include <cmath>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <stdio.h>
#include <string>
#include <vector>
using namespace std;
using ll = long long int;
typedef pair<int, int> P;
int main(void) {
int N;
cin >> N;
int mp[200009] = {0};
int k;
for (int i = 1; i < N; i++) {
... | #include <cmath>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <stdio.h>
#include <string>
#include <vector>
using namespace std;
using ll = long long int;
typedef pair<int, int> P;
int main(void) {
int N;
cin >> N;
int mp[200009] = {0};
int k;
for (int i = 1; i < N; i++) {
... | [["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]] | 1 | 120 |
#include <iostream>
#include <vector>
using namespace std;
int memberNumberToIndex(int memberNumber) { return memberNumber - 1; }
int main() {
int memberCount;
cin >> memberCount;
vector<int> bossNumbers(memberCount - 1);
for (auto index = 0; index < memberCount - 1; ++index) {
cin >> bossNumbers.at(inde... | #include <iostream>
#include <vector>
using namespace std;
int memberNumberToIndex(int memberNumber) { return memberNumber - 1; }
int main() {
int memberCount;
cin >> memberCount;
vector<int> bossNumbers(memberCount - 1);
for (auto index = 0; index < memberCount - 1; ++index) {
cin >> bossNumbers.at(inde... | [["+", 0, 338, 8, 9, 0, 1, 0, 16, 17, 151], ["+", 8, 9, 0, 1, 0, 16, 12, 5, 0, 62], ["+", 8, 9, 0, 1, 0, 16, 12, 5, 0, 44]] | 1 | 133 |
n=int(input())
a_list=[int(i) for i in input().split(' ')]
c = collections.Counter(a_list)
[print(c[i+1]) for i in range(n)] | n=int(input())
a_list=[int(i) for i in input().split(' ')]
import collections
c = collections.Counter(a_list)
[print(c[i+1]) for i in range(n)] | [["+", 36, 36, 36, 36, 0, 656, 0, 596, 0, 487], ["+", 36, 36, 0, 656, 0, 596, 141, 673, 0, 22]] | 5 | 55 |
#include <stdio.h>
int main(void) {
int a, b, c, d, e, f, g;
int A[1000000];
d = 0;
for (c = 0; c < a; c++) {
A[c] = 0;
}
scanf("%d", &a);
for (c = 1; c < a; c++) {
scanf("%d", &e);
A[e] = A[e] + 1;
}
for (c = 0; c < a; c++) {
d = A[c + 1];
printf("%d", d);
}
} | #include <stdio.h>
int main(void) {
int a, b, c, d, e, f, g;
int A[1000000];
d = 0;
for (c = 0; c < a; c++) {
A[c] = 0;
}
scanf("%d", &a);
for (c = 1; c < a; c++) {
scanf("%d", &e);
A[e] = A[e] + 1;
}
for (c = 0; c < a; c++) {
d = A[c + 1];
printf("%d\n", d);
}
}
| [["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 44]] | 0 | 136 |
#include <bits/stdc++.h>
#include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
int a[n + 1];
for (int f = 0; f <= n; f++) {
a[f] = 0;
}
for (int i = 1; i <= n; i++) {
int x;
cin >> x;
a[x]++;
}
for (int j = 1; j <= n; j++) {
cout << a[j] << endl;
}
} | #include <bits/stdc++.h>
#include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
int a[n + 1];
for (int f = 0; f <= n; f++) {
a[f] = 0;
}
for (int i = 2; i <= n; i++) {
int x;
cin >> x;
a[x]++;
}
for (int j = 1; j <= n; j++) {
cout << a[j] << endl;
}
} | [["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]] | 1 | 106 |
#include <stdio.h>
int main() {
int n, a, cnt[200001] = {0};
int i, j;
scanf("%d", &n);
i = 1;
while (scanf("%d", &a)) {
cnt[a]++;
i++;
if (i >= 7) {
break;
}
}
for (i = 1; i <= n; i++) {
printf("%d\n", cnt[i]);
}
return 0;
}
| #include <stdio.h>
int main() {
int n, a, cnt[200001] = {0};
int i, j;
scanf("%d", &n);
i = 1;
while (scanf("%d", &a)) {
cnt[a]++;
i++;
if (i >= n) {
break;
}
}
for (i = 1; i <= n; i++) {
printf("%d\n", cnt[i]);
}
return 0;
}
| [["-", 8, 9, 0, 57, 15, 23, 0, 16, 12, 13], ["+", 8, 9, 0, 57, 15, 23, 0, 16, 12, 22]] | 0 | 105 |
#include <stdio.h>
int main(void) {
int N, i;
scanf("%d", &N);
int A, B[N + 1];
for (i = 0; i < N; i++) {
B[i] = 0;
}
for (i = 0; i < N - 1; i++) {
scanf("%d", &A);
B[A] += 1;
}
for (i = 0; i < N; i++) {
printf("%d\n", B[i + 1]);
}
return 0;
} | #include <stdio.h>
int main(void) {
int N, i;
scanf("%d", &N);
int A, B[N + 1];
for (i = 0; i < N + 1; i++) {
B[i] = 0;
}
for (i = 0; i < N - 1; i++) {
scanf("%d", &A);
B[A] += 1;
}
for (i = 0; i < N; i++) {
printf("%d\n", B[i + 1]);
}
return 0;
} | [["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]] | 0 | 123 |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pii;
#define F first
#define S second
#define pb push_back
#define mp make_pair
#define fo(i, a, b) for (int i = a; i < b; i++)
#define SQ(a) (a) * (a)
int main() {
int n, k;
cin >> n;
vector<int> ... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pii;
#define F first
#define S second
#define pb push_back
#define mp make_pair
#define fo(i, a, b) for (int i = a; i < b; i++)
#define SQ(a) (a) * (a)
int main() {
int n, k;
cin >> n;
vector<int> ... | [["+", 0, 43, 49, 50, 51, 4, 0, 16, 17, 72], ["+", 0, 43, 49, 50, 51, 4, 0, 16, 12, 13]] | 1 | 132 |
import math
def main():
N = map(int, input())
l = [int(_) for _ in input().split()]
count_list = [0] * N
for i in l:
index = i - 1
count_list[index] += 1
for out in count_list:
print(out + '\n')
main() | import math
def main():
N = int(input())
l = [int(_) for _ in input().split()]
count_list = [0] * N
for i in l:
index = i - 1
count_list[index] += 1
for out in count_list:
print(out)
main() | [["-", 8, 196, 0, 1, 0, 662, 12, 652, 63, 22], ["-", 0, 1, 0, 662, 12, 652, 3, 4, 0, 24], ["-", 0, 1, 0, 662, 12, 652, 3, 4, 0, 21], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 24], ["-", 0, 1, 0, 652, 3, 4, 0, 657, 17, 72], ["-", 0, 652, 3, 4, 0, 657, 12, 557, 0, 654], ["-", 3, 4, 0, 657, 12, 557, 0, 6, 0, 44], ["-", 0, 652... | 5 | 74 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int N;
vector<int> vec(N - 1);
vector<int> vec2(N);
for (int i = 0; i < N - 1; i++) {
int a;
cin >> a;
vec.at(i) = a;
}
for (int i = 0; i < N - 1; i++) {
vec2.at(vec.at(i) - 1)++;
}
for (int i = 0; i < N; i++) {
cout << vec2... | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
vector<int> vec(N - 1);
vector<int> vec2(N);
for (int i = 0; i < N - 1; i++) {
int a;
cin >> a;
vec.at(i) = a;
}
for (int i = 0; i < N - 1; i++) {
vec2.at(vec.at(i) - 1)++;
}
for (int i = 0; i < N; i++) {
... | [["+", 0, 14, 8, 9, 0, 1, 0, 16, 31, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 17, 152], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]] | 1 | 129 |
#include <algorithm>
#include <cmath>
#include <iostream>
#include <map>
#include <queue>
#include <utility>
#include <vector>
using namespace std;
void printVector(const vector<int> &vec) {
for (int value : vec) {
cout << value << " ";
}
cout << endl;
}
int main() {
int n;
cin >> n;
vector<int> a(n ... | #include <algorithm>
#include <cmath>
#include <iostream>
#include <map>
#include <queue>
#include <utility>
#include <vector>
using namespace std;
void printVector(const vector<int> &vec) {
for (int value : vec) {
cout << value << " ";
}
cout << endl;
}
int main() {
int n;
cin >> n;
vector<int> a(n ... | [["-", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["-", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]] | 1 | 169 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
vector<int> vec(n);
for (int i = 0; i < n - 1; i++) {
int a;
cin >> a;
vec.at(a - 1)++;
}
for (int i = 0; i < n - 1; i++) {
cout << vec.at(i) << endl;
}
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
vector<int> vec(n);
for (int i = 0; i < n - 1; i++) {
int a;
cin >> a;
vec.at(a - 1)++;
}
for (int i = 0; i < n; i++) {
cout << vec.at(i) << endl;
}
} | [["-", 8, 9, 0, 7, 15, 16, 12, 16, 17, 33], ["-", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]] | 1 | 92 |
n = int(input())
boss_list = list(map(int, input().split(' ')))
# for i in range(n):
# print(boss_list.count(i + 1))
import collections
c = collections.Counter(boss_list)
for i in range(n):
print(boss_list[i + 1]) | n = int(input())
boss_list = list(map(int, input().split(' ')))
# for i in range(n):
# print(boss_list.count(i + 1))
import collections
c = collections.Counter(boss_list)
for i in range(n):
print(c[i + 1])
| [["-", 0, 1, 0, 652, 3, 4, 0, 206, 51, 22], ["+", 0, 1, 0, 652, 3, 4, 0, 206, 51, 22]] | 5 | 57 |
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using lint = long long int;
int main() {
lint n;
cin >> n;
vector<lint> vc;
rep(i, n - 1) {
int x;
cin >> x;
vc.push_back(x);
}
vector<lint> cnt(5);
rep(i, n - 1) cnt[(vc[i] - 1)]++;
rep(i, n) cout... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using lint = long long int;
int main() {
lint n;
cin >> n;
vector<lint> vc;
rep(i, n - 1) {
int x;
cin >> x;
vc.push_back(x);
}
vector<lint> cnt(n);
rep(i, n - 1) cnt[(vc[i] - 1)]++;
rep(i, n) cout... | [["-", 8, 9, 0, 43, 49, 50, 51, 4, 0, 13], ["+", 0, 43, 49, 53, 54, 55, 0, 56, 39, 78]] | 1 | 114 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
vector<int> A(N, 0);
vector<int> count(N, 0);
for (int i = 0; i < N - 1; i++) {
cin >> A.at(i);
count.at(A.at(i - 1)) += 1;
}
for (int i = 0; i < N; i++) {
cout << count.at(i) << endl;
}
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
vector<int> A(N, 0);
vector<int> count(N, 0);
for (int i = 0; i < N - 1; i++) {
cin >> A.at(i);
count.at(A.at(i) - 1) += 1;
}
for (int i = 0; i < N; i++) {
cout << count.at(i) << endl;
}
} | [["+", 3, 4, 0, 16, 31, 2, 3, 4, 0, 25], ["-", 31, 2, 3, 4, 0, 2, 3, 4, 0, 25]] | 1 | 111 |
from collections import Counter
N = int(input())
a = list(input().split())
fact_count = dict(Counter(a))
print(fact_count)
for i in range(1, N+1):
try:
print(fact_count[str(i)])
except:
print(0) | from collections import Counter
N = int(input())
a = list(input().split())
fact_count = dict(Counter(a))
for i in range(1, N+1):
try:
print(fact_count[str(i)])
except:
print(0) | [["-", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 25]] | 5 | 67 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
vector<int> A(N - 1);
for (int i = 0; i < N - 1; i++) {
cin >> A.at(i);
}
vector<int> ans(N);
for (int i = 0; i < N; i++) {
ans.at(i) = 0;
}
for (int i = 0; i < N - 1; i++) {
ans.at(A.at(i)) = ans.at(A.at(i)) + 1... | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
vector<int> A(N - 1);
for (int i = 0; i < N - 1; i++) {
cin >> A.at(i);
}
vector<int> ans(N);
for (int i = 0; i < N; i++) {
ans.at(i) = 0;
}
for (int i = 0; i < N - 1; i++) {
ans.at(A.at(i) - 1) = ans.at(A.at(i) ... | [["+", 0, 11, 31, 2, 3, 4, 0, 16, 17, 33], ["+", 0, 11, 31, 2, 3, 4, 0, 16, 12, 13], ["+", 12, 16, 31, 2, 3, 4, 0, 16, 17, 33], ["+", 12, 16, 31, 2, 3, 4, 0, 16, 12, 13]] | 1 | 165 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int N, a;
cin >> N;
vector<int> human(N, 0);
for (int i = 0; i < N; i++) {
cin >> a;
human[a - 1]++;
}
for (int n : human)
cout << n << endl;
} | #include "bits/stdc++.h"
using namespace std;
int main() {
int N, a;
cin >> N;
vector<int> human(N, 0);
for (int i = 0; i < N - 1; i++) {
cin >> a;
human[a - 1]++;
}
for (int n : human)
cout << n << endl;
}
| [["-", 36, 36, 36, 36, 0, 30, 0, 135, 136, 137], ["+", 36, 36, 0, 30, 0, 135, 136, 5, 0, 62], ["+", 36, 36, 0, 30, 0, 135, 136, 5, 0, 6], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 33], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]] | 1 | 73 |
#include <bits/stdc++.h>
#define longlongvector vector<long long>
#define intvector vector<int>
#define size size()
using namespace std;
int n, m, k;
int main() {
int n;
cin >> n;
int arr[100001] = {0};
for (int i = 0; i < n; i++) {
int a;
cin >> a;
arr[a]++;
}
for (int i = 1; i < n + 1; i++)... | #include <bits/stdc++.h>
#define longlongvector vector<long long>
#define intvector vector<int>
#define size size()
using namespace std;
int n, m, k;
int main() {
int n;
cin >> n;
int arr[200002] = {0};
for (int i = 0; i < n - 1; i++) {
int a;
cin >> a;
arr[a]++;
}
for (int i = 1; i < n + 1; ... | [["-", 8, 9, 0, 43, 49, 50, 49, 80, 81, 13], ["+", 8, 9, 0, 43, 49, 50, 49, 80, 81, 13], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 33], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]] | 1 | 100 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
vector<int> b(N, 0);
for (int i = 0; i < N - 1; i++) {
int k;
cin >> k;
b.at(k)++;
}
for (int i = 0; i < N; i++) {
cout << b.at(i) << endl;
}
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
vector<int> b(N, 0);
for (int i = 0; i < N - 1; i++) {
int k;
cin >> k;
b.at(k - 1)++;
}
for (int i = 0; i < N; i++) {
cout << b.at(i) << endl;
}
}
| [["+", 0, 27, 28, 2, 3, 4, 0, 16, 17, 33], ["+", 0, 27, 28, 2, 3, 4, 0, 16, 12, 13]] | 1 | 90 |
#include <bits/stdc++.h>
using namespace std;
int main() {
// 整数の入力
int N;
cin >> N;
// スペース区切りの整数の入力
int sum[N] = {0};
int a;
for (int i = 0; i < N - 1; i++) {
cin >> a;
sum[a - 1] += 1;
}
for (int i = 0; i < N; i++) {
cout << sum[i];
}
return 0;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
// 整数の入力
int N;
cin >> N;
// スペース区切りの整数の入力
int sum[N] = {0};
int a;
for (int i = 0; i < N - 1; i++) {
cin >> a;
sum[a - 1] += 1;
}
for (int i = 0; i < N; i++) {
cout << sum[i] << endl;
}
return 0;
} | [["+", 0, 7, 8, 9, 0, 1, 0, 16, 17, 151], ["+", 0, 7, 8, 9, 0, 1, 0, 16, 12, 22]] | 1 | 91 |
#include <stdio.h>
int main() {
int n, ans[200001] = {0}, t;
scanf("%d", &n);
for (int i = 0; i < n - 1; i++) {
scanf("%d", &t);
ans[t]++;
}
for (int i = 0; i < n; i++) {
printf("%d\n", ans[i]);
}
return 0;
} | #include <stdio.h>
int main() {
int n, ans[200001] = {0}, t;
scanf("%d", &n);
for (int i = 0; i < n - 1; i++) {
scanf("%d", &t);
ans[t - 1]++;
}
for (int i = 0; i < n; i++) {
printf("%d\n", ans[i]);
}
return 0;
} | [["+", 0, 1, 0, 27, 28, 69, 71, 16, 17, 33], ["+", 0, 1, 0, 27, 28, 69, 71, 16, 12, 13]] | 0 | 98 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
vector<int> number(N - 1);
for (int i = 1; i < N; i++) {
cin >> number.at(i);
}
vector<int> buka(N, 0);
for (int i = 1; i < N; i++) {
buka[number[i] - 1]++;
}
for (int i = 0; i < N; i++) {
cout << buka[i] << endl;... | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
vector<int> number(N - 1);
for (int i = 0; i < N - 1; i++) {
cin >> number.at(i);
}
vector<int> buka(N, 0);
for (int i = 0; i < N - 1; i++) {
buka[number[i] - 1]++;
}
for (int i = 0; i < N; i++) {
cout << buka[i] ... | [["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 33], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]] | 1 | 118 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
vector<int> a(n);
for (int i = 0; i < n; i++) {
int x;
cin >> x;
a.at(x - 1)++;
}
for (int i = 0; i < n; i++)
cout << a.at(i) << endl;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
vector<int> a(n, 0);
for (int i = 0; i < n - 1; i++) {
int x;
cin >> x;
a.at(x - 1)++;
}
for (int i = 0; i < n; i++)
cout << a.at(i) << endl;
} | [["+", 8, 9, 0, 43, 49, 50, 51, 4, 0, 21], ["+", 8, 9, 0, 43, 49, 50, 51, 4, 0, 13], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 33], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]] | 1 | 86 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
int a[N] = {0};
int joshi;
for (int i = 0; i < N; i++) {
cin >> joshi;
a[joshi - 1]++;
}
for (int i = 0; i < N; i++) {
cout << a[i] << endl;
}
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
int a[N] = {0};
int joshi;
for (int i = 0; i < N - 1; i++) {
cin >> joshi;
a[joshi - 1]++;
}
for (int i = 0; i < N; i++) {
cout << a[i] << endl;
}
} | [["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 33], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]] | 1 | 85 |
N = int(input())
A = list(map(int, input().split()))
G = [0] * (N + 1)
for i, val in enumerate(A):
G[val] += 1
print(G)
for i in range(1, N + 1):
print(G[i]) | N = int(input())
A = list(map(int, input().split()))
G = [0] * (N + 1)
for i, val in enumerate(A):
G[val] += 1
for i in range(1, N + 1):
print(G[i]) | [["-", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 25]] | 5 | 75 |
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define F(i, a, n) for (int i = a; i < n; i++)
int main() {
int n;
scanf("%d", &n);
int a[n - 1];
long sum = 0;
F(i, 0, n - 1) { scanf("%d", a + i); }
int b[n];
F(j, 0, n) { b[j] = 0; }
F(j, 0, n - 1) { b[a[j]]++; }
F(k, 0, ... | #include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define F(i, a, n) for (int i = a; i < n; i++)
int main() {
int n;
scanf("%d", &n);
int a[n - 1];
long sum = 0;
F(i, 0, n - 1) { scanf("%d", a + i); }
int b[n];
F(j, 0, n) { b[j] = 0; }
F(j, 0, n - 1) { b[a[j] - 1]++; }
F(k,... | [["+", 0, 1, 0, 27, 28, 69, 71, 16, 17, 33], ["+", 0, 1, 0, 27, 28, 69, 71, 16, 12, 13]] | 0 | 147 |
#include <bits/stdc++.h>
using namespace std;
int main(void) {
// Your code here!
int i, n;
map<int, int> m;
cin >> n;
int a[n - 1];
for (i = 0; i < n; i++) {
cin >> a[i];
m[a[i]]++;
}
for (i = 1; i <= n; i++)
cout << m[i] << '\n';
return 0;
} | #include <bits/stdc++.h>
using namespace std;
int main(void) {
// Your code here!
int i, n;
map<int, int> m;
cin >> n;
int a[n - 1];
for (i = 0; i < (n - 1); i++) {
cin >> a[i];
m[a[i]]++;
}
for (i = 1; i <= n; i++)
cout << m[i] << '\n';
return 0;
} | [["+", 8, 9, 0, 7, 15, 16, 12, 23, 0, 24], ["+", 0, 7, 15, 16, 12, 23, 0, 16, 17, 33], ["+", 0, 7, 15, 16, 12, 23, 0, 16, 12, 13], ["+", 8, 9, 0, 7, 15, 16, 12, 23, 0, 25]] | 1 | 97 |
#include <iostream>
#include <vector>
using namespace std;
int main() {
int n, temp;
cin >> n;
vector<int> ans(n, 0);
for (int i = 0; i < n; i++) {
cin >> temp;
ans[temp - 1]++;
}
for (auto i : ans) {
cout << i << endl;
}
} | #include <iostream>
#include <vector>
using namespace std;
int main() {
int n, temp;
cin >> n;
vector<int> ans(n, 0);
for (int i = 0; i < n - 1; i++) {
cin >> temp;
ans[temp - 1]++;
}
for (auto i : ans) {
cout << i << endl;
}
} | [["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 33], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]] | 1 | 77 |
#include <bits/stdc++.h>
using namespace std;
int a[200010];
int main() {
int n;
cin >> n;
int k;
for (int i = 1; i <= n; i++) {
cin >> k;
a[k]++;
}
for (int i = 1; i <= n; i++)
cout << a[i] << endl;
return 0;
} | #include <bits/stdc++.h>
using namespace std;
int a[200010];
int main() {
int n;
cin >> n;
int k;
for (int i = 1; i <= n - 1; i++) {
cin >> k;
a[k]++;
}
for (int i = 1; i <= n; i++)
cout << a[i] << endl;
return 0;
} | [["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 33], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]] | 1 | 80 |
#include <bits/stdc++.h>
using namespace std;
int main() {
long long N;
cin >> N;
vector<int> A(N);
vector<int> B(N, 0);
for (int i = 0; i < N; i++) {
cin >> A.at(i);
B.at(A.at(i) - 1) = B.at(A.at(i) - 1) + 1;
}
for (int i = 0; i < N; i++) {
cout << B.at(i) << endl;
}
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
long long N;
cin >> N;
vector<int> A(N - 1);
vector<int> B(N, 0);
for (int i = 0; i < N - 1; i++) {
cin >> A.at(i);
B.at(A.at(i) - 1) = B.at(A.at(i) - 1) + 1;
}
for (int i = 0; i < N; i++) {
cout << B.at(i) << endl;
}
}
| [["+", 0, 43, 49, 50, 51, 4, 0, 16, 17, 33], ["+", 0, 43, 49, 50, 51, 4, 0, 16, 12, 13], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 33], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]] | 1 | 122 |
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int n;
cin >> n;
vector<int> ans(n, 0);
int x;
while (cin >> x) {
ans[x - 1];
}
for (auto aa : a... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int n;
cin >> n;
vector<int> ans(n, 0);
int x;
while (cin >> x) {
++ans[x - 1];
}
for (auto aa :... | [["+", 0, 52, 8, 9, 0, 1, 0, 27, 17, 29]] | 1 | 99 |
#include <bits/stdc++.h>
#define x first
#define y second
#define pb push_back
#define eb emplace_back
#define all(a) (a).begin(), (a).end()
#define SZ(a) (int)(a).size()
#define FOR(i, a, b) for (int i = (a); i <= (b); ++i)
#define iFOR(i, a, b) for (int i = (a); i >= (b); --i)
#define make_unique(a) ... | #include <bits/stdc++.h>
#define x first
#define y second
#define pb push_back
#define eb emplace_back
#define all(a) (a).begin(), (a).end()
#define SZ(a) (int)(a).size()
#define FOR(i, a, b) for (int i = (a); i <= (b); ++i)
#define iFOR(i, a, b) for (int i = (a); i >= (b); --i)
#define make_unique(a) ... | [["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 44]] | 1 | 201 |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
#define rep(i, n) for (ll i = 0; i < n; ++i)
#define ocut cout
#define ouct cout
#define itn int
struct Union {
vector<ll> par;
Union(ll a) { par = vector<ll>(a, -1); }
ll find(ll a) {
if (par[a] < 0) {
... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
#define rep(i, n) for (ll i = 0; i < n; ++i)
#define ocut cout
#define ouct cout
#define itn int
struct Union {
vector<ll> par;
Union(ll a) { par = vector<ll>(a, -1); }
ll find(ll a) {
if (par[a] < 0) {
... | [["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 33], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]] | 1 | 325 |
import collections
n=int(input())
a=list(map(int,input().split()))
dic=collections.Counter(a)
for i in range(1,n):
if i in dic.keys():
print(dic[i])
else:
print(0) | import collections
n=int(input())
a=list(map(int,input().split()))
dic=collections.Counter(a)
for i in range(1,n+1):
if i in dic.keys():
print(dic[i])
else:
print(0) | [["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 67 |
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); ++i)
using ll = long long;
using P = pair<int, int>;
// int choose2(ll x){
// return x*(x-1)/2;}
const int INF = 1001001001;
int main() {
int N;
cin >> N;
vector<int> A(N);
vector<int> B(N, 0);
rep(i, N - 1) {
cin ... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); ++i)
using ll = long long;
using P = pair<int, int>;
// int choose2(ll x){
// return x*(x-1)/2;}
const int INF = 1001001001;
int main() {
int N;
cin >> N;
vector<int> A(N);
vector<int> B(N, 0);
rep(i, N - 1) {
cin ... | [["+", 0, 14, 8, 9, 0, 1, 0, 16, 17, 151], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22]] | 1 | 113 |
#include <iostream>
using namespace std;
int main() {
int N = 0;
int valueA = 0;
int A[1000000] = {0};
cin >> N;
for (int i = 0; i < N - 1; i++) {
cin >> valueA;
A[valueA - 1] = A[valueA - 1] + 1;
}
for (int i = 0; i < N; i++) {
cout << A[i];
}
return 0;
}
| #include <iostream>
using namespace std;
int main() {
int N = 0;
int valueA = 0;
int A[1000000] = {0};
cin >> N;
for (int i = 0; i < N - 1; i++) {
cin >> valueA;
A[valueA - 1] = A[valueA - 1] + 1;
}
for (int i = 0; i < N; i++) {
cout << A[i] << endl;
}
return 0;
}
| [["+", 0, 7, 8, 9, 0, 1, 0, 16, 17, 151], ["+", 0, 7, 8, 9, 0, 1, 0, 16, 12, 22]] | 1 | 100 |
package main
import (
"bufio"
"fmt"
"os"
)
func main(){
reader := bufio.NewReader(os.Stdin)
writer := bufio.NewWriter(os.Stdout)
defer writer.Flush()
var n int64;
fmt.Scan(&n);
nums:=make([]int64,n)
for i:=1;i<int(n);i++{
if i == int(n-1) {
fmt.Fscanf(reader, "%d\n", &nums[i])
} else {
f... | package main
import (
"bufio"
"fmt"
"os"
)
func main(){
reader := bufio.NewReader(os.Stdin)
writer := bufio.NewWriter(os.Stdout)
defer writer.Flush()
var n int64;
fmt.Scan(&n);
nums:=make([]int64,n)
for i:=1;i<int(n);i++{
if i == int(n-1) {
fmt.Fscanf(reader, "%d\n", &nums[i])
} else {
f... | [["-", 8, 196, 0, 1, 0, 2, 63, 438, 439, 22], ["-", 8, 196, 0, 1, 0, 2, 63, 438, 0, 131], ["-", 8, 196, 0, 1, 0, 2, 63, 438, 119, 120], ["-", 8, 196, 0, 1, 0, 2, 3, 4, 0, 24], ["-", 8, 196, 0, 1, 0, 2, 3, 4, 0, 22], ["-", 8, 196, 0, 1, 0, 2, 3, 4, 0, 25], ["-", 36, 36, 0, 434, 0, 435, 8, 196, 0, 165]] | 7 | 211 |
n = int(input())
data = input().split()
jousi = [int(s) for s in data]
buka = [0]*n
for i in jousi:
buka[i] += 1
for i in buka:
print(i)
| n = int(input())
data = input().split()
jousi = [int(s) for s in data]
buka = [0]*n
for i in jousi:
buka[i - 1] += 1
for i in buka:
print(i)
| [["+", 0, 1, 0, 677, 31, 206, 206, 657, 17, 33], ["+", 0, 1, 0, 677, 31, 206, 206, 657, 12, 612]] | 5 | 56 |
#include <bits/stdc++.h>
using namespace std;
int N;
vector<pair<int, int>> V(200200);
main() {
cin >> N;
for (int i = 0; i < N - 1; i++) {
int a;
cin >> a;
V[a + 1].second++;
}
for (int i = 0; i < N; i++)
cout << V[i].second << endl;
}
| #include <bits/stdc++.h>
using namespace std;
int N;
vector<pair<int, int>> V(200200);
main() {
cin >> N;
for (int i = 0; i < N - 1; i++) {
int a;
cin >> a;
V[a - 1].second++;
}
for (int i = 0; i < N; i++)
cout << V[i].second << endl;
}
| [["-", 28, 118, 28, 69, 341, 342, 0, 16, 17, 72], ["+", 28, 118, 28, 69, 341, 342, 0, 16, 17, 33]] | 1 | 92 |
#include <bits/stdc++.h>
#define ll long long
using namespace std;
int cnt[200010];
int main() {
int n;
for (int i = 0; i < n - 1; i++) {
int k;
cin >> k;
cnt[k]++;
}
for (int i = 1; i <= n; i++)
cout << cnt[i] << '\n';
} | #include <bits/stdc++.h>
#define ll long long
using namespace std;
int cnt[200010];
int main() {
int n;
cin >> n;
for (int i = 0; i < n - 1; i++) {
int k;
cin >> k;
cnt[k]++;
}
for (int i = 1; i <= n; i++)
cout << cnt[i] << '\n';
} | [["+", 0, 14, 8, 9, 0, 1, 0, 16, 31, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 17, 152], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]] | 1 | 80 |
N=int(input())
A=list(map(int,input().split()))
B=[0]*N
for i in range(N-1):
B[A[i-1]]+=1
for j in B[1:]:
print(j) | N=int(input())
A=list(map(int,input().split()))
B=[0]*N
for i in range(N-1):
B[A[i]-1]+=1
for j in B:
print(j)
| [["+", 0, 677, 31, 206, 206, 657, 31, 206, 0, 73], ["-", 8, 196, 0, 1, 0, 677, 31, 206, 0, 73], ["-", 36, 36, 0, 656, 0, 7, 12, 206, 0, 70], ["-", 0, 656, 0, 7, 12, 206, 206, 663, 0, 612], ["-", 0, 656, 0, 7, 12, 206, 206, 663, 0, 102], ["-", 36, 36, 0, 656, 0, 7, 12, 206, 0, 73]] | 5 | 66 |
n=int(input())
a=[0]*n
for i in input().split(" "):
a[int(i)-1]+=1
print(a)
| n=int(input())
a=[0]*n
for i in input().split(" "):
a[int(i)-1]+=1
for i in a:
print(i)
| [["+", 36, 36, 36, 36, 0, 656, 0, 7, 0, 88], ["+", 36, 36, 36, 36, 0, 656, 0, 7, 31, 22], ["+", 36, 36, 36, 36, 0, 656, 0, 7, 0, 267], ["+", 36, 36, 36, 36, 0, 656, 0, 7, 12, 22], ["+", 36, 36, 36, 36, 0, 656, 0, 7, 0, 102], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["+", 8, 196, 0, 1, 0, 652, 3, 4, 0, 22]] | 5 | 44 |
n=int(input())
s=list(map(int,input().split()))
k=[0]*n
for i in s:
k[i]+=1
for i in k:
print(k[0]) | n=int(input())
s=list(map(int,input().split()))
k=[0]*n
for i in s:
k[i-1]+=1
for i in k:
print(i) | [["+", 0, 1, 0, 677, 31, 206, 206, 657, 17, 33], ["+", 0, 1, 0, 677, 31, 206, 206, 657, 12, 612], ["-", 0, 1, 0, 652, 3, 4, 0, 206, 51, 22], ["-", 0, 1, 0, 652, 3, 4, 0, 206, 0, 70], ["-", 0, 1, 0, 652, 3, 4, 0, 206, 206, 612], ["-", 0, 1, 0, 652, 3, 4, 0, 206, 0, 73], ["+", 8, 196, 0, 1, 0, 652, 3, 4, 0, 22]] | 5 | 55 |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int a[200001];
int main() {
int n;
cin >> n;
for (int i = 1; i < n; i++) {
int b;
cin >> b;
a[b - 1]++;
}
for (int i = 0; i < n; i++)
cout << a[i];
return 0;
} | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int a[200001];
int main() {
int n;
cin >> n;
for (int i = 1; i < n; i++) {
int b;
cin >> b;
a[b - 1]++;
}
for (int i = 0; i < n; i++)
cout << a[i] << endl;
return 0;
} | [["+", 8, 9, 0, 7, 8, 1, 0, 16, 17, 151], ["+", 8, 9, 0, 7, 8, 1, 0, 16, 12, 22]] | 1 | 85 |
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int A[] = new int[N - 1];
int B[] = new int[N];
for (int j = 0; j < N; j++) {
B[j] = 0;
}
for (int i = 0; i < N; i++) {
A[i] = sc.nextInt(... | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int A[] = new int[N];
int B[] = new int[N];
for (int j = 0; j < N; j++) {
B[j] = 0;
}
for (int i = 0; i < N - 1; i++) {
A[i] = sc.nextInt(... | [["-", 49, 200, 51, 227, 497, 505, 0, 16, 17, 33], ["-", 49, 200, 51, 227, 497, 505, 0, 16, 12, 499], ["+", 8, 196, 0, 7, 15, 16, 12, 16, 17, 33], ["+", 8, 196, 0, 7, 15, 16, 12, 16, 12, 499]] | 3 | 168 |
#include <algorithm> //辞書順=next_permutation
#include <cmath>
#include <complex>
#include <iomanip>
#include <iostream>
#include <locale>
#include <math.h>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <stdio.h>
#include <string.h>
#include <string> //char 小文字のほうが32大きい
#include <time.h>
#... | #include <algorithm> //辞書順=next_permutation
#include <cmath>
#include <complex>
#include <iomanip>
#include <iostream>
#include <locale>
#include <math.h>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <stdio.h>
#include <string.h>
#include <string> //char 小文字のほうが32大きい
#include <time.h>
#... | [["+", 0, 27, 28, 69, 341, 342, 0, 16, 17, 33], ["+", 0, 27, 28, 69, 341, 342, 0, 16, 12, 13]] | 1 | 713 |
/*Stay true to yourself, yet always be open to learn. Work hard, and never give
up on your dreams, even when nobody else believes they can come true but you.
These are not cliches but real tools you need no matter what you do in life to
stay focused on your path.
*/
/*Pppppppp UU UU CCCCCCCC CCCCCCCC ... | /*Stay true to yourself, yet always be open to learn. Work hard, and never give
up on your dreams, even when nobody else believes they can come true but you.
These are not cliches but real tools you need no matter what you do in life to
stay focused on your path.
*/
/*Pppppppp UU UU CCCCCCCC CCCCCCCC ... | [["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 33], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13], ["+", 28, 69, 28, 2, 3, 4, 0, 16, 17, 33], ["+", 28, 69, 28, 2, 3, 4, 0, 16, 12, 13]] | 1 | 226 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.