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 |
|---|---|---|---|---|
N= int(input())
A=list(map(int,input().split()))
cnt=[0]*N
for i in range(1,N):
cnt[A[i-1]-1]=cnt[A[i-1]-1]+1
print(cnt) | N= int(input())
A=list(map(int,input().split()))
cnt=[0]*N
for i in range(1,N):
cnt[A[i-1]-1]=cnt[A[i-1]-1]+1
for c in cnt:
print(c) | [["+", 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 | 71 |
n = int(input())
dict = {}
for i in map(int, input().split(" ")):
dict[i] = dict.get(i, 0) + 1
for i in range(0, n + 1):
print(dict.get(i, 0)) | n = int(input())
dict = {}
for i in map(int, input().split(" ")):
dict[i] = dict.get(i, 0) + 1
for i in range(1, n + 1):
print(dict.get(i, 0)) | [["-", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612]] | 5 | 69 |
a=int(input())
b=[0]*a
c=list(map(int,input().split()))
for i in c:
b[i-0]+=1
print(*b,sep="\n") | a=int(input())
b=[0]*a
c=list(map(int,input().split()))
for i in c:
b[i-1]+=1
print(*b,sep="\n") | [["-", 0, 1, 0, 677, 31, 206, 206, 657, 12, 612], ["+", 0, 1, 0, 677, 31, 206, 206, 657, 12, 612]] | 5 | 56 |
import sys
input = sys.stdin.readline
n = int(input())
A = [int(a) for a in input().split()]
sub_list = [0] *n
for a in A:
sub_list[a] +=1
for i in range(n):
print(sub_list[i]) | import sys
input = sys.stdin.readline
n = int(input())
A = [int(a) for a in input().split()]
sub_list = [0] *n
for a in A:
sub_list[a-1] +=1
for i in range(n):
print(sub_list[i])
| [["+", 0, 1, 0, 677, 31, 206, 206, 657, 17, 33], ["+", 0, 1, 0, 677, 31, 206, 206, 657, 12, 612]] | 5 | 68 |
#include <iostream>
#include <set>
using namespace std;
int main() {
int n, a[200000];
cin >> n;
for (int i = 1; i < n; ++i)
cin >> a[i];
int num[200000] = {};
for (int i = 0; i < n; ++i)
num[a[i]]++;
for (int i = 0; i < n; ++i)
cout << num[i] << endl;
}
| #include <iostream>
#include <set>
using namespace std;
int main() {
int n, a[200000];
cin >> n;
for (int i = 1; i < n; ++i)
cin >> a[i];
int num[200000] = {};
for (int i = 1; i < n; ++i)
num[a[i] - 1]++;
for (int i = 0; i < n; ++i)
cout << num[i] << endl;
}
| [["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 0, 27, 28, 69, 341, 342, 0, 16, 17, 33], ["+", 0, 27, 28, 69, 341, 342, 0, 16, 12, 13]] | 1 | 102 |
n = int(input())
a = list(map(int, input().split()))
b = [0 for i in range(n)]
for i in range(n-1):
b[a[i]-1] += 1
for j in range(n-1):
print(b[j])
| n = int(input())
a = list(map(int, input().split()))
b = [0 for i in range(n)]
for i in range(n-1):
b[a[i]-1] += 1
for j in range(n):
print(b[j])
| [["-", 0, 7, 12, 652, 3, 4, 0, 657, 17, 33], ["-", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 75 |
#include <bits/stdc++.h>
using namespace std;
main() {
int N;
cin >> N;
vector<int> vec(N);
for (int i = 0; i < N; i++) {
int x;
cin >> x;
vec.at(x - 1) += 1;
}
for (int i = 0; i < N; i++)
cout << vec.at(i) << endl;
} | #include <bits/stdc++.h>
using namespace std;
main() {
int N;
cin >> N;
vector<int> vec(N);
for (int i = 0; i < N - 1; i++) {
int x;
cin >> x;
vec.at(x - 1) += 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 | 86 |
n = int(input())
a = list(map(int, input().split()))
b = [0]*n
for i in range(n-1):
b[a[i]] += 1
for e in b:
print(e) | n = int(input())
a = list(map(int, input().split()))
b = [0]*n
for i in range(n-1):
b[a[i]-1] += 1
for e in b:
print(e) | [["+", 0, 1, 0, 677, 31, 206, 206, 657, 17, 33], ["+", 0, 1, 0, 677, 31, 206, 206, 657, 12, 612]] | 5 | 60 |
n = int(input())
a = list(map(int,input().split()))
l = [0]*n
for i in range(n-1):
j = A[i]
l[j-1] += 1
for i in range(n):
print(l[i]) | n = int(input())
a = list(map(int,input().split()))
l = [0]*n
for i in range(n-1):
j = a[i]
l[j-1] += 1
for i in range(n):
print(l[i]) | [["-", 8, 196, 0, 1, 0, 662, 12, 206, 51, 22], ["+", 8, 196, 0, 1, 0, 662, 12, 206, 51, 22]] | 5 | 71 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int em;
cin >> em;
vector<int> data(em);
vector<int> num(em);
for (int i = 2; i <= em; i++) {
cin >> data.at(i - 1);
}
for (int i = 2; i <= em; i++) {
num.at(data.at(i - 1))++;
}
for (int i = 1; i <= em; i++) {
cout << num.at(... | #include <bits/stdc++.h>
using namespace std;
int main() {
int em;
cin >> em;
vector<int> data(em);
vector<int> num(em + 1);
for (int i = 2; i <= em; i++) {
cin >> data.at(i - 1);
}
for (int i = 2; i <= em; i++) {
num.at(data.at(i - 1))++;
}
for (int i = 1; i <= em; i++) {
cout << num... | [["+", 0, 43, 49, 50, 51, 4, 0, 16, 17, 72], ["+", 0, 43, 49, 50, 51, 4, 0, 16, 12, 13], ["-", 31, 16, 12, 2, 3, 4, 0, 16, 17, 33], ["-", 31, 16, 12, 2, 3, 4, 0, 16, 12, 13]] | 1 | 124 |
n = int(input())
a = [int(i) for i in input().split()]
ans = [0] * (n+1)
for i in a:
ans[i] += 1
[print(i) for i in ans] | n = int(input())
a = [int(i) for i in input().split()]
ans = [0] * (n)
for i in a:
ans[i-1] += 1
[print(i) for i in ans] | [["-", 0, 662, 12, 657, 12, 23, 0, 657, 17, 72], ["-", 0, 662, 12, 657, 12, 23, 0, 657, 12, 612], ["+", 0, 1, 0, 677, 31, 206, 206, 657, 17, 33], ["+", 0, 1, 0, 677, 31, 206, 206, 657, 12, 612]] | 5 | 58 |
n = int(input())
a = list(map(int,input().split()))
countlist = [0 for i in range(n)]
for j in range(n):
countlist[a[j]-1]+=1
for i in range(n):
print(countlist[i]) | n = int(input())
a = list(map(int,input().split()))
countlist = [0 for i in range(n)]
for j in range(n-1):
countlist[a[j]-1]+=1
for i in range(n):
print(countlist[i]) | [["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 33], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 71 |
#include <iostream>
using namespace std;
int main() {
int n, t;
cin >> n;
int *a = new int[n]();
for (int i = 0; i < n; i++) {
cin >> t;
a[t - 1]++;
}
for (int i = 0; i < n; i++) {
cout << a[i] << endl;
}
return 0;
}
| #include <iostream>
using namespace std;
int main() {
int n, t;
cin >> n;
int *a = new int[n]();
for (int i = 0; i < n - 1; i++) {
cin >> t;
a[t - 1]++;
}
for (int i = 0; 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 | 89 |
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(), (x).end()
int main() {
int n;
cin >> n;
vector<int> a(n);
for (int i = 1; i < n; i++) {
int t;
cin >> t;
t--;
a[i]++;
}
for (int i = 0; i < n... | #include <bits/stdc++.h>
using namespace std;
typedef long long LL;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(), (x).end()
int main() {
int n;
cin >> n;
vector<int> a(n);
for (int i = 1; i < n; i++) {
int t;
cin >> t;
t--;
a[t]++;
}
for (int i = 0; i < n... | [["-", 0, 1, 0, 27, 28, 69, 341, 342, 0, 22], ["+", 0, 1, 0, 27, 28, 69, 341, 342, 0, 22]] | 1 | 104 |
N = int(input())
As = list(map(int, input().split()))
ans = [0] * N
for i in As:
ans[i]+=1
for j in ans:
print(j) | N = int(input())
As = list(map(int, input().split()))
ans = [0] * N
for i in As:
ans[i-1]+=1
for j in ans:
print(j) | [["+", 0, 1, 0, 677, 31, 206, 206, 657, 17, 33], ["+", 0, 1, 0, 677, 31, 206, 206, 657, 12, 612]] | 5 | 52 |
#include <algorithm>
#include <iomanip>
#include <iostream>
#include <string>
#include <vector>
#define _USE_MATH_DEFINES
#include <math.h>
using namespace std;
int main() {
int N;
cin >> N;
vector<int> num(N, 0);
for (int i = 0; i < N - 1; ++i) {
int j;
cin >> j;
++num[j];
}
for (int i = 0;... | #include <algorithm>
#include <iomanip>
#include <iostream>
#include <string>
#include <vector>
#define _USE_MATH_DEFINES
#include <math.h>
using namespace std;
int main() {
int N;
cin >> N;
vector<int> num(N, 0);
for (int i = 0; i < N - 1; ++i) {
int j;
cin >> j;
++num[j - 1];
}
for (int i ... | [["+", 0, 27, 28, 69, 341, 342, 0, 16, 17, 33], ["+", 0, 27, 28, 69, 341, 342, 0, 16, 12, 13]] | 1 | 96 |
#include <iostream>
using namespace std;
int N;
int buka[200010];
int main() {
cin >> N;
int tmp;
for (int i = 0; i < N; ++i) {
buka[i] = 0;
}
for (int i = 0; i < N - 1; ++i) {
cin >> tmp;
buka[tmp]++;
}
for (int i = 0; i < N; ++i) {
cout << buka[i] << endl;
}
return 0;
} | #include <iostream>
using namespace std;
int N;
int buka[200010];
int main() {
cin >> N;
int tmp;
for (int i = 0; i < N; ++i) {
buka[i] = 0;
}
for (int i = 0; i < N - 1; ++i) {
cin >> tmp;
buka[tmp]++;
}
for (int i = 0; i < N; ++i) {
cout << buka[i + 1] << endl;
}
return 0;
} | [["+", 31, 16, 12, 69, 341, 342, 0, 16, 17, 72], ["+", 31, 16, 12, 69, 341, 342, 0, 16, 12, 13]] | 1 | 107 |
n = int(input())
line = list(map(int, input().strip().split(" ")))
ans = [0 for s in range(n)]
for i in line:
ans[i] += 1
for i in range(1, n):
print(ans[i])
| n = int(input())
line = list(map(int, input().strip().split(" ")))
ans = [0 for s in range(n)]
for i in line:
ans[i - 1] += 1
for i in range(n):
print(ans[i])
| [["+", 0, 1, 0, 677, 31, 206, 206, 657, 17, 33], ["+", 0, 1, 0, 677, 31, 206, 206, 657, 12, 612], ["-", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612], ["-", 0, 656, 0, 7, 12, 652, 3, 4, 0, 21]] | 5 | 72 |
#include <bits/stdc++.h>
#define ll long long
#define vi vector<int>
#define pb push_back
//#define int long long
#define boost \
ios_base::sync_with_stdio(false); \
cin.tie(0); ... | #include <bits/stdc++.h>
#define ll long long
#define vi vector<int>
#define pb push_back
//#define int long long
#define boost \
ios_base::sync_with_stdio(false); \
cin.tie(0); ... | [["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 33], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]] | 1 | 122 |
N = int(input())
A = input().split()
B = [0]*(N)
for i in range(0, len(A)):
A[i] = int(A[i])
B[A[i]-1] += 1
print(B)
| N = int(input())
A = input().split()
B = [0]*(N)
for i in range(0, len(A)):
A[i] = int(A[i])
B[A[i]-1] += 1
for i in B:
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 | 66 |
/**
* C - management
* https://atcoder.jp/contests/abc163/tasks/abc163_c
*/
#include <bits/stdc++.h>
using namespace std;
int main() {
// N 人の社員からなる会社があり、各社員には 1,...,N
// の社員番号が割り当てられています。
int N, A;
cin >> N;
// 部下の人数を保存する配列
vector<int> buka(N, 0);
for (int i = 0; i < N - 1; i++) {
// i人目の上司番号がAに... | /**
* C - management
* https://atcoder.jp/contests/abc163/tasks/abc163_c
*/
#include <bits/stdc++.h>
using namespace std;
int main() {
// N 人の社員からなる会社があり、各社員には 1,...,N
// の社員番号が割り当てられています。
int N, A;
cin >> N;
// 部下の人数を保存する配列
vector<int> buka(N, 0);
for (int i = 0; i < N - 1; i++) {
// i人目の上司番号がAに... | [["+", 0, 11, 31, 2, 3, 4, 0, 16, 17, 33], ["+", 0, 11, 31, 2, 3, 4, 0, 16, 12, 13]] | 1 | 95 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
vector<int> count(n + 1, 0);
for (int i = 0; i < n; i++) {
int x;
cin >> x;
count[x]++;
}
for (int i = 1; i <= n; i++)
cout << count[i] << endl;
return 0;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
vector<int> count(n + 1, 0);
for (int i = 0; i < n - 1; i++) {
int x;
cin >> x;
count[x]++;
}
for (int i = 1; i <= n; i++)
cout << count[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 | 87 |
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio();
cin.tie(0);
int n;
cin >> n;
int a[n - 1];
int i;
int b[n + 1];
memset(b, 0, sizeof(b));
for (i = 0; i < n - 1; i++) {
cin >> a[i];
b[a[i]]++;
}
for (i = 1; i <= n + 1; i++) {
cout << b[i] << "\n";
}
... | #include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio();
cin.tie(0);
long long int n;
cin >> n;
long long int a[n - 1];
int i;
int b[n + 1];
memset(b, 0, sizeof(b));
for (i = 0; i < n - 1; i++) {
cin >> a[i];
b[a[i]]++;
}
for (i = 1; i <= n; i++) {
cout << b[i... | [["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["-", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["-", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]] | 1 | 127 |
#include <cstdio>
using namespace std;
int main() {
int n;
int t;
int boss[200001] = {0};
scanf("%d", &n);
for (int i = 0; i < n; i++) {
scanf("%d", &t);
boss[t]++;
}
for (int i = 1; i <= n; i++) {
printf("%d\n", boss[i]);
}
return 0;
} | #include <cstdio>
using namespace std;
int main() {
int n;
int t;
int boss[200001] = {0};
scanf("%d", &n);
for (int i = 1; i < n; i++) {
scanf("%d", &t);
boss[t]++;
}
for (int i = 1; i <= n; i++) {
printf("%d\n", boss[i]);
}
return 0;
}
| [["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]] | 1 | 102 |
EN = input().split()
Bc = [0] * int(EN[0])
tmp = input().split()
BossN = [int(s) for s in tmp]
for i in tmp:
Bc[i-1] = Bc[i-1] + 1
print(*Bc,sep='\n') | EN = input().split()
Bc = [0] * int(EN[0])
tmp = input().split()
BossN = [int(s) for s in tmp]
for i in BossN:
Bc[i-1] = Bc[i-1] + 1
print(*Bc,sep='\n') | [["-", 36, 36, 36, 36, 0, 656, 0, 7, 12, 22], ["+", 36, 36, 36, 36, 0, 656, 0, 7, 12, 22]] | 5 | 74 |
n = int(input())
a = input().split()
ans = [0] * n
for i in range(n-1):
ans[int(a[i])-1] +=1
print(ans)
| n = int(input())
a = input().split()
ans = [0] * n
for i in range(n-1):
ans[int(a[i])-1] +=1
for i in ans:
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 | 52 |
#include <bits/stdc++.h>
using namespace std;
int main() {
long long n;
cin >> n;
vector<int> a(n - 1), b(n);
for (long long i = 0; i < n; i++) {
cin >> a.at(i);
b.at(a.at(i))++;
}
for (long long i = 0; i < n; i++) {
cout << b.at(i) << endl;
}
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
long long n;
cin >> n;
vector<int> a(n - 1), b(n);
for (long long i = 0; i < n - 1; i++) {
cin >> a.at(i);
b.at(a.at(i) - 1)++;
}
for (long long i = 0; i < n; i++) {
cout << b.at(i) << endl;
}
return 0;
}
| [["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 33], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13], ["+", 0, 27, 28, 2, 3, 4, 0, 16, 17, 33], ["+", 0, 27, 28, 2, 3, 4, 0, 16, 12, 13]] | 1 | 106 |
#include <bits/stdc++.h>
using namespace std;
void solve() {
int x, y;
cin >> x;
vector<int> v(x, 0);
for (int i = 1; i < x; i++) {
cin >> y;
v[y]++;
}
for (int i = 1; i <= x; i++) {
cout << v[i] << "\n";
}
}
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
solve();... | #include <bits/stdc++.h>
using namespace std;
void solve() {
int x, y;
cin >> x;
vector<int> v(x + 1, 0);
for (int i = 1; i < x; i++) {
cin >> y;
v[y]++;
}
for (int i = 1; i <= x; i++) {
cout << v[i] << "\n";
}
}
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
solv... | [["+", 0, 43, 49, 50, 51, 4, 0, 16, 17, 72], ["+", 0, 43, 49, 50, 51, 4, 0, 16, 12, 13]] | 1 | 119 |
#include <stdio.h>
int a[200010];
int ans[200010];
int main(void) {
int n;
scanf("%d", &n);
for (int i = 2; i <= n; i++) {
scanf("%d", &a[i]);
}
for (int i = 2; i <= n; i++) {
ans[a[i]]++;
}
for (int i = 2; i <= n; i++) {
printf("%d\n", ans[i]);
}
return 0;
} | #include <stdio.h>
int a[200010];
int ans[200010];
int main(void) {
int n;
scanf("%d", &n);
for (int i = 2; i <= n; i++) {
scanf("%d", &a[i]);
}
for (int i = 2; i <= n; i++) {
ans[a[i]]++;
}
for (int i = 1; i <= n; i++) {
printf("%d\n", ans[i]);
}
return 0;
} | [["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]] | 0 | 120 |
N = int(input())
Alist = list(map(int,input().split()))#iの上司
result = [0]*N
for i in range(N-1):#最後の社員に部下いない
result[Alist[i]-1] +=1#上司の順番の要素に+1
print(result)
for i in range(N):
print(result[i]) |
N = int(input())
Alist = list(map(int,input().split()))#iの上司
result = [0]*N
for i in range(N-1):#最後の社員に部下いない
result[Alist[i]-1] +=1#上司の順番の要素に+1
for i in range(N):
print(result[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 <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int a[n];
for (int i = 0; i < n; i++) {
a[i] = 0;
}
for (int i = 0; i < n - 1; i++) {
int l;
cin >> l;
a[l - 1]++;
}
for (int i = 0; i < n - 1; i++) {
cout << a[i] << endl;
}
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int a[n];
for (int i = 0; i < n; i++) {
a[i] = 0;
}
for (int i = 0; i < n - 1; i++) {
int l;
cin >> l;
a[l - 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 | 108 |
import collections
N = int(input())
A = list(map(int,input().split()))
a = Collections.Counter(A)
for i in range(N):
print(a[i]) | import collections
N = int(input())
A = list(map(int,input().split()))
a = collections.Counter(A)
for i in range(N):
print(a[i+1]) | [["-", 0, 1, 0, 662, 12, 652, 63, 319, 500, 22], ["+", 0, 1, 0, 662, 12, 652, 63, 319, 500, 22], ["+", 0, 652, 3, 4, 0, 206, 206, 657, 17, 72], ["+", 0, 652, 3, 4, 0, 206, 206, 657, 12, 612]] | 5 | 50 |
#include "bits/stdc++.h"
using namespace std;
int main() {
int N;
cin >> N;
map<int, int> val;
for (int x = 1; x < N; x++) {
int z;
cin >> z;
val[z]++;
}
for (int x = 1; x < N; x++) {
cout << val[x] << endl;
}
}
| #include "bits/stdc++.h"
using namespace std;
int main() {
int N;
cin >> N;
map<int, int> val;
for (int x = 1; x < N; x++) {
int z;
cin >> z;
val[z]++;
}
for (int x = 1; x <= N; x++) {
cout << val[x] << endl;
}
}
| [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 1 | 83 |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
int n = s.nextInt();
int a[] = new int[n];
for (int i = 0; i < n; i++) {
a[i] = 0;
}
for (int i = 0; i < n - 1; i++) {
a[s.nextInt()]++;
}
for (int i :... | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
int n = s.nextInt();
int a[] = new int[n];
for (int i = 0; i < a.length; i++) {
a[i] = 0;
}
for (int i = 0; i < n - 1; i++) {
a[s.nextInt() - 1]++;
}
f... | [["-", 0, 195, 8, 196, 0, 7, 15, 16, 12, 22], ["+", 8, 196, 0, 7, 15, 16, 12, 509, 500, 22], ["+", 8, 196, 0, 7, 15, 16, 12, 509, 0, 131], ["+", 8, 196, 0, 7, 15, 16, 12, 509, 119, 22], ["+", 0, 1, 0, 27, 0, 504, 71, 16, 17, 33], ["+", 0, 1, 0, 27, 0, 504, 71, 16, 12, 499]] | 3 | 124 |
def main():
N = int( input())
A = list( map( int, input().split()))
B = [0]*(N)
for a in A:
B[a-1] += 1
print(B)
print("\n".join( map( str, B)))
if __name__ == '__main__':
main()
| def main():
N = int( input())
A = list( map( int, input().split()))
B = [0]*(N)
for a in A:
B[a-1] += 1
print("\n".join( map( str, B)))
if __name__ == '__main__':
main()
| [["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 25], ["-", 0, 14, 8, 196, 0, 1, 0, 652, 63, 22], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 24]] | 5 | 82 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int a, d[200001];
cin >> a;
for (int i = 0; i < a - 2; i++) {
int c;
cin >> c;
d[c - 1]++;
}
for (int i = 0; i < a; i++)
if (d[i] != 0)
cout << d[i] << endl;
else
cout << 0 << endl;
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
int a, d[200001]{0};
cin >> a;
for (int i = 0; i < a - 1; i++) {
int c;
cin >> c;
d[c - 1]++;
}
for (int i = 0; i < a; i++)
if (d[i] != 0)
cout << d[i] << endl;
else
cout << 0 << endl;
return 0;
}
| [["+", 8, 9, 0, 43, 49, 50, 51, 83, 0, 45], ["+", 8, 9, 0, 43, 49, 50, 51, 83, 0, 13], ["+", 8, 9, 0, 43, 49, 50, 51, 83, 0, 46], ["-", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]] | 1 | 99 |
n = int(input())
a_list = map(int, input().split())
nl = [0] * n
for a in a_list:
nl[a] += 1
for v in nl:
print("{}".format(v)) | n = int(input())
a_list = map(int, input().split())
nl = [0] * n
for a in a_list:
nl[a-1] += 1
for v in nl:
print("{}".format(v)) | [["+", 0, 1, 0, 677, 31, 206, 206, 657, 17, 33], ["+", 0, 1, 0, 677, 31, 206, 206, 657, 12, 612]] | 5 | 56 |
n = int(input())
a_list = [int(i) for i in input().split()]
nl = [0 for i in range(n)]
print(nl)
for a in a_list:
nl[a-1] += 1
for i in nl:
print("{}".format(i)) | n = int(input())
a_list = [int(i) for i in input().split()]
nl = [0 for i in range(n)]
for a in a_list:
nl[a-1] += 1
for i in nl:
print("{}".format(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 | 71 |
N = int(input())
X = [0]*N
A = list(map(int,input().split()))
for i in A:
X[i] +=1
print(*X,sep="\n") | N = int(input())
X = [0]*N
A = list(map(int,input().split()))
for i in A:
X[i-1] +=1
print(*X,sep="\n") | [["+", 0, 1, 0, 677, 31, 206, 206, 657, 17, 33], ["+", 0, 1, 0, 677, 31, 206, 206, 657, 12, 612]] | 5 | 54 |
#include <bits/stdc++.h>
using namespace std;
const double pi = atan(1.0) * 4;
int main() {
int n;
cin >> n;
int a[n + 1];
for (int i = 2, x; i <= n; i++)
cin >> x, a[x]++;
for (int i = 1; i <= n; i++)
printf("%d\n", a[i]);
} | #include <bits/stdc++.h>
using namespace std;
const double pi = atan(1.0) * 4;
int main() {
int n;
cin >> n;
int a[n + 1] = {};
for (int i = 2, x; i <= n; i++)
cin >> x, a[x]++;
for (int i = 1; i <= n; i++)
printf("%d\n", a[i]);
} | [["+", 0, 14, 8, 9, 0, 43, 49, 50, 0, 32], ["+", 8, 9, 0, 43, 49, 50, 51, 83, 0, 45], ["+", 8, 9, 0, 43, 49, 50, 51, 83, 0, 46]] | 1 | 91 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
vector<int> A(N, 0);
int loop, Num;
for (loop = 0; loop < N; loop++) {
cin >> Num;
A[Num - 1] += 1;
}
for (loop = 0; loop < N; loop++) {
cout << A[loop] << endl;
}
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
vector<int> A(N, 0);
int loop, Num;
for (loop = 0; loop < N - 1; loop++) {
cin >> Num;
A[Num - 1]++;
}
for (loop = 0; loop < N; loop++) {
cout << A[loop] << endl;
}
return 0;
}
| [["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 33], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13], ["-", 0, 7, 8, 9, 0, 1, 0, 11, 17, 107], ["-", 0, 7, 8, 9, 0, 1, 0, 11, 12, 13], ["+", 0, 7, 8, 9, 0, 1, 0, 27, 17, 29]] | 1 | 90 |
// Sky's the limit :)
#include <bits/stdc++.h>
using namespace std;
#define int long long
signed main() {
// int t; cin >> t; while(t--)
{
int n;
cin >> n;
int ans[n] = {};
for (int i = 0; i < n; i++) {
int x;
cin >> x;
ans[x]++;
}
for (int i = 1; i < n; i++)
cout ... | // Sky's the limit :)
#include <bits/stdc++.h>
using namespace std;
#define int long long
signed main() {
// int t; cin >> t; while(t--)
{
int n;
cin >> n;
int ans[n] = {};
for (int i = 0; i < n - 1; i++) {
int x;
cin >> x;
ans[x - 1]++;
}
for (int i = 0; i < n; i++)
... | [["+", 0, 9, 0, 7, 15, 16, 12, 16, 17, 33], ["+", 0, 9, 0, 7, 15, 16, 12, 16, 12, 13], ["+", 0, 27, 28, 69, 341, 342, 0, 16, 17, 33], ["+", 0, 27, 28, 69, 341, 342, 0, 16, 12, 13], ["-", 0, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 0, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["-", 0, 7, 8, 1, 0, 16, 12, 103, 0, 125], ["+", 0, 7... | 1 | 92 |
#include <iostream>
#include <vector>
int main() {
int n_persons;
std::cin >> n_persons;
std::vector<std::size_t> n_of_bukas(n_persons);
for (std::size_t i = 0; i < n_persons - 1; ++i) {
int josi;
std::cin >> josi;
++n_of_bukas[josi];
}
for (auto &&n_buka : n_of_bukas) {
std::cout << n_buk... | #include <iostream>
#include <vector>
int main() {
int n_persons;
std::cin >> n_persons;
std::vector<std::size_t> n_of_bukas(n_persons);
for (std::size_t i = 0; i < n_persons - 1; ++i) {
int josi;
std::cin >> josi;
++n_of_bukas[--josi];
}
for (auto &&n_buka : n_of_bukas) {
std::cout << n_b... | [["+", 0, 27, 28, 69, 341, 342, 0, 27, 17, 68]] | 1 | 87 |
#include <algorithm>
#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define all(x) (x).begin(), (x).end()
#define PB(x) push_back(x)
#define MP(x, y) make_pair(x, y)
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
int main() {
int n;
cin >> n;
... | #include <algorithm>
#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define all(x) (x).begin(), (x).end()
#define PB(x) push_back(x)
#define MP(x, y) make_pair(x, y)
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
int main() {
int n;
cin >> n;
... | [["+", 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], ["+", 0, 27, 28, 69, 341, 342, 0, 23, 0, 24], ["+", 0, 27, 28, 69, 341, 342, 0, 23, 0, 25], ["-", 8, 9, 0, 1, 0, 16, 12, 103, 0, 104], ["+", 8, 9, 0, 1, 0, 16, 12, 5, 0, 62]] | 1 | 153 |
#include <iostream>
using namespace std;
int main() {
int num;
cin >> num;
int a[num - 1];
for (int i = 0; i < num - 1; i++) {
cin >> a[i];
}
int b[num];
for (int i = 0; i < num - 1; i++) {
int x = a[i];
b[x - 1] = b[x - 1] + 1;
}
for (int i = 0; i < num; i++) {
cout << b[i] << endl;
... | #include <iostream>
using namespace std;
int main() {
int num;
cin >> num;
int a[num - 1];
for (int i = 0; i < num - 1; i++) {
cin >> a[i];
}
int b[num] = {};
for (int i = 0; i < num - 1; i++) {
int x = a[i];
b[x - 1] = b[x - 1] + 1;
}
for (int i = 0; i < num; i++) {
cout << b[i] << en... | [["+", 0, 14, 8, 9, 0, 43, 49, 50, 0, 32], ["+", 8, 9, 0, 43, 49, 50, 51, 83, 0, 45], ["+", 8, 9, 0, 43, 49, 50, 51, 83, 0, 46]] | 1 | 128 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
vector<int> a(n);
vector<int> ans(n);
for (int i = 2; i <= n; i++)
cin >> a[i];
for (int i = 2; i <= n; i++)
ans[a[i]]++;
for (int i = 1; i <= n; i++)
cout << ans[i] << endl;
return 0;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
vector<int> a(200010);
vector<int> ans(200010);
for (int i = 2; i <= n; i++)
cin >> a[i];
for (int i = 2; i <= n; i++)
ans[a[i]]++;
for (int i = 1; i <= n; i++)
cout << ans[i] << endl;
return 0;
} | [["-", 0, 43, 49, 53, 54, 55, 0, 56, 39, 78], ["+", 8, 9, 0, 43, 49, 50, 51, 4, 0, 13]] | 1 | 107 |
#include <iostream>
using namespace std;
int main() {
int n;
int *p;
cin >> n;
p = new int(n);
for (int i = 0; i < n; i++)
p[i] = 0;
for (int i = 0; i < n - 1; i++) {
int data;
cin >> data;
p[data - 1]++;
}
for (int i = 0; i < n; i++)
cout << p[i] << endl;
delete[] p;
ret... | #include <iostream>
using namespace std;
int main() {
int n;
int *p;
cin >> n;
p = new int[n];
for (int i = 0; i < n; i++)
p[i] = 0;
for (int i = 0; i < n - 1; i++) {
int data;
cin >> data;
p[data - 1]++;
}
for (int i = 0; i < n; i++)
cout << p[i] << endl;
delete[] p;
ret... | [["-", 0, 1, 0, 11, 12, 350, 3, 4, 0, 24], ["+", 0, 1, 0, 11, 12, 350, 49, 367, 0, 70], ["-", 0, 1, 0, 11, 12, 350, 3, 4, 0, 25], ["+", 0, 1, 0, 11, 12, 350, 49, 367, 0, 73]] | 1 | 116 |
n = int(input())
a = list(map(int, input().split()))
sorted(a)
length=len(a)
previous=1
count=0
for j in a+[n+1]:
if j==previous:
count+=1
else:
print(count)
count=1
for _ in range(j-previous-1):
print(0)
previous=j | n = int(input())
a = list(map(int, input().split()))
a=sorted(a)
length=len(a)
previous=1
count=0
for j in a+[n+1]:
if j==previous:
count+=1
else:
print(count)
count=1
for _ in range(j-previous-1):
print(0)
previous=j | [["+", 36, 36, 0, 656, 0, 1, 0, 662, 31, 22], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 0, 32]] | 5 | 88 |
n = int(input())
a = list(map(int, input().split()))
import Counter
x=Counter(a)
for i in range(1,n+1):
print(a[x]) | n = int(input())
a = list(map(int, input().split()))
from collections import Counter
x=Counter(a)
for i in range(1,n+1):
print(x[i]) | [["+", 36, 36, 36, 36, 0, 656, 0, 686, 0, 314], ["+", 36, 36, 0, 656, 0, 686, 687, 673, 0, 22], ["-", 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, 0, 70], ["+", 0, 1, 0, 652, 3, 4, 0, 206, 206, 22]] | 5 | 52 |
N = int(input())
A = list(map(int, input().split()))
c = [0 for _ in range(N+1)]
for i in A:
c[i-1] += 1
for i in c:
print(i) | N = int(input())
A = list(map(int, input().split()))
c = [0 for _ in range(N)]
for i in A:
c[i-1] += 1
for i in c:
print(i) | [["-", 0, 659, 12, 652, 3, 4, 0, 657, 17, 72], ["-", 0, 659, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 61 |
n=int(input())
a=list(map(int,input().split()))
buka=[0]*n
for i in a:
buka[i]=buka[i]+1
for i in buka:
print(i) | n=int(input())
a=list(map(int,input().split()))
buka=[0]*n
for i in a:
buka[i-1]=buka[i-1]+1
for i in buka:
print(i) | [["+", 0, 1, 0, 662, 31, 206, 206, 657, 17, 33], ["+", 0, 1, 0, 662, 31, 206, 206, 657, 12, 612], ["+", 0, 662, 12, 657, 31, 206, 206, 657, 17, 33], ["+", 0, 662, 12, 657, 31, 206, 206, 657, 12, 612]] | 5 | 57 |
from collections import Counter
n = int(input())
A = list(map(int, input().split()))
c = Counter(A)
for i in range(1, n):
if i in c.keys():
print(c[i])
else:
print(0) | from collections import Counter
n = int(input())
A = list(map(int, input().split()))
c = Counter(A)
for i in range(1, n + 1):
if i in c.keys():
print(c[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;
int main() {
int N;
cin >> N;
vector<int> bukas(N, 0);
int jyoushi;
for (int i = 0; i < N - 1; i++) {
cin >> jyoushi;
bukas.at(jyoushi)++;
}
for (int i = 0; i < N; i++) {
cout << bukas.at(i) << endl;
}
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
vector<int> bukas(N, 0);
int jyoushi;
for (int i = 0; i < N - 1; i++) {
cin >> jyoushi;
bukas.at(jyoushi - 1)++;
}
for (int i = 0; i < N; i++) {
cout << bukas.at(i) << endl;
}
return 0;
}
| [["+", 0, 27, 28, 2, 3, 4, 0, 16, 17, 33], ["+", 0, 27, 28, 2, 3, 4, 0, 16, 12, 13]] | 1 | 93 |
n=int(input())
a=[int(0)]*n
l=list(map(int,input().split()))
for i in range(n-1):
a[l[i]] = a[l[i]] + 1
for i in range(n):
print(a[i]) | n=int(input())
a=[int(0)]*n
l=list(map(int,input().split()))
for i in range(n-1):
a[l[i]-1] = a[l[i]-1] + 1
for i in range(n):
print(a[i])
| [["+", 0, 1, 0, 662, 31, 206, 206, 657, 17, 33], ["+", 0, 1, 0, 662, 31, 206, 206, 657, 12, 612], ["+", 0, 662, 12, 657, 31, 206, 206, 657, 17, 33], ["+", 0, 662, 12, 657, 31, 206, 206, 657, 12, 612]] | 5 | 77 |
N = int(input())
counter = [0] * N
As = map(int, input().split())
for A in As:
counter[A] += 1
for c in counter:
print(c) | N = int(input())
counter = [0] * N
As = map(int, input().split())
for A in As:
counter[A-1] += 1
for c in counter:
print(c)
| [["+", 0, 1, 0, 677, 31, 206, 206, 657, 17, 33], ["+", 0, 1, 0, 677, 31, 206, 206, 657, 12, 612]] | 5 | 49 |
// She is Pretty pretty!
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ff first
#define ss second
#define mp make_pair
#define pb push_back
const int N = 1e6 + 100;
int n, a[N];
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
cin >> n;
for (int i = 0; i < n; ... | // She is Pretty pretty!
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ff first
#define ss second
#define mp make_pair
#define pb push_back
const int N = 1e6 + 100;
int n, a[N];
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
cin >> n;
for (int i = 0; i < n -... | [["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 33], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]] | 1 | 126 |
#include <stdio.h>
int main(void) {
int num;
scanf("%d", &num);
int work[num];
int i;
for (i = 0; i < num; ++i) {
work[i] = 0;
}
for (i = 0; i < num; ++i) {
int ptr;
scanf("%d", &ptr);
work[ptr - 1] = work[ptr - 1] + 1;
}
for (i = 0; i < num; ++i) {
if (i < num - 1) {
printf... | #include <stdio.h>
int main(void) {
int num;
scanf("%d", &num);
int work[num];
int i;
for (i = 0; i < num; ++i) {
work[i] = 0;
}
for (i = 1; i < num; ++i) {
int ptr;
scanf("%d", &ptr);
work[ptr - 1] = work[ptr - 1] + 1;
}
for (i = 0; i < num; ++i) {
if (i < num - 1) {
printf... | [["-", 0, 14, 8, 9, 0, 7, 10, 11, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 10, 11, 12, 13]] | 0 | 153 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
int A[N], B[N];
for (int i = 0; i <= N; i++) {
B[i] = 0;
}
for (int i = 2; i <= N; i++) {
cin >> A[i];
B[A[i]]++;
}
for (int i = 0; i <= N; i++) {
cout << B[i] << endl;
}
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
int A[N], B[N];
for (int i = 0; i < N; i++) {
B[i] = 0;
}
for (int i = 1; i < N; i++) {
cin >> A[i];
B[A[i] - 1]++;
}
for (int i = 0; i < N; i++) {
cout << B[i] << endl;
}
}
| [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 0, 27, 28, 69, 341, 342, 0, 16, 17, 33], ["+", 0, 27, 28, 69, 341, 342, 0, 16, 12, 13]] | 1 | 110 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
int A[N], B[N];
for (int i = 0; i <= N; i++) {
B[i] = 0;
}
for (int i = 2; i <= N; i++) {
cin >> A[i];
B[A[i] - 1]++;
}
for (int i = 0; i <= N; i++) {
cout << B[i] << endl;
}
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
int A[N], B[N];
for (int i = 0; i < N; i++) {
B[i] = 0;
}
for (int i = 1; i < N; i++) {
cin >> A[i];
B[A[i] -= 1]++;
}
for (int i = 0; i < N; i++) {
cout << B[i] << endl;
}
}
| [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["-", 0, 27, 28, 69, 341, 342, 0, 16, 17, 33], ["+", 0, 27, 28, 69, 341, 342, 0, 11, 17, 110]] | 1 | 112 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
int A[N], B[N];
for (int i = 0; i < N; i++) {
B[i] = 0;
}
for (int i = 0; i < N; i++) {
cin >> A[i];
B[A[i]]++;
}
for (int i = 0; i < N; i++) {
cout << B[i] << endl;
}
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
int A[N], B[N];
for (int i = 0; i < N + 1; i++) {
B[i] = 0;
}
for (int i = 2; i <= N; i++) {
cin >> A[i];
B[A[i]]++;
}
for (int i = 0; i < N; i++) {
cout << B[i + 1] << endl;
}
}
| [["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 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], ["+", 31, 16, 12, 69, 341, 342, 0, 16, 17, 72], ["+", 31, 16, 1... | 1 | 110 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
int A[N], B[N];
for (int i = 0; i < N; i++) {
B[i + 1] = 0;
}
for (int i = 0; i < N; i++) {
cin >> A[i + 1];
B[A[i + 1]]++;
}
for (int i = 0; i < N; i++) {
cout << B[i + 1] << endl;
}
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
int A[N], B[N];
for (int i = 0; i < N; i++) {
B[i + 1] = 0;
}
for (int i = 2; i <= N; i++) {
cin >> A[i];
B[A[i]]++;
}
for (int i = 0; i < N; i++) {
cout << B[i + 1] << endl;
}
}
| [["-", 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], ["-", 0, 16, 12, 69, 341, 342, 0, 16, 17, 72], ["-", 0, 16, 12, 69, 341, 342, 0, 16, 12, 13], ["-", 341, 342, 0, 69, 341, 342, 0, 16, 17, 72], ["-", ... | 1 | 118 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
int A[N], B[N];
for (int i = 0; i < N; i++) {
B[i] = 0;
}
for (int i = 0; i < N; i++) {
cin >> A[i];
B[A[i]]++;
}
for (int i = 0; i < N; i++) {
cout << B[i] << endl;
}
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
int A[N], B[N];
for (int i = 0; i < N; i++) {
B[i + 1] = 0;
}
for (int i = 2; i <= N; i++) {
cin >> A[i];
B[A[i]]++;
}
for (int i = 1; i <= N; i++) {
cout << B[i] << endl;
}
}
| [["+", 0, 11, 31, 69, 341, 342, 0, 16, 17, 72], ["+", 0, 11, 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], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 1 | 110 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
int A[N], B[N];
for (int i = 1; i < N; i++) {
B[i] = 0;
}
for (int i = 1; i < N; i++) {
cin >> A[i];
B[A[i]]++;
}
for (int i = 1; i < N; i++) {
cout << B[i] << endl;
}
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
int A[N], B[N];
for (int i = 1; i <= N; i++) {
B[i] = 0;
}
for (int i = 2; i <= N; i++) {
cin >> A[i];
B[A[i]]++;
}
for (int i = 1; i <= N; i++) {
cout << B[i] << endl;
}
}
| [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19], ["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]] | 1 | 110 |
import numpy as np
n = int(input())
a = np.array(input().split(),dtype=int)
buka = [0 for i in range(n)]
for i in a:
buka[i] += 1
for i in buka:
print(i)
| import numpy as np
n = int(input())
a = np.array(input().split(),dtype=int)
buka = [0 for i in range(n)]
for i in a:
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 | 62 |
/*********বিসমিল্লাহির রাহমানির রাহিম**********/
#include <bits/stdc++.h>
#define ll long long
#define PI 2 * acos(0)
#define FAST ios::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define MAX 200000
#define MOD 1e7
#define all(x) (x).begin(), (x).end()
using namespace std;
/*................OMI.................*/
vec... | /*********বিসমিল্লাহির রাহমানির রাহিম**********/
#include <bits/stdc++.h>
#define ll long long
#define PI 2 * acos(0)
#define FAST ios::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define MAX 200000
#define MOD 1e7
#define all(x) (x).begin(), (x).end()
using namespace std;
/*................OMI.................*/
vec... | [["+", 0, 43, 49, 50, 49, 80, 81, 16, 17, 72], ["+", 0, 43, 49, 50, 49, 80, 81, 16, 12, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 1 | 386 |
#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1);
int main() {
int n;
cin >> n;
int cnt[n + 1];
memset(cnt, 0, sizeof(cnt));
for (int i = 0; i < n - 1; i++) {
int x;
cin >> x;
x--;
cnt[x]++;
}
for (int i = 0; i <= n; i++)
cout << cnt[i] << '\n';
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1);
int main() {
int n;
cin >> n;
int cnt[n + 1];
memset(cnt, 0, sizeof(cnt));
for (int i = 0; i < n - 1; i++) {
int x;
cin >> x;
x--;
cnt[x]++;
}
for (int i = 0; i < n; i++)
cout << cnt[i] << '\n';
return 0;
}
| [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18]] | 1 | 110 |
// omajinai c++ atcoder
#include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <cstdint>
#include <cstdio>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <type_traits>
#includ... | // omajinai c++ atcoder
#include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <cstdint>
#include <cstdio>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <type_traits>
#includ... | [["+", 0, 14, 8, 9, 0, 1, 0, 16, 17, 151], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22]] | 1 | 146 |
#include <bits/stdc++.h>
#define ll long long
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
ll n;
cin >> n;
ll a[n];
ll f[n + 1] = {0};
for (int i = 1; i < n; i++) {
cin >> a[i];
f[a[i]] += 1;
}
for (int i = 1; i <= n; i++) {
cout << f[i];
}
} | #include <bits/stdc++.h>
#define ll long long
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
ll n;
cin >> n;
ll a[n];
ll f[n + 1] = {0};
for (int i = 1; i < n; i++) {
cin >> a[i];
f[a[i]] += 1;
}
for (int i = 1; i <= n; i++) {
cout << f[i] << "\n";
}
} | [["+", 0, 7, 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 | 110 |
N=int(input())
A=list(map(int, input().split()))
b=[0]*N
for i in A:
b[i-1]+=1
for i in b:
print(b) | N=int(input())
A=list(map(int, input().split()))
b=[0]*N
for i in A:
b[i-1]+=1
for j in b:
print(j) | [["-", 36, 36, 36, 36, 0, 656, 0, 7, 31, 22], ["+", 36, 36, 36, 36, 0, 656, 0, 7, 31, 22], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 22], ["+", 8, 196, 0, 1, 0, 652, 3, 4, 0, 22]] | 5 | 54 |
N = int(input())
A = list(map(int,input().split()))
L = [0] * (N+1)
for i in range(N):
L[A[i]]+=1
for i in range(1,N+1):
print(L[i]) | N = int(input())
A = list(map(int,input().split()))
L = [0] * (N+1)
for i in range(N-1):
L[A[i]]+=1
for i in range(1,N+1):
print(L[i]) | [["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 33], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 72 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
vector<int> v(n);
for (int i = 0; i < n; i++) {
int x;
cin >> x;
v[x - 1]++;
}
for (int i = 0; i < n; i++) {
cout << v[i] << '\n';
}
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
vector<int> v(n);
for (int i = 0; i < n - 1; i++) {
int x;
cin >> x;
v[x - 1]++;
}
for (int i = 0; i < n; i++) {
cout << v[i] << '\n';
}
return 0;
}
| [["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 33], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]] | 1 | 89 |
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < int(n); ++i)
#define rep1(i, n) for (int i = 1; i <= int(n); ++i)
int main(void) {
int n;
cin >> n;
map<int, int> cnt;
rep(i, n) {
int a;
cin >> a;
cnt[a]++;
}
rep1(i, n) { cout << cnt[i] << endl; }
return 0;
... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < int(n); ++i)
#define rep1(i, n) for (int i = 1; i <= int(n); ++i)
int main(void) {
int n;
cin >> n;
map<int, int> cnt;
rep(i, n - 1) {
int a;
cin >> a;
cnt[a]++;
}
rep1(i, n) { cout << cnt[i] << endl; }
return... | [["+", 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 | 85 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
vector<int> A(N);
vector<int> B(N);
for (int x : A) {
cin >> x;
B.at(x - 1)++;
}
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> A(N - 1);
vector<int> B(N);
for (int x : A) {
cin >> x;
B.at(x - 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]] | 1 | 87 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int cnt[n] = {};
for (int i = 0; i < n; i++) {
int t;
cin >> t;
++cnt[t - 1];
}
for (int i : cnt)
cout << i << "\n";
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int cnt[n] = {};
for (int i = 0; i < n - 1; i++) {
int t;
cin >> t;
++cnt[t - 1];
}
for (int i : cnt)
cout << i << "\n";
}
| [["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 33], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]] | 1 | 74 |
from collections import Counter
n = int(input())
a = list(map(int, input().split()))
c = Counter(a)
for _ in range(1, n):
print(c[_]) | from collections import Counter
n = int(input())
a = list(map(int, input().split()))
c = Counter(a)
for _ in range(1, n+1):
print(c[_]) | [["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 52 |
n = int(input())
A =[int(x) for x in input().split()]
ans = [0] * n
for i in range(n-1):
ans[A[i]-1] +=1
for i in ans:
print(ans[i]) | n = int(input())
A =[int(x) for x in input().split()]
ans = [0] * n
for i in range(n-1):
ans[A[i]-1] +=1
for i in range(n):
print(ans[i])
| [["-", 36, 36, 36, 36, 0, 656, 0, 7, 12, 22], ["+", 36, 36, 0, 656, 0, 7, 12, 652, 63, 22], ["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 24], ["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 22], ["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 25]] | 5 | 66 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
map<int, int> m;
for (int i = 1; i < n; i++)
m[i] = 0;
for (int i = 0; i < n - 1; i++) {
int a;
cin >> a;
m[a]++;
}
for (auto i : m)
cout << i.second << endl;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
map<int, int> m;
for (int i = 1; i <= n; i++)
m[i] = 0;
for (int i = 0; i < n - 1; i++) {
int a;
cin >> a;
m[a]++;
}
for (auto i : m)
cout << i.second << endl;
} | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 1 | 94 |
#include <bits/stdc++.h>
using namespace std;
#define ll long long
int main() {
int n;
cin >> n;
vector<int> cntb(n);
for (int i = 2; i <= n; i++) {
int boss;
cin >> boss;
cntb[boss]++;
}
for (int i = 1; i <= n; i++)
cout << cntb[i] << endl;
}
| #include <bits/stdc++.h>
using namespace std;
#define ll long long
int main() {
int n;
cin >> n;
vector<int> cntb(n + 1);
for (int i = 2; i <= n; i++) {
int boss;
cin >> boss;
cntb[boss]++;
}
for (int i = 1; i <= n; i++)
cout << cntb[i] << endl;
}
| [["+", 0, 43, 49, 50, 51, 4, 0, 16, 17, 72], ["+", 0, 43, 49, 50, 51, 4, 0, 16, 12, 13]] | 1 | 83 |
import collections
n = int(input())
A = list(map(int, input().split()))
cnt = collections.Counter(A)
for i in range(1,n):
print(cnt[i]) | import collections
n = int(input())
A = list(map(int, input().split()))
cnt = collections.Counter(A)
for i in range(1,n+1):
print(cnt[i]) | [["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 52 |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String line1 = br.readLine();
String line2 = br.readLine()... | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String line1 = br.readLine();
String line2 = br.readLine()... | [["+", 0, 1, 0, 11, 31, 504, 71, 16, 17, 33], ["+", 0, 1, 0, 11, 31, 504, 71, 16, 12, 499]] | 3 | 187 |
#include <bits/stdc++.h>
#define FasterIO \
ios_base::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0);
using namespace std;
int main() {
F... | #include <bits/stdc++.h>
#define FasterIO \
ios_base::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0);
using namespace std;
int main() {
F... | [["-", 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], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 1 | 92 |
num = int(input())
li = list(int(x) for x in input().split())
li2 = [0] * num
num = len(li)
for i in li:
li2[i - 1] = li2[i - 1] + 1
for j in range(num):
print(li2[j]) | num = int(input())
li = list(int(x) for x in input().split())
li2 = [0] * num
num = len(li)
for i in li:
li2[i - 1] = li2[i - 1] + 1
for j in range(num + 1):
print(li2[j]) | [["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 75 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
vector<int> a(n, 0);
for (int i = 2; i <= n; i++) {
cin >> a[i]; // i番目の人の上司
}
vector<int> joshi(n, 0);
for (int i = 1; i < n; i++) {
joshi[a[i]]++; // a[i]番目の人の部下の数
}
for (int i = 1; i <= n; i++) {
cout << josh... | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
vector<int> a(n + 1, 0);
for (int i = 2; i <= n; i++) {
cin >> a[i];
}
vector<int> joshi(n + 1, 0);
for (int i = 2; i <= n; i++) {
joshi[a[i]]++;
}
for (int i = 1; i <= n; i++) {
cout << joshi[i] << endl;
}
}
| [["+", 0, 43, 49, 50, 51, 4, 0, 16, 17, 72], ["+", 0, 43, 49, 50, 51, 4, 0, 16, 12, 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 | 116 |
#include <bits/stdc++.h>
using namespace std;
int main() {
long long n;
cin >> n;
vector<long long> a(n - 1);
for (int i = 0; i < n - 1; i++) {
cin >> a.at(i);
}
vector<int> sum(n);
for (int i = 0; i < n - 1; i++) {
sum.at(a.at(i))++;
}
for (int i = 0; i < n; i++) {
cout << sum.at(i) << e... | #include <bits/stdc++.h>
using namespace std;
int main() {
long long n;
cin >> n;
vector<long long> a(n - 1);
for (int i = 0; i < n - 1; i++) {
cin >> a.at(i);
}
vector<int> sum(n);
for (int i = 0; i < n - 1; i++) {
sum.at(a.at(i) - 1)++;
}
for (int i = 0; i < n; i++) {
cout << sum.at(i) ... | [["+", 0, 27, 28, 2, 3, 4, 0, 16, 17, 33], ["+", 0, 27, 28, 2, 3, 4, 0, 16, 12, 13]] | 1 | 129 |
from collections import Counter
def resolve():
N = int(input())
A = list(map(int, input().split()))
C = Counter(A)
for i in range(1, N+1):
print(C[i])
if __name__ == "__main__":
unittest.main() |
from collections import Counter
def resolve():
N = int(input())
A = list(map(int, input().split()))
C = Counter(A)
for i in range(1, N+1):
print(C[i])
if __name__ == "__main__":
resolve() | [["-", 64, 196, 0, 1, 0, 652, 63, 319, 500, 22], ["-", 64, 196, 0, 1, 0, 652, 63, 319, 0, 131], ["-", 64, 196, 0, 1, 0, 652, 63, 319, 319, 22], ["+", 0, 57, 64, 196, 0, 1, 0, 652, 63, 22]] | 5 | 71 |
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep1(i, n) for (int i = 1; i < (n); i++)
#define erep(i, n) for (int i = 0; i <= (n); i++)
#define erep1(i, n) for (int i = 1; i <= (n); i++)
using namespace std;
using ll = long long;
int main() {
int N;
cin >> N;
int n = n + 1;
v... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep1(i, n) for (int i = 1; i < (n); i++)
#define erep(i, n) for (int i = 0; i <= (n); i++)
#define erep1(i, n) for (int i = 1; i <= (n); i++)
using namespace std;
using ll = long long;
int main() {
int N;
cin >> N;
int n = N + 1;
v... | [["-", 8, 9, 0, 43, 49, 50, 51, 16, 31, 22], ["+", 8, 9, 0, 43, 49, 50, 51, 16, 31, 22]] | 1 | 145 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
vector<int> a(n);
vector<int> ans(n);
for (int i = 2; i <= n; i++)
cin >> a[i];
for (int i = 2; i <= n; i++)
ans[a[i]]++;
for (int i = 1; i <= n; i++)
cout << ans[i] << endl;
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
vector<int> a(n + 1);
vector<int> ans(n + 1);
for (int i = 2; i <= n; i++)
cin >> a[i];
for (int i = 2; i <= n; i++)
ans[a[i]]++;
for (int i = 1; i <= n; i++)
cout << ans[i] << endl;
return 0;
}
| [["+", 0, 43, 49, 50, 51, 4, 0, 16, 17, 72], ["+", 0, 43, 49, 50, 51, 4, 0, 16, 12, 13]] | 1 | 107 |
n = int(input())
a = list(map(int,input().split()))
ans = [0]*(n+1)
for i in range(n-1):
b = a[i]
ans[b] +=1
for i in range(1,n+1):
print(ans_l[i]) | n = int(input())
a = list(map(int,input().split()))
ans = [0]*(n+1)
for i in range(n-1):
b = a[i]
ans[b] +=1
for i in range(1,n+1):
print(ans[i]) | [["-", 0, 1, 0, 652, 3, 4, 0, 206, 51, 22], ["+", 0, 1, 0, 652, 3, 4, 0, 206, 51, 22]] | 5 | 77 |
#include <bits/stdc++.h>
using namespace std;
int N;
int a[200001];
int main() {
cin >> N;
for (int i = 1; i < N + 1; i++)
cin >> a[i];
map<int, int> mp;
for (int i = 1; i < N; i++) {
mp[i] = 0;
}
for (int i = 1; i < N; i++) {
mp[a[i]]++;
}
for (auto itr = mp.begin(); itr != mp.end(); ++itr... | #include <bits/stdc++.h>
using namespace std;
int N;
int a[200001];
int main() {
cin >> N;
for (int i = 1; i < N; i++)
cin >> a[i];
map<int, int> mp;
for (int i = 1; i < N + 1; i++) {
mp[i] = 0;
}
for (int i = 1; i < N; i++) {
mp[a[i]]++;
}
for (auto itr = mp.begin(); itr != mp.end(); ++itr... | [["-", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["-", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]] | 1 | 139 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int a[n];
int b[n] = {0};
for (int i = 0; i < n - 1; ++i) {
cin >> a[i];
b[a[i]]++;
}
for (int i = 0; i < n; ++i)
cout << b[i] << "\n";
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int a[n];
int b[n + 1] = {0};
for (int i = 0; i < n - 1; ++i) {
cin >> a[i];
b[a[i]]++;
}
for (int i = 1; i <= n; ++i)
cout << b[i] << "\n";
} | [["+", 0, 43, 49, 50, 49, 80, 81, 16, 17, 72], ["+", 0, 43, 49, 50, 49, 80, 81, 16, 12, 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 | 94 |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define setbits(x) __builtin_popcount(x)
#define setbitsll(x) __builtin_popcountll(x)
//#define endl '\n'
#define all(x) (x).begin(), (x).end()
#define pb push_back
#define se second
#define fi first
#define pai acos(-1)... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define setbits(x) __builtin_popcount(x)
#define setbitsll(x) __builtin_popcountll(x)
//#define endl '\n'
#define all(x) (x).begin(), (x).end()
#define pb push_back
#define se second
#define fi first
#define pai acos(-1)... | [["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["-", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["-", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]] | 1 | 346 |
n = int(input())
a = [int(n) for n in input().split()]
b = [0] * n
for i in a:
b[i-1] += 1
print(b)
for i in b:
print(i) | n = int(input())
a = [int(n) for n in input().split()]
b = [0] * n
for i in a:
b[i-1] += 1
for i in b:
print(i) | [["-", 0, 7, 8, 196, 0, 1, 0, 652, 63, 22], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 24], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 25]] | 5 | 59 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int A, B;
cin >> A;
int N[A - 1];
int M[A] = {};
for (int i = 0; i < A - 1; i++) {
cin >> N[i];
M[N[i]]++;
}
for (int i = 1; i < A; i++)
cout << M[i] << endl;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int A, B;
cin >> A;
int N[A - 1];
int M[A + 1] = {};
for (int i = 0; i < A - 1; i++) {
cin >> N[i];
M[N[i]]++;
}
for (int i = 1; i < A + 1; 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], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]] | 1 | 95 |
#include <stdio.h>
int main(void) {
int i, j, a, N, A[100100] = {};
scanf("%d", &N);
for (i = 1; i < N; i++) {
scanf("%d", &a);
A[a - 1]++;
}
for (i = 1; i <= N; i++) {
printf("%d\n", A[i]);
}
return 0;
}
| #include <stdio.h>
int main(void) {
int i, j, a, N, A[200100] = {};
scanf("%d", &N);
for (i = 1; i < N; i++) {
scanf("%d", &a);
A[a]++;
}
for (i = 1; i <= N; i++) {
printf("%d\n", A[i]);
}
return 0;
}
| [["-", 8, 9, 0, 43, 49, 50, 49, 80, 81, 13], ["+", 8, 9, 0, 43, 49, 50, 49, 80, 81, 13], ["-", 0, 1, 0, 27, 28, 69, 71, 16, 17, 33], ["-", 0, 1, 0, 27, 28, 69, 71, 16, 12, 13]] | 0 | 100 |
#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[i];
vector<int> b(n);
b[0] = 0;
for (int i = 0; i < n - 1; i++)
b[a[i]] += 1;
for (int i = 1; i < n - 1; i++)
cout << b[i] << endl;
}
| #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[i];
vector<int> b(n + 1);
b[0] = 0;
for (int i = 0; i < n - 1; i++)
b[a[i]] += 1;
for (int i = 1; i < n + 1; i++)
cout << b[i] << endl;
}
| [["+", 0, 43, 49, 50, 51, 4, 0, 16, 17, 72], ["+", 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, 17, 72]] | 1 | 120 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, i, l;
cin >> n;
int a[n] = {0};
for (i = 0; i < n - 1; i++) {
cin >> l;
a[l]++;
}
for (i = 1; i <= n; i++) {
cout << a[i] << "\n";
}
} | #include <bits/stdc++.h>
using namespace std;
int main() {
long long n, i, l;
cin >> n;
long long a[n + 1] = {0};
for (i = 0; i < n - 1; i++) {
cin >> l;
a[l]++;
}
for (i = 1; i <= n; i++) {
cout << a[i] << "\n";
}
} | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["+", 0, 43, 49, 50, 49, 80, 81, 16, 17, 72], ["+", 0, 43, 49, 50, 49, 80, 81, 16, 12, 13]] | 1 | 86 |
M = int(input())
A = list(map(int, input().split()))
B = collections.Counter(A)
#print(B)
#print(B[])
num = 1
while num <= M:
print(B[num])
num += 1 | import collections
M = int(input())
A = list(map(int, input().split()))
B = collections.Counter(A)
num = 1
while num <= M:
print(B[num])
num += 1 | [["+", 36, 36, 36, 36, 0, 656, 0, 596, 0, 487], ["+", 36, 36, 0, 656, 0, 596, 141, 673, 0, 22]] | 5 | 53 |
#include <bits/stdc++.h>
using namespace std;
int main() {
long long int a;
cin >> a;
multiset<int> b;
int g;
for (int i = 0; i < a; i++) {
cin >> g;
b.insert(g);
}
for (int i = 1; i <= a; i++) {
cout << b.count(i) << "\n";
}
} | #include <bits/stdc++.h>
using namespace std;
int main() {
long long int a;
cin >> a;
multiset<int> b;
int g;
for (int i = 0; i < a - 1; i++) {
cin >> g;
b.insert(g);
}
for (int i = 1; i <= a; i++) {
cout << b.count(i) << "\n";
}
} | [["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 33], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]] | 1 | 86 |
#include <stdio.h>
typedef long long ll;
void seq(ll num, ll a[], ll b[]) {
for (int i = 0; i < num - 1; i++) {
b[a[i]]++;
}
return;
}
int main(void) {
ll num;
scanf("%lld", &num);
ll a[num - 1];
ll b[num];
for (int i = 0; i < num; i++) {
b[i] = 0;
}
for (int i = 0; i < num - 1; i++) {
... | #include <stdio.h>
typedef long long ll;
void seq(ll num, ll a[], ll b[]) {
for (int i = 0; i < num - 1; i++) {
b[a[i] - 1]++;
}
return;
}
int main(void) {
ll num;
scanf("%lld", &num);
ll a[num - 1];
ll b[num];
for (int i = 0; i < num; i++) {
b[i] = 0;
}
for (int i = 0; i < num - 1; i++) {... | [["+", 0, 1, 0, 27, 28, 69, 71, 16, 17, 33], ["+", 0, 1, 0, 27, 28, 69, 71, 16, 12, 13]] | 0 | 183 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, x, a[200001] = {0};
std::cin >> n;
for (int i = 0; i < n; i++) {
std::cin >> x;
a[x] += 1;
}
for (int i = 0; i < n; i++) {
cout << a[i] << endl;
}
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
int n, x, a[200001] = {0};
std::cin >> n;
for (int i = 1; i < n; i++) {
std::cin >> x;
a[x] += 1;
}
for (int i = 1; i <= n; i++) {
cout << a[i] << endl;
}
}
| [["-", 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 | 86 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.