problem_id stringlengths 6 6 | language stringclasses 2
values | original_status stringclasses 3
values | original_src stringlengths 19 243k | changed_src stringlengths 19 243k | change stringclasses 3
values | i1 int64 0 8.44k | i2 int64 0 8.44k | j1 int64 0 8.44k | j2 int64 0 8.44k | error stringclasses 270
values | stderr stringlengths 0 226k |
|---|---|---|---|---|---|---|---|---|---|---|---|
p02707 | Python | Time Limit Exceeded | n = int(input())
a = list(map(int, input().split()))
for i in range(n):
print(a.count(i + 1))
| n = int(input())
a = list(map(int, input().split()))
result = [0] * n
for x in a:
result[x - 1] += 1
for v in result:
print(v)
| replace | 2 | 4 | 2 | 7 | TLE | |
p02707 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int ara[21000];
int main() {
int n, x, i;
cin >> n;
for (i = 1; i < n; i++) {
cin >> x;
ara[x]++;
}
for (i = 1; i <= n; i++) {
cout << ara[i] << endl;
}
}
| #include <bits/stdc++.h>
using namespace std;
int ara[210000];
int main() {
int n, x, i;
cin >> n;
for (i = 1; i < n; i++) {
cin >> x;
ara[x]++;
}
for (i = 1; i <= n; i++) {
cout << ara[i] << endl;
}
}
| replace | 2 | 3 | 2 | 3 | 0 | |
p02707 | C++ | Time Limit Exceeded | #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() {
int n;
cin >> n;
vector<int> a(n - 1);
rep(i, n - 1) cin >> a[i];
vector<int> b(n, 0);
rep(i, n - 1) rep(j, n) {
if (a[i] == j + 1)
b[j]++;
... | #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() {
int n;
cin >> n;
vector<int> a(n - 1);
rep(i, n - 1) cin >> a[i];
vector<int> b(n, 0);
int cnt = 0;
rep(i, n - 1) { b[a[i] - 1]++; }
rep(i, n) cout ... | replace | 12 | 16 | 12 | 14 | TLE | |
p02707 | C++ | Runtime Error | // Mahir Ratanpara (DA-IICT)
#include <bits/stdc++.h>
using namespace std;
#define Ff(i, a, n) for (i = a; i < n; i++)
#define Fr(i, a, n) for (i = a; i > n; i--)
#define ll long long
#define FAST ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
#define pb push_back
#define mp make_pair
#define ff first
#defi... | // Mahir Ratanpara (DA-IICT)
#include <bits/stdc++.h>
using namespace std;
#define Ff(i, a, n) for (i = a; i < n; i++)
#define Fr(i, a, n) for (i = a; i > n; i--)
#define ll long long
#define FAST ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
#define pb push_back
#define mp make_pair
#define ff first
#defi... | replace | 44 | 45 | 44 | 45 | 0 | |
p02707 | C++ | Runtime Error | #pragma GCC optimize("Ofast", 3, "inline")
#include <bits/stdc++.h>
using namespace std;
#define fir first
#define sec second
#define m_p make_pair
#define y1 ygftgfgcdtfgxffgx
#define y2 yfdsesgvtyghftfvv
#define x1 xvyr6cf6fgcfgf676
#define x2 xcr6rfc5r66y6r6fr
#define up_bound upper_bound
#define low_bound lower_bou... | #pragma GCC optimize("Ofast", 3, "inline")
#include <bits/stdc++.h>
using namespace std;
#define fir first
#define sec second
#define m_p make_pair
#define y1 ygftgfgcdtfgxffgx
#define y2 yfdsesgvtyghftfvv
#define x1 xvyr6cf6fgcfgf676
#define x2 xcr6rfc5r66y6r6fr
#define up_bound upper_bound
#define low_bound lower_bou... | replace | 23 | 24 | 23 | 24 | 0 | |
p02707 | C++ | Runtime Error | // nani?
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/detail/standard_policies.hpp>
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
#define pi acos(-1);
#define fs first
#define sc second
#define pb push_back
#define mp make_pai... | // nani?
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/detail/standard_policies.hpp>
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
#define pi acos(-1);
#define fs first
#define sc second
#define pb push_back
#define mp make_pai... | replace | 25 | 26 | 25 | 26 | 0 | |
p02707 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
int b[20005];
int main() {
int n;
cin >> n;
unordered_map<int, int> mp;
unordered_map<int, int>::iterator it;
for (int i = 1; i < n; i++) {
int x;
cin >> x;
mp[x]++;
}
for (it = mp.begin(); it != mp.end(); it++) {
b[(it->... | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
int b[200005];
int main() {
int n;
cin >> n;
unordered_map<int, int> mp;
unordered_map<int, int>::iterator it;
for (int i = 1; i < n; i++) {
int x;
cin >> x;
mp[x]++;
}
for (it = mp.begin(); it != mp.end(); it++) {
b[(it-... | replace | 4 | 5 | 4 | 5 | 0 | |
p02707 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, i;
cin >> n;
int a[n], b[100005] = {0};
for (i = 0; i < n - 1; i++) {
cin >> a[i];
b[a[i]]++;
}
for (i = 0; i < n; i++) {
cout << b[i + 1] << endl;
}
return 0;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, i;
cin >> n;
int a[n], b[200005] = {0};
for (i = 0; i < n - 1; i++) {
cin >> a[i];
b[a[i]]++;
}
for (i = 0; i < n; i++) {
cout << b[i + 1] << endl;
}
return 0;
} | replace | 5 | 6 | 5 | 6 | 0 | |
p02707 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
vector<int> A(N); // A[i]はiの上司を指す。
A.at(0) = 0;
for (int i = 1; i < N; i++)
cin >> A.at(i); // [(0), 1, 1, 2, 2]
// 各上司について部下を求める。これには2次配列を用いる
// 5人で、1 1 2 2 の場合、2と3の上司が1、4と5の上司は2となる。
// [[2,3], [4,5], [], [], []]のような物を得たい... | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
vector<int> A(N); // A[i]はiの上司を指す。
A.at(0) = 0;
for (int i = 1; i < N; i++)
cin >> A.at(i); // [(0), 1, 1, 2, 2]
// 各上司について部下を求める。これには2次配列を用いる
// 5人で、1 1 2 2 の場合、2と3の上司が1、4と5の上司は2となる。
// [[2,3], [4,5], [], [], []]のような物を得たい... | replace | 15 | 20 | 15 | 25 | TLE | |
p02707 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
int N, A[100000], i, j;
cin >> N;
for (i = 2; i <= N; i++) {
cin >> j;
A[j]++;
}
for (i = 1; i <= N; i++) {
cout << A[i] << endl;
}
return 0;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int N, A[1000000], i, j;
cin >> N;
for (i = 2; i <= N; i++) {
cin >> j;
A[j]++;
}
for (i = 1; i <= N; i++) {
cout << A[i] << endl;
}
return 0;
} | replace | 4 | 5 | 4 | 5 | 0 | |
p02707 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5;
int a, n, boss[maxn] = {0};
int main() {
cin >> n;
for (int i = 2; i <= n; i++) {
cin >> a;
boss[a]++;
}
for (int i = 1; i <= n; i++) {
cout << boss[i] << endl;
}
return 0;
} | #include <bits/stdc++.h>
using namespace std;
const int maxn = 2 * 1e5 + 5;
int a, n, boss[maxn] = {0};
int main() {
cin >> n;
for (int i = 2; i <= n; i++) {
cin >> a;
boss[a]++;
}
for (int i = 1; i <= n; i++) {
cout << boss[i] << endl;
}
return 0;
} | replace | 2 | 3 | 2 | 3 | 0 | |
p02707 | C++ | Runtime Error | #include <iostream>
int s[100006];
int q[100006] = {0};
using namespace std;
int main() {
int n;
cin >> n;
for (int i = 0; i < n - 1; i++) {
cin >> s[i];
q[s[i]]++;
}
for (int i = 1; i <= n; i++) {
cout << q[i] << endl;
}
} | #include <iostream>
int s[200006];
int q[200006] = {0};
using namespace std;
int main() {
int n;
cin >> n;
for (int i = 0; i < n - 1; i++) {
cin >> s[i];
q[s[i]]++;
}
for (int i = 1; i <= n; i++) {
cout << q[i] << endl;
}
} | replace | 1 | 3 | 1 | 3 | 0 | |
p02707 | C++ | Runtime Error | #include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; (i) < (n); (i)++)
#define INF 5000000000000000
using namespace std;
struct Edge {
int to;
long weight;
Edge(int t, long w) : to(t), weight(w) {}
};
long modpow(long a, long n, long mod) {
long res = 1;
while (n > 0) {
if (n & 1)
res = res ... | #include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; (i) < (n); (i)++)
#define INF 5000000000000000
using namespace std;
struct Edge {
int to;
long weight;
Edge(int t, long w) : to(t), weight(w) {}
};
long modpow(long a, long n, long mod) {
long res = 1;
while (n > 0) {
if (n & 1)
res = res ... | replace | 156 | 157 | 156 | 157 | 0 | |
p02707 | C++ | Runtime Error | #include <bits/stdc++.h>
#define MAX 1000000007
#define ll long long int
#define fo(i, n) for (int i = 0; i < n; i++)
#define ull unsigned long long int
#define pb push_back
#define eb emplace_back
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
// int t;
// ... | #include <bits/stdc++.h>
#define MAX 1000000007
#define ll long long int
#define fo(i, n) for (int i = 0; i < n; i++)
#define ull unsigned long long int
#define pb push_back
#define eb emplace_back
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
// int t;
// ... | replace | 21 | 22 | 21 | 22 | 0 | |
p02707 | C++ | Runtime Error | #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) {
... | replace | 39 | 40 | 39 | 40 | -11 | |
p02707 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int arr[100005];
int n, tmp;
int main() {
cin >> n;
for (int i = 1; i < n; i++) {
cin >> tmp;
arr[tmp]++;
}
for (int i = 1; i <= n; i++) {
cout << arr[i] << "\n";
}
return 0;
} | #include <bits/stdc++.h>
using namespace std;
int arr[200005];
int n, tmp;
int main() {
cin >> n;
for (int i = 1; i < n; i++) {
cin >> tmp;
arr[tmp]++;
}
for (int i = 1; i <= n; i++) {
cout << arr[i] << "\n";
}
return 0;
} | replace | 2 | 3 | 2 | 3 | 0 | |
p02707 | C++ | Runtime Error | #include <iostream>
using namespace std;
int arr[100000];
int main() {
int n;
cin >> n;
int a[n];
for (int i = 0; i < n - 1; i++)
cin >> a[i];
for (int i = 0; i < n - 1; i++)
arr[a[i]]++;
for (int i = 1; i <= n; i++)
cout << arr[i] << endl;
return 0;
}
| #include <iostream>
using namespace std;
int arr[200000];
int main() {
int n;
cin >> n;
int a[n];
for (int i = 0; i < n - 1; i++)
cin >> a[i];
for (int i = 0; i < n - 1; i++)
arr[a[i]]++;
for (int i = 1; i <= n; i++)
cout << arr[i] << endl;
return 0;
}
| replace | 2 | 3 | 2 | 3 | 0 | |
p02707 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
long long A[N], subord[N];
for (int i = 0; i < N - 1; i++) {
cin >> A[i];
subord[i] = 0;
}
for (int j = 0; j < N - 1; j++) {
for (int m = 0; m < N; m++) {
if (j == A[m] - 1) {
subord[j]++;
}
... | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
long long A[N], subord[N];
for (int i = 0; i < N - 1; i++) {
cin >> A[i];
subord[i] = 0;
}
for (int j = 0; j < N - 1; j++) {
subord[A[j] - 1]++;
}
for (int n = 0; n < N - 1; n++) {
cout << subord[n] << endl;... | replace | 16 | 21 | 16 | 17 | TLE | |
p02707 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
long long N, M, value;
cin >> N;
vector<int> count;
for (int i = 0; i < N - 1; i++) {
cin >> value;
count[value - 1]++;
}
for (int i = 0; i < N; i++)
cout << count[i] << ' ';
} | #include <bits/stdc++.h>
using namespace std;
int main() {
long long N, M, value;
cin >> N;
vector<int> count(N);
for (int i = 0; i < N - 1; i++) {
cin >> value;
count[value - 1]++;
}
for (int i = 0; i < N; i++)
cout << count[i] << ' ';
} | replace | 7 | 8 | 7 | 8 | -11 | |
p02707 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
long long int N;
cin >> N;
vector<int> A(N);
vector<int> sum(N);
for (int i = 1; i < N; i++) {
cin >> A.at(i);
for (int l = 0; l < i; l++) {
if (A.at(i) == l + 1) {
sum.at(l)++;
}
}
}
for (int i = 0; i < N; i++) {... | #include <bits/stdc++.h>
using namespace std;
int main() {
long long int N;
cin >> N;
vector<int> A(N);
vector<int> sum(N);
for (int i = 1; i < N; i++) {
cin >> A.at(i);
sum.at((A.at(i) - 1))++;
}
for (int i = 0; i < N; i++) {
cout << sum.at(i) << endl;
}
}
| replace | 10 | 15 | 10 | 11 | TLE | |
p02707 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
void solve(long N, vector<long> A) {
rep(i, N) { cout << count(A.cbegin() + i, A.cend(), i + 1) << endl; }
}
int main() {
// int 3E4
// long 2E9
// long long 9E18
cin.tie(0);
ios::sync_with_stdio(false);
long... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
void solve(long N, vector<long> A) {
vector<long> count(N);
rep(i, N - 1) { count[A[i] - 1]++; }
rep(i, N) { cout << count[i] << endl; }
}
int main() {
// int 3E4
// long 2E9
// long long 9E18
cin.tie(0);
io... | replace | 6 | 7 | 6 | 9 | TLE | |
p02707 | C++ | Runtime Error | #include <bits/stdc++.h>
// #include<ext/pb_ds/assoc_container.hpp>
// #include<ext/pb_ds/tree_policy.hpp>
//
// #pragma GCC optimize("unroll-loops")
// #pragma GCC optimize("Ofast")
// #pragma GCC optimize("-O3")
// #pragma GCC optimize("no-stack-protector")
// #pragma GCC optimize("fast-math")
#d... | #include <bits/stdc++.h>
// #include<ext/pb_ds/assoc_container.hpp>
// #include<ext/pb_ds/tree_policy.hpp>
//
// #pragma GCC optimize("unroll-loops")
// #pragma GCC optimize("Ofast")
// #pragma GCC optimize("-O3")
// #pragma GCC optimize("no-stack-protector")
// #pragma GCC optimize("fast-math")
#d... | replace | 65 | 66 | 65 | 66 | 0 | |
p02707 | C++ | Time Limit Exceeded | #include <algorithm>
#include <bitset>
#include <cctype>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace ... | #include <algorithm>
#include <bitset>
#include <cctype>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace ... | replace | 95 | 104 | 95 | 97 | TLE | |
p02707 | C++ | Runtime Error | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
#define repr(i, n) for (int i = n - 1; i >= 0; i--)
#define MAX(a, b) a = a > b ? a : b
#define MIN(a, b) a = a < b ? a : b
#define REP(i, x, n) for (int i = x; i < n; i++)
#define REPR(i, x, n) for (int i = n - 1; i >= x; i--)
#define pb push_back
... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
#define repr(i, n) for (int i = n - 1; i >= 0; i--)
#define MAX(a, b) a = a > b ? a : b
#define MIN(a, b) a = a < b ? a : b
#define REP(i, x, n) for (int i = x; i < n; i++)
#define REPR(i, x, n) for (int i = n - 1; i >= x; i--)
#define pb push_back
... | replace | 17 | 18 | 17 | 18 | 0 | |
p02707 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
int n;
cin >> n;
vector<int> a(n - 1);
map<int, int> b;
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;
}
} | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
int n;
cin >> n;
vector<int> a(n - 1);
map<int, int> b;
for (int i = 0; i < n - 1; i++) {
cin >> a[i];
b[a[i] - 1]++;
}
for (int i = 0; i < n; i++) {
cout << b[i] << endl;
}
} | replace | 8 | 9 | 8 | 9 | 0 | |
p02707 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
long long n, m, ans, temp;
int a[111111];
int main() {
cin >> n;
for (int i = 1; i < n; i++) {
cin >> temp;
a[temp]++;
}
for (int i = 1; i <= n; i++) {
cout << a[i] << endl;
}
} | #include <bits/stdc++.h>
using namespace std;
long long n, m, ans, temp;
int a[11111111];
int main() {
cin >> n;
for (int i = 1; i < n; i++) {
cin >> temp;
a[temp]++;
}
for (int i = 1; i <= n; i++) {
cout << a[i] << endl;
}
} | replace | 3 | 4 | 3 | 4 | 0 | |
p02707 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, a, i, m;
cin >> n;
int arr[20000];
memset(arr, 0, 20000);
m = n - 1;
while (m--) {
cin >> a;
arr[a - 1]++;
}
for (i = 0; i < n; i++)
cout << arr[i] << endl;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, a, i, m;
cin >> n;
int arr[n];
memset(arr, 0, sizeof(arr));
m = n - 1;
while (m--) {
cin >> a;
arr[a - 1]++;
}
for (i = 0; i < n; i++)
cout << arr[i] << endl;
} | replace | 5 | 7 | 5 | 7 | 0 | |
p02707 | C++ | Runtime Error | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#define ARB \
ios::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(... | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#define ARB \
ios::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(... | replace | 13 | 14 | 13 | 14 | 0 | |
p02707 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef unsigned long long int ull;
typedef long long int ll;
int main() {
int n, a[100000], b[100000] = {0}, i;
cin >> n;
for (i = 1; i < n; i++) {
cin >> a[i];
}
for (i = 1; i < n; i++) {
b[a[i]]++;
}
for (i = 1; i <= n; i++) {
cout << b[i] << en... | #include <bits/stdc++.h>
using namespace std;
typedef unsigned long long int ull;
typedef long long int ll;
int main() {
int n, a[300000], b[300000] = {0}, i;
cin >> n;
for (i = 1; i < n; i++) {
cin >> a[i];
}
for (i = 1; i < n; i++) {
b[a[i]]++;
}
for (i = 1; i <= n; i++) {
cout << b[i] << en... | replace | 5 | 6 | 5 | 6 | 0 | |
p02707 | Python | Time Limit Exceeded | n = int(input())
line = list(map(int, input().strip().split(" ")))
for i in range(1, n + 1):
print(line.count(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])
| replace | 4 | 6 | 4 | 11 | TLE | |
p02707 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
template <typename T> std::string NumberToString(T Number) {
std::ostringstream ss;
ss << Number;
return ss.str();
} // Usages NumberToString(3)
template <typename T> T StringToNumber(const string &Text) {
istringstream ss(Text);
T result;
return ss >> result ... | #include <bits/stdc++.h>
using namespace std;
template <typename T> std::string NumberToString(T Number) {
std::ostringstream ss;
ss << Number;
return ss.str();
} // Usages NumberToString(3)
template <typename T> T StringToNumber(const string &Text) {
istringstream ss(Text);
T result;
return ss >> result ... | replace | 15 | 16 | 15 | 16 | 0 | |
p02707 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define lli long long
int main() {
lli n, i, j, c = 0, s = 0;
cin >> n;
lli arr[n - 1];
lli brr[10001] = {0};
for (i = 0; i < n - 1; i++)
cin >> arr[i];
unordered_map<lli, lli> m;
for (i = 0; i < n - 1; i++) {
m[arr[i]]++;
}
for (auto it : m) {
... | #include <bits/stdc++.h>
using namespace std;
#define lli long long
int main() {
lli n, i, j, c = 0, s = 0;
cin >> n;
lli arr[n - 1];
lli brr[1000001] = {0};
for (i = 0; i < n - 1; i++)
cin >> arr[i];
unordered_map<lli, lli> m;
for (i = 0; i < n - 1; i++) {
m[arr[i]]++;
}
for (auto it : m) {
... | replace | 7 | 8 | 7 | 8 | 0 | |
p02707 | C++ | Runtime Error | #include <iostream>
using namespace std;
int main() {
int d[20001], a[20001], i, n;
cin >> n;
for (int i = 2; i <= n; i++) {
cin >> a[i];
d[a[i]]++;
}
for (int i = 1; i <= n; i++)
cout << d[i] << "\n";
return 0;
}
| #include <iostream>
using namespace std;
int main() {
long long d[2000001], a[2000001], i, n;
cin >> n;
for (int i = 2; i <= n; i++) {
cin >> a[i];
d[a[i]]++;
}
for (int i = 1; i <= n; i++)
cout << d[i] << "\n";
return 0;
}
| replace | 5 | 6 | 5 | 6 | 0 | |
p02707 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
vector<int> vec(N);
int A;
vec.at(0) = 0;
for (int i = 1; i < N; i++) {
cin >> A;
vec.at(i) = A;
}
sort(vec.begin(), vec.end());
int counter;
int start = 0;
for (int i = 0; i < N; i++) {
counter = 0;
for (... | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
vector<int> vec(N);
int A;
vec.at(0) = 0;
for (int i = 1; i < N; i++) {
cin >> A;
vec.at(i) = A;
}
sort(vec.begin(), vec.end());
int counter;
int start = 0;
for (int i = 0; i < N; i++) {
counter = 0;
for (... | insert | 21 | 21 | 21 | 23 | TLE | |
p02707 | C++ | Runtime Error | #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;
}
} | replace | 6 | 8 | 6 | 8 | -6 | terminate called after throwing an instance of 'std::out_of_range'
what(): vector::_M_range_check: __n (which is 18446744073709551615) >= this->size() (which is 5)
|
p02707 | C++ | Time Limit Exceeded | /**********************************************************************
File .cpp
Author Takahiro Yamazaki
**********************************************************************/
/**********************************************************************
Include Libraries
***********************************************... | /**********************************************************************
File .cpp
Author Takahiro Yamazaki
**********************************************************************/
/**********************************************************************
Include Libraries
***********************************************... | replace | 36 | 48 | 36 | 48 | TLE | |
p02707 | C++ | Runtime Error | #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;
} | replace | 6 | 8 | 6 | 8 | 0 | |
p02707 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using namespace std;
#define ll long long
#define f(i, a, b) for (int i = a; i < b; i++)
#define endl '\n'
#define spc " "
#define pb push_back
#define mp make_pair
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
// freopen("in.txt","r",stdin);
// freopen("outp... | #include <bits/stdc++.h>
using namespace std;
using namespace std;
#define ll long long
#define f(i, a, b) for (int i = a; i < b; i++)
#define endl '\n'
#define spc " "
#define pb push_back
#define mp make_pair
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
// freopen("in.txt","r",stdin);
// freopen("outp... | replace | 20 | 21 | 20 | 21 | 0 | |
p02707 | C++ | Runtime Error | #include <bits/stdc++.h>
#define INF 9003372036854775807LL
#define mod 998244353
#define fixed fixed << setprecision(12)
#define abs(x, y) (max(x, y) - min(x, y))
#define lol long long
#define mp make_pair
#define fi first
#define se second
using namespace std;
using pii = pair<int, int>;
lol a[100010];
signed main() {... | #include <bits/stdc++.h>
#define INF 9003372036854775807LL
#define mod 998244353
#define fixed fixed << setprecision(12)
#define abs(x, y) (max(x, y) - min(x, y))
#define lol long long
#define mp make_pair
#define fi first
#define se second
using namespace std;
using pii = pair<int, int>;
lol a[300010];
signed main() {... | replace | 11 | 12 | 11 | 12 | 0 | |
p02707 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<pii> vii;
typedef vector<pll> vll;
const double PI = acos(-1);
#define MOD 1000000007
#define pb push_back
#define F first
#define S ... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<pii> vii;
typedef vector<pll> vll;
const double PI = acos(-1);
#define MOD 1000000007
#define pb push_back
#define F first
#define S ... | replace | 40 | 41 | 40 | 41 | 0 | |
p02707 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 1e5 + 10;
const double pi = acos(-1);
int n, c[N], a;
int main() {
scanf("%d", &n);
for (int i = 1; i < n; ++i) {
scanf("%d", &a);
c[a]++;
}
for (int i = 1; i <= n; ++i)
printf("%d\n", c[i]);
} | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 2e5 + 10;
const double pi = acos(-1);
int n, c[N], a;
int main() {
scanf("%d", &n);
for (int i = 1; i < n; ++i) {
scanf("%d", &a);
c[a]++;
}
for (int i = 1; i <= n; ++i)
printf("%d\n", c[i]);
} | replace | 3 | 4 | 3 | 4 | 0 | |
p02707 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
vector<int> bossNumber(N);
for (int i = 1; i < N; i++) {
cin >> bossNumber.at(i);
}
vector<int> numberOfStuff(N);
for (int i = 0; i < N; i++) {
for (int j = 1; j < N; j++) {
if (i == bossNumber.at(j) - 1) {
... | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
vector<int> bossNumber(N);
for (int i = 1; i < N; i++) {
cin >> bossNumber.at(i);
}
vector<int> numberOfStuff(N);
for (int i = 1; i < N; i++) {
numberOfStuff.at(bossNumber.at(i) - 1)++;
}
for (int i = 0; i < N; i++) {... | replace | 11 | 17 | 11 | 13 | TLE | |
p02707 | C++ | Time Limit Exceeded | #include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
int num[n - 1];
for (int i = 0; i < n - 1; i++) {
cin >> num[i];
}
int buka[n];
for (int i = 0; i < n; i++) {
buka[i] = 0;
}
for (int i = 0; i < n; i++) {
for (int j = 0; j < n - 1; j++) {
if (i + 1 == num[j])... | #include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
int num[n - 1];
for (int i = 0; i < n - 1; i++) {
cin >> num[i];
}
int buka[n] = {};
for (int i = 0; i < n - 1; i++) {
buka[num[i] - 1] = buka[num[i] - 1] + 1;
}
for (int i = 0; i < n; i++) {
cout << buka[i] << end... | replace | 13 | 23 | 13 | 16 | TLE | |
p02707 | C++ | Runtime Error | #include <bits/stdc++.h> // g++ -std=c++14 -o a a.cpp
using namespace std;
typedef pair<int, int> P;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define repto(i, n) for (int i = 0; i <= (n); i++)
#define all(c) (c).begin(), (c).end()
#define uniq(c) c.erase(unique(all(c)), (c).end())
#defin... | #include <bits/stdc++.h> // g++ -std=c++14 -o a a.cpp
using namespace std;
typedef pair<int, int> P;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define repto(i, n) for (int i = 0; i <= (n); i++)
#define all(c) (c).begin(), (c).end()
#define uniq(c) c.erase(unique(all(c)), (c).end())
#defin... | replace | 25 | 26 | 25 | 26 | 0 | |
p02707 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define ff first
#define ss second
#define pb push_back
#define sz size()
#define mp make_pair
const int N = 1e5 + 5;
const int MOD = 1e9 + 7;
int ans[N];
int main() {
int n, x;
cin >> n;
for (int i = 0; i < n - 1... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define ff first
#define ss second
#define pb push_back
#define sz size()
#define mp make_pair
const int N = 2e5 + 5;
const int MOD = 1e9 + 7;
int ans[N];
int main() {
int n, x;
cin >> n;
for (int i = 0; i < n - 1... | replace | 12 | 13 | 12 | 13 | 0 | |
p02707 | C++ | Time Limit Exceeded | #include <algorithm>
#include <bits/stdc++.h>
#include <iostream>
#include <math.h>
#include <set>
#include <string>
#include <vector>
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> ans(n);
for (int i = 0; i < n - 1; i++... | #include <algorithm>
#include <bits/stdc++.h>
#include <iostream>
#include <math.h>
#include <set>
#include <string>
#include <vector>
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> ans(n);
for (int i = 0; i < n - 1; i++... | replace | 16 | 22 | 16 | 18 | TLE | |
p02707 | C++ | Runtime Error | ///...................SUBHASHIS MOLLICK...................///
///.....DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING....///
///.............ISLAMIC UNIVERSITY,BANGLADESH.............///
///....................SESSION-(14-15)....................///
#include <bits/stdc++.h>
using namespace std;
#define sf(a) scanf("%d", ... | ///...................SUBHASHIS MOLLICK...................///
///.....DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING....///
///.............ISLAMIC UNIVERSITY,BANGLADESH.............///
///....................SESSION-(14-15)....................///
#include <bits/stdc++.h>
using namespace std;
#define sf(a) scanf("%d", ... | replace | 53 | 54 | 53 | 55 | 0 | |
p02707 | C++ | Runtime Error | #include <iostream>
#include <vector>
using namespace std;
#define ll long long
#define pb push_back
const int maxn = 1e5 + 20;
vector<int> adj[maxn];
bool visited[maxn];
void dfs(int v) {
visited[v] = 1;
for (auto u : adj[v])
if (!visited[u])
dfs(u);
}
int main() {
ios_base::sync_with_stdio(false... | #include <iostream>
#include <vector>
using namespace std;
#define ll long long
#define pb push_back
const int maxn = 2e5 + 20;
vector<int> adj[maxn];
bool visited[maxn];
void dfs(int v) {
visited[v] = 1;
for (auto u : adj[v])
if (!visited[u])
dfs(u);
}
int main() {
ios_base::sync_with_stdio(false... | replace | 7 | 8 | 7 | 8 | 0 | |
p02707 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <deque>
#include <forward_list>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <istream>
#include <iterator>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <utility>
#include <vector>
#define ... | #include <algorithm>
#include <cmath>
#include <deque>
#include <forward_list>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <istream>
#include <iterator>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <utility>
#include <vector>
#define ... | replace | 29 | 30 | 29 | 30 | 0 | |
p02707 | C++ | Runtime Error | // #pragma GCC optimize(“O2”)
#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
#define pi 3.14159265358979323846264338327950254
#define STDIN ... | // #pragma GCC optimize(“O2”)
#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
#define pi 3.14159265358979323846264338327950254
#define STDIN ... | replace | 19 | 20 | 19 | 20 | 0 | |
p02707 | C++ | Runtime Error | #pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define fs first
#define se second
#define pi 2 * acos(0)
#define PI 3.14159265358979323846264338
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<ll, ll> pl... | #pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define fs first
#define se second
#define pi 2 * acos(0)
#define PI 3.14159265358979323846264338
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<ll, ll> pl... | replace | 54 | 55 | 54 | 55 | 0 | |
p02707 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <deque>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define next '\n'
#define sp " "
#define print(x) cout << (x)
#define println(x) cout << (x) << next
#define stop return (... | #include <algorithm>
#include <cmath>
#include <deque>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define next '\n'
#define sp " "
#define print(x) cout << (x)
#define println(x) cout << (x) << next
#define stop return (... | replace | 31 | 32 | 31 | 32 | 0 | |
p02707 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int dp[50000];
int main() {
int n;
cin >> n;
int a[n];
for (int i = 1; i < n; i++) {
cin >> a[i];
dp[a[i]]++;
}
for (int i = 1; i <= n; i++) {
cout << dp[i] << endl;
}
} | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int dp[50000000];
int main() {
int n;
cin >> n;
int a[n];
for (int i = 1; i < n; i++) {
cin >> a[i];
dp[a[i]]++;
}
for (int i = 1; i <= n; i++) {
cout << dp[i] << endl;
}
} | replace | 3 | 4 | 3 | 4 | 0 | |
p02707 | C++ | Time Limit Exceeded | #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() {
int n;
cin >> n;
vector<int> a(n - 1);
rep(i, n - 1) cin >> a.at(i);
sort(a.begin(), a.end());
rep(i, n) {
if (i < a.back()) {
cout << count(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() {
int n;
cin >> n;
vector<int> a(n + 1);
for (int i = 2; i <= n; i++) {
int num;
cin >> num;
a.at(num)++;
}
for (int i = 1; i <= n; i++) {
... | replace | 9 | 18 | 9 | 17 | TLE | |
p02707 | C++ | Runtime Error | #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[100002] = {0};
for (int i = 0; i < n - 1; i++) {
int a;
cin >> a;
arr[a]++;
}
for (int i = 1; i < n + 1; ... | #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; ... | replace | 11 | 12 | 11 | 12 | 0 | |
p02707 | C++ | Runtime Error | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
typedef long long ll;
typedef unsigned long long u_ll;
typedef pair<int, int> pair_;
const int INF = 1001001001;
const int dx[] = {-1, 0, 1, 0};
const int dy[] = {0, -1, 0, 1};
int k;
int gcd(int a, int b) {
if (b =... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
typedef long long ll;
typedef unsigned long long u_ll;
typedef pair<int, int> pair_;
const int INF = 1001001001;
const int dx[] = {-1, 0, 1, 0};
const int dy[] = {0, -1, 0, 1};
int k;
int gcd(int a, int b) {
if (b =... | replace | 32 | 33 | 32 | 35 | -6 | double free or corruption (out)
|
p02707 | C++ | Runtime Error | #define rep(i, n) for (int i = 0; i < (int)(n); i++)
#include <algorithm>
#include <iostream>
#include <string>
using namespace std;
int main() {
int p[100000] = {0};
int a, n;
cin >> n;
rep(i, n - 1) {
cin >> a;
p[a - 1]++;
}
rep(i, n) { cout << p[i] << endl; }
} | #define rep(i, n) for (int i = 0; i < (int)(n); i++)
#include <algorithm>
#include <iostream>
#include <string>
using namespace std;
int main() {
int p[200001] = {0};
int a, n;
cin >> n;
rep(i, n - 1) {
cin >> a;
p[a - 1]++;
}
rep(i, n) { cout << p[i] << endl; }
} | replace | 7 | 8 | 7 | 8 | 0 | |
p02707 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define ALL(obj) obj.begin(), obj.end()
#define SORT(obj) sort(obj.begin(), obj.end())
#define pb(obj) push_back(obj)
#define REP(i, N) for (int i = 0; i < N; i++)
typedef long long ll;
ll const MOD = 1e9 + 7;
using ll = long long;
int main() {
ll n;
cin >> n;
vector... | #include <bits/stdc++.h>
using namespace std;
#define ALL(obj) obj.begin(), obj.end()
#define SORT(obj) sort(obj.begin(), obj.end())
#define pb(obj) push_back(obj)
#define REP(i, N) for (int i = 0; i < N; i++)
typedef long long ll;
ll const MOD = 1e9 + 7;
using ll = long long;
int main() {
ll n;
cin >> n;
vector... | replace | 13 | 14 | 13 | 14 | -6 | terminate called after throwing an instance of 'std::out_of_range'
what(): vector::_M_range_check: __n (which is 4) >= this->size() (which is 4)
|
p02707 | C++ | Runtime Error | #include <bits/stdc++.h>
#define _ ios_base::sync_with_stdio(0);
#define endl "\n"
#define MAXN 100123
#define ll long long
#define INF INT_MAX
#define FORE(i, m, n) for (int i = m; i < n; i++)
#define FOR(i, n) FORE(i, 0, n)
#define ii pair<int, int>
#define vi vector<int>
#define vii vector<ii>
#define ps(v) push_bac... | #include <bits/stdc++.h>
#define _ ios_base::sync_with_stdio(0);
#define endl "\n"
#define MAXN 2 * 100123
#define ll long long
#define INF INT_MAX
#define FORE(i, m, n) for (int i = m; i < n; i++)
#define FOR(i, n) FORE(i, 0, n)
#define ii pair<int, int>
#define vi vector<int>
#define vii vector<ii>
#define ps(v) push... | replace | 3 | 4 | 3 | 4 | 0 | |
p02707 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
long long int n;
cin >> n;
long long int a[n - 1];
long long int arr[100000] = {0};
for (long long int i = 0; i < n - 1; i++) {
cin >> a[i];
arr[a[i]]++;
}
for (long long int i = 1; i <= n; i++) {
cout << arr[i] << endl;
}
} | #include <bits/stdc++.h>
using namespace std;
int main() {
long long int n;
cin >> n;
long long int a[n + 5];
long long int arr[1000000] = {0};
for (long long int i = 0; i < n - 1; i++) {
cin >> a[i];
arr[a[i]]++;
}
for (long long int i = 1; i <= n; i++) {
cout << arr[i] << endl;
}
} | replace | 5 | 7 | 5 | 7 | 0 | |
p02707 | C++ | Runtime Error | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repi(i, a, b) for (int i = int(a); i < int(b); ++i)
typedef long long ll;
long long mod = 1e9 + 7;
const int iINF = 0x3f3f3f3f;
const long long INF = 1LL << 60;
using namespace std;
template <class T> inline bool chmin(T &a, T b) {
... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repi(i, a, b) for (int i = int(a); i < int(b); ++i)
typedef long long ll;
long long mod = 1e9 + 7;
const int iINF = 0x3f3f3f3f;
const long long INF = 1LL << 60;
using namespace std;
template <class T> inline bool chmin(T &a, T b) {
... | replace | 26 | 27 | 26 | 27 | 0 | |
p02707 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int cnt[N] = {};
int main() {
ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
int n, x;
cin >> n;
for (int i = 1; i < n; i++) {
cin >> x;
cnt[x]++;
}
for (int i = 1; i <= n; i++)
cout << cnt[i] << '\n';
return 0;
} | #include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
int cnt[N] = {};
int main() {
ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
int n, x;
cin >> n;
for (int i = 1; i < n; i++) {
cin >> x;
cnt[x]++;
}
for (int i = 1; i <= n; i++)
cout << cnt[i] << '\n';
return 0;
} | replace | 2 | 3 | 2 | 3 | 0 | |
p02707 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 1e5 + 7;
const double pi = acos(-1);
const int mod = 1e9 + 7;
const double eps = 1e-8;
const int inf = 0x3f3f3f3f;
int vis[maxn];
int main() {
memset(vis, 0, sizeof(vis));
int n;
scanf("%d", &n);
for (int i = 2; i <= n; i++) ... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 2e5 + 7;
const double pi = acos(-1);
const int mod = 1e9 + 7;
const double eps = 1e-8;
const int inf = 0x3f3f3f3f;
int vis[maxn];
int main() {
memset(vis, 0, sizeof(vis));
int n;
scanf("%d", &n);
for (int i = 2; i <= n; i++) ... | replace | 3 | 4 | 3 | 4 | 0 | |
p02707 | C++ | Runtime Error | #include "bits/stdc++.h"
using namespace std;
typedef long long ll;
int main(int argc, char *argv[]) {
ll n, m, sum = 0;
cin >> n;
ll a;
ll Employee[100005] = {};
for (int i = 1; i < n; i++) {
cin >> a;
Employee[a]++;
}
for (int i = 1; i <= n; i++) {
cout << Employee[i] << endl;
}
return 0... | #include "bits/stdc++.h"
using namespace std;
typedef long long ll;
int main(int argc, char *argv[]) {
ll n, m, sum = 0;
cin >> n;
ll a;
ll Employee[200005] = {};
for (int i = 1; i < n; i++) {
cin >> a;
Employee[a]++;
}
for (int i = 1; i <= n; i++) {
cout << Employee[i] << endl;
}
return 0... | replace | 7 | 8 | 7 | 8 | 0 | |
p02707 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define pie 3.1415926
int ara[100005], ara2[100005];
int main() {
int n, i;
cin >> n;
for (i = 2; i <= n; i++) {
cin >> ara[i];
ara2[ara[i]]++;
}
for (i = 1; i <= n; i++)
cout << ara2[i] << endl;
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
#define pie 3.1415926
int ara[200020], ara2[200020];
int main() {
int n, i;
cin >> n;
for (i = 2; i <= n; i++) {
cin >> ara[i];
ara2[ara[i]]++;
}
for (i = 1; i <= n; i++)
cout << ara2[i] << endl;
return 0;
}
| replace | 3 | 4 | 3 | 4 | 0 | |
p02707 | C++ | Runtime Error | #pragma GCC optimize("Ofast")
#pragma GCC target("avx2")
// #include<bits/stdc++.h>
#include <cstdio>
#include <cstring>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep1(i, n) for (int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << ... | #pragma GCC optimize("Ofast")
#pragma GCC target("avx2")
// #include<bits/stdc++.h>
#include <cstdio>
#include <cstring>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep1(i, n) for (int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << ... | replace | 21 | 22 | 21 | 22 | 0 | |
p02707 | C++ | Runtime Error | #include <iostream>
using namespace std;
int main() {
int N;
const int n = 100000;
int A[n];
int M[n] = {0};
cin >> N;
for (int i = 0; i < N - 1; i++) {
cin >> A[i];
M[A[i]] += 1;
}
for (int i = 1; i < N + 1; i++) {
cout << M[i] << endl;
}
} | #include <iostream>
using namespace std;
int main() {
int N;
const int n = 1000000;
int A[n];
int M[n] = {0};
cin >> N;
for (int i = 0; i < N - 1; i++) {
cin >> A[i];
M[A[i]] += 1;
}
for (int i = 1; i < N + 1; i++) {
cout << M[i] << endl;
}
} | replace | 4 | 5 | 4 | 5 | 0 | |
p02707 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
/*#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
template<typename T> using gpp_set = tree<T, null_type, less<T>, rb_tree_tag,
tree_order_statistics_node_update>; template<typename T, typename L> using
gpp_map = tre... | #include <bits/stdc++.h>
using namespace std;
/*#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
template<typename T> using gpp_set = tree<T, null_type, less<T>, rb_tree_tag,
tree_order_statistics_node_update>; template<typename T, typename L> using
gpp_map = tre... | replace | 109 | 114 | 109 | 111 | TLE | |
p02707 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <cstring>
#include <iostream>
#include <string>
using namespace std;
int cnt[100005];
int main() {
int n, x;
cin >> n;
for (int i = 0; i < n - 1; i++) {
cin >> x;
cnt[x]++;
}
for (int i = 1; i <= n; i++) {
cout << cnt[i] << endl;
}
return 0;
}
| #include <algorithm>
#include <cmath>
#include <cstring>
#include <iostream>
#include <string>
using namespace std;
int cnt[10000005];
int main() {
int n, x;
cin >> n;
for (int i = 0; i < n - 1; i++) {
cin >> x;
cnt[x]++;
}
for (int i = 1; i <= n; i++) {
cout << cnt[i] << endl;
}
return 0;
}
| replace | 6 | 7 | 6 | 7 | 0 | |
p02707 | C++ | Runtime Error | #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... | replace | 14 | 15 | 14 | 15 | 0 | |
p02707 | Python | Time Limit Exceeded | n = int(input())
a = map(int, input().split())
a = list(a)
for i in range(n):
count = 0
for j in range(i, n - 1):
if a[j] == i + 1:
count += 1
print(count)
| n = int(input())
a = map(int, input().split())
a = list(a)
result = [0] * n
for i in range(n - 1):
result[a[i] - 1] += 1
print(*result, sep="\n")
| replace | 4 | 10 | 4 | 9 | TLE | |
p02707 | C++ | Runtime Error | #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... | replace | 10 | 11 | 10 | 11 | 0 | |
p02707 | C++ | Runtime Error | #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; 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) ... | replace | 15 | 17 | 15 | 17 | -6 | terminate called after throwing an instance of 'std::out_of_range'
what(): vector::_M_range_check: __n (which is 4) >= this->size() (which is 4)
|
p02707 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <math.h>
#include <vector>
using namespace std;
int main() {
long long N;
cin >> N;
vector<long long> A(N, 0);
for (int i = 1; i < N; i++)
cin >> A[i];
vector<long long> ANS(N, 0);
for (int i = 0; i < N; i++)
ANS[A[i] - 1]++;
for (int i = 0; i < ... | #include <algorithm>
#include <iostream>
#include <math.h>
#include <vector>
using namespace std;
int main() {
long long N;
cin >> N;
vector<long long> A(N, 0);
for (int i = 1; i < N; i++)
cin >> A[i];
vector<long long> ANS(N, 0);
for (int i = 1; i < N; i++)
ANS[A[i] - 1]++;
for (int i = 0; i < ... | replace | 14 | 15 | 14 | 15 | -6 | munmap_chunk(): invalid pointer
|
p02707 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <math.h>
#include <vector>
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> ans(n);
for (int i = 0; i < n; i++) {
ans[(A[i] - 1)] += 1;
}
for (int i = 0; i < n; i++) {
... | #include <algorithm>
#include <iostream>
#include <math.h>
#include <vector>
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> ans(n);
for (int i = 1; i < n; i++) {
int supervisor = A[i] - 1;
ans[supervisor] += 1;
}
f... | replace | 14 | 16 | 14 | 17 | -6 | double free or corruption (out)
|
p02707 | C++ | Time Limit Exceeded | #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() {
int n;
cin >> n;
vector<int> a(n - 1);
vector<int> b(n, 0);
rep(i, n - 1) cin >> a[i];
sort(a.begin(), a.end());
rep(i, n - 1) {
for (int j = i; j... | #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() {
int n;
cin >> n;
vector<int> a(n - 1);
vector<int> b(n, 0);
rep(i, n - 1) cin >> a[i];
sort(a.begin(), a.end());
int i = 1, j = 0;
while (i < n) {
... | replace | 13 | 21 | 13 | 22 | TLE | |
p02707 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define INF 0x3f3f3f3f
#define LINF 0x3f3f3f3f3f3f3f3f
#define ms memset
// #define MAXN 10005
// #define MAXM 100005
#define pi 3.14159265359
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pair<int, int>> vpii;
typedef long long l... | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define INF 0x3f3f3f3f
#define LINF 0x3f3f3f3f3f3f3f3f
#define ms memset
// #define MAXN 10005
// #define MAXM 100005
#define pi 3.14159265359
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pair<int, int>> vpii;
typedef long long l... | replace | 19 | 20 | 19 | 20 | 0 | |
p02707 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
int main() {
int n;
cin >> n;
vector<int> a(n - 1);
vector<int> b(200000);
int ans = 0;
rep(i, n - 1) {
cin >> a.at(i);
b.at(a.at(i))++;
}
... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
int main() {
int n;
cin >> n;
vector<int> a(n - 1);
vector<int> b(200200);
int ans = 0;
rep(i, n - 1) {
cin >> a.at(i);
b.at(a.at(i))++;
}
... | replace | 9 | 10 | 9 | 10 | 0 | |
p02707 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define LL long long
#define REP(i, n) for (LL i = 0; i < (int)(n); i++)
#define FOR(i, m, n) for (LL i = m; i n; i++)
#define SORT(x) sort(x.begin(), x.end())
#define REVE(x) reverse(x.begin(), x.end())
#define all(x) (x).begin(), (x).end()
#define int long long
struct ini... | #include <bits/stdc++.h>
using namespace std;
#define LL long long
#define REP(i, n) for (LL i = 0; i < (int)(n); i++)
#define FOR(i, m, n) for (LL i = m; i n; i++)
#define SORT(x) sort(x.begin(), x.end())
#define REVE(x) reverse(x.begin(), x.end())
#define all(x) (x).begin(), (x).end()
#define int long long
struct ini... | replace | 18 | 19 | 18 | 19 | -11 | |
p02707 | C++ | Runtime Error | /*! at-abc163c.cc
* 2020-04-30
* GCC+17
* Type (opt):
* Notes (opt):
*/
#include <cstdio>
using llu = long long unsigned;
using ll = long long;
int main(void) {
int co[100001];
llu n, i, a;
scanf("%llu", &n);
for (i = 1; i < n; i++) {
// printf("%d", i);
scanf("%llu", &a);
co[a]++;... | /*! at-abc163c.cc
* 2020-04-30
* GCC+17
* Type (opt):
* Notes (opt):
*/
#include <cstdio>
using llu = long long unsigned;
using ll = long long;
int main(void) {
int co[1000000];
llu n, i, a;
scanf("%llu", &n);
for (i = 1; i < n; i++) {
// printf("%d", i);
scanf("%llu", &a);
co[a]++... | replace | 11 | 12 | 11 | 12 | 0 | |
p02707 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int n;
vector<int> A;
ll cnt[20001];
void solve() {
for (int i = 0; i < n; i++) {
cnt[i] = 0;
}
for (auto &e : A) {
cnt[e - 1]++;
}
for (int i = 0; i < n; i++)
cout << cnt[i] << endl;
}
int main() {
cin >> n;
for (int i = ... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int n;
vector<int> A;
int cnt[200000];
void solve() {
for (int i = 0; i < n; i++) {
cnt[i] = 0;
}
for (auto &e : A) {
cnt[e - 1]++;
}
for (int i = 0; i < n; i++)
cout << cnt[i] << endl;
}
int main() {
cin >> n;
for (int i ... | replace | 7 | 8 | 7 | 8 | 0 | |
p02707 | C++ | Runtime Error | #include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repi(i, a, b) for (int i = int(a); i < int(b); ++i)
#define all(x) (x).begin(), (x).end()
using namespace std;
int main() {
int n;
cin >> n;
int stuff[n], boss[200010] = {0};
repi(i, 1, n) cin >> stuff[i];
... | #include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repi(i, a, b) for (int i = int(a); i < int(b); ++i)
#define all(x) (x).begin(), (x).end()
using namespace std;
int main() {
int n;
cin >> n;
int stuff[n], boss[200010] = {0};
for (int i = 2; i <= n; i++)
... | replace | 10 | 13 | 10 | 15 | -11 | |
p02707 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#include <map>
#include <string>
#include <vector>
#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() {
int n;
cin >> n;
vector<int> a(n);
rep(i, n) cin >> a[i];
sort(a.begin(), a.end());
for (int j = 1; j... | #include <bits/stdc++.h>
#include <map>
#include <string>
#include <vector>
#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() {
int n;
cin >> n;
vector<int> a(n - 1);
rep(i, n - 1) cin >> a[i];
vector<int> ans(n);
rep(i, n - 1) a... | replace | 12 | 23 | 12 | 17 | TLE | |
p02707 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 1; i < (int)(n); i++)
#define ll long long
#define BIT_FLAG_0 (1 << 0) // 0000 0000 0000 0001
#define BIT_FLAG_1 (1 << 1) // 0000 0000 0000 0010
#define BIT_FLAG_2 (1 << 2) // 0000 0000 0000 0100
#define BIT_FLAG_3 (1 << 3) // 0000 0000 0000 1... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 1; i < (int)(n); i++)
#define ll long long
#define BIT_FLAG_0 (1 << 0) // 0000 0000 0000 0001
#define BIT_FLAG_1 (1 << 1) // 0000 0000 0000 0010
#define BIT_FLAG_2 (1 << 2) // 0000 0000 0000 0100
#define BIT_FLAG_3 (1 << 3) // 0000 0000 0000 1... | replace | 16 | 17 | 16 | 17 | 0 | |
p02707 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
vector<int> A(N);
vector<int> B(N);
A.at(0) = 0;
for (int i = 1; i < N; i++) {
cin >> A.at(i);
}
for (int i = 0; i < N - 1; i++) {
B.at(i) = 0;
for (int j = i + 1; j < N; j++) {
if (i + 1 == A.at(j)) {
... | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
vector<int> A(N);
vector<int> B(N);
A.at(0) = 0;
for (int i = 1; i < N; i++) {
cin >> A.at(i);
}
for (int i = 1; i < N; i++) {
B.at(A.at(i) - 1)++;
}
for (int i = 0; i < N; i++) {
cout << B.at(i) << endl;
}
} | replace | 12 | 19 | 12 | 14 | TLE | |
p02707 | C++ | Runtime Error | #include "bits/stdc++.h"
using namespace std;
#define watch(x) cout << (#x) << " is " << (x) << endl
const int maxn = 1e5 + 5;
int cnt[maxn];
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int n;
cin >> n;
int a;
for (int i = 2; i <= n; i++) {
cin >> a;
cnt[a]++;
}
for (int i = 1; i <=... | #include "bits/stdc++.h"
using namespace std;
#define watch(x) cout << (#x) << " is " << (x) << endl
const int maxn = 2e5 + 5;
int cnt[maxn];
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int n;
cin >> n;
int a;
for (int i = 2; i <= n; i++) {
cin >> a;
cnt[a]++;
}
for (int i = 1; i <=... | replace | 3 | 4 | 3 | 4 | 0 | |
p02707 | C++ | Runtime Error | /*-- ILSH --*/
#include "bits/stdc++.h"
using namespace std;
typedef long long int ll;
#define pb push_back
#define pop pop_back
#define mp make_pair
#define vii vector<int>
#define vll vector<ll>
#define pii pair<int, int>
#define pll pair<ll, ll>
#define vpi vector<pii>
#define vpl vector<pll>
#define fi first
#defi... | /*-- ILSH --*/
#include "bits/stdc++.h"
using namespace std;
typedef long long int ll;
#define pb push_back
#define pop pop_back
#define mp make_pair
#define vii vector<int>
#define vll vector<ll>
#define pii pair<int, int>
#define pll pair<ll, ll>
#define vpi vector<pii>
#define vpl vector<pll>
#define fi first
#defi... | replace | 51 | 52 | 51 | 52 | 0 | |
p02707 | C++ | Runtime Error | #include <algorithm>
#include <array>
#include <cfenv>
#include <cmath>
#include <deque>
#include <forward_list>
#include <fstream>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <list>
#include <map>
#include <numeric>
#include <ostream>
#include... | #include <algorithm>
#include <array>
#include <cfenv>
#include <cmath>
#include <deque>
#include <forward_list>
#include <fstream>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <list>
#include <map>
#include <numeric>
#include <ostream>
#include... | replace | 33 | 35 | 33 | 35 | 0 | |
p02707 | C++ | Runtime Error | #include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <vector>
using namespace std;
int main() {
int n, a;
cin >> n;
vector<int> vec(n, 0);
for (int i = 0; i < n; i++) {
cin >> a;
vec[--a]++;
}
for (int i = 0; i < n; i++)
cout << vec[i] << ' ';
cout << endl;
}
| #include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <vector>
using namespace std;
int main() {
int n, a;
cin >> n;
vector<int> vec(n, 0);
for (int i = 0; i < n - 1; i++) {
cin >> a;
vec[--a]++;
}
for (int i = 0; i < n; i++)
cout << vec[i] << ' ';
cout << endl;
}
| replace | 12 | 13 | 12 | 13 | 0 | |
p02707 | C++ | Runtime Error | #include <bits/stdc++.h>
#define rep(i, m, n) for (int i = m; i < n; i++)
#define pb push_back
#define ll long long
#define out(n) cout << #n << ' = ' << '\n'
using namespace std;
const int maxn = 1e5;
int a[maxn];
int ans[maxn];
int main() {
int n;
cin >> n;
rep(i, 0, n - 1) {
cin >> a[i];
ans[a[i]]+... | #include <bits/stdc++.h>
#define rep(i, m, n) for (int i = m; i < n; i++)
#define pb push_back
#define ll long long
#define out(n) cout << #n << ' = ' << '\n'
using namespace std;
const int maxn = 2e5 + 10;
int a[maxn];
int ans[maxn];
int main() {
int n;
cin >> n;
rep(i, 0, n - 1) {
cin >> a[i];
ans[a... | replace | 9 | 10 | 9 | 10 | 0 | |
p02707 | C++ | Time Limit Exceeded | #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> ans(n, 0);
for (int i = 0; i < n - 1; i++) {
for (int j = 1; j <= n; j++) {
if (j == a[i])
ans[j - 1]++;
}
}
for (in... | #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> ans(n, 0);
for (int i = 0; i < n - 1; i++) {
ans[a[i] - 1]++;
}
for (int i = 0; i < n; i++) {
cout << ans[i] << endl;
}
}
| replace | 12 | 16 | 12 | 14 | TLE | |
p02707 | C++ | Runtime Error | #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++) {
... | insert | 5 | 5 | 5 | 6 | 0 | |
p02707 | C++ | Runtime Error | #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;
}
| replace | 8 | 10 | 8 | 10 | 0 | |
p02707 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
// #include <boost/array.hpp>
// #include <boost/range/numeric.hpp>
// #include <boost/range/algorithm.hpp>
// #include <boost/multiprecision/cpp_int.hpp>
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
// using ... | #include <bits/stdc++.h>
// #include <boost/array.hpp>
// #include <boost/range/numeric.hpp>
// #include <boost/range/algorithm.hpp>
// #include <boost/multiprecision/cpp_int.hpp>
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
// using ... | replace | 65 | 68 | 65 | 71 | TLE | |
p02707 | C++ | Time Limit Exceeded | #include <iostream>
#include <stdio.h>
#include <string>
using namespace std;
int main() {
// 数値の定義
int N; // 人数
cin >> N;
int num[N]; // 上司番号{0,1,1,2,2}
int buka[N]; // 部下の数{2,2,0,0,0}
for (int i = 0; i < N; i++) { // 部下の数をループ
buka[i] = 0;
if (i > 0) {
cin >> num[i];
for (int j = 0... | #include <iostream>
#include <stdio.h>
#include <string>
using namespace std;
int main() {
// 数値の定義
int N; // 人数
cin >> N;
int num[N]; // 上司番号{0,1,1,2,2}
int buka[N]; // 部下の数{2,2,0,0,0}
for (int i = 0; i < N; i++) { // 部下の数をループ
buka[i] = 0;
if (i > 0) {
cin >> num[i];
buka[num[i] - ... | replace | 17 | 25 | 17 | 18 | TLE | |
p02707 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <queue>
#include <string.h>
#include <vector>
using namespace std;
int N, M, A[20002] = {0}, i, j, k;
int main() {
cin >> N;
for (i = 1; i < N; i++) {
cin >> k;
A[k]++;
}
for (i = 1; i <= N; i++) {
cout << A[i]... | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <queue>
#include <string.h>
#include <vector>
using namespace std;
int N, M, A[200002] = {0}, i, j, k;
int main() {
cin >> N;
for (i = 1; i < N; i++) {
cin >> k;
A[k]++;
}
for (i = 1; i <= N; i++) {
cout << A[i... | replace | 10 | 11 | 10 | 11 | 0 | |
p02707 | C++ | Time Limit Exceeded | #define _GLIBCXX_DEBUG
#include <algorithm>
#include <iostream>
#include <numeric>
#include <stdio.h>
#include <string>
#include <vector>
using namespace std;
int main() {
int n;
cin >> n;
n -= 1;
vector<int> a(200000);
vector<int> b(200000);
for (int i = 0; i < n; i++) {
cin >> a[i];
}
for (int i ... | #define _GLIBCXX_DEBUG
#include <algorithm>
#include <iostream>
#include <numeric>
#include <stdio.h>
#include <string>
#include <vector>
using namespace std;
int main() {
int n;
cin >> n;
n -= 1;
vector<int> a(200000);
vector<int> b(200000);
for (int i = 0; i < n; i++) {
cin >> a[i];
}
for (int i ... | replace | 19 | 25 | 19 | 20 | TLE | |
p02707 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int n, a[100005];
int main() {
cin >> n;
for (int i = 1; i < n; ++i) {
int x;
cin >> x;
a[x]++;
}
for (int i = 1; i <= n; ++i)
cout << a[i] << endl;
}
| #include <bits/stdc++.h>
using namespace std;
int n, a[200005];
int main() {
cin >> n;
for (int i = 1; i < n; ++i) {
int x;
cin >> x;
a[x]++;
}
for (int i = 1; i <= n; ++i)
cout << a[i] << endl;
}
| replace | 2 | 3 | 2 | 3 | 0 | |
p02707 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
int ind[maxn];
int main() {
int n;
cin >> n;
for (int i = 2; i <= n; ++i) {
int x;
cin >> x;
ind[x]++;
}
for (int i = 1; i <= n; ++i) {
cout << ind[i] << endl;
}
} | #include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 5;
int ind[maxn];
int main() {
int n;
cin >> n;
for (int i = 2; i <= n; ++i) {
int x;
cin >> x;
ind[x]++;
}
for (int i = 1; i <= n; ++i) {
cout << ind[i] << endl;
}
} | replace | 3 | 4 | 3 | 4 | 0 | |
p02707 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int a[100000];
int ans[100000];
int main() {
int n;
cin >> 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;
}
| #include <bits/stdc++.h>
using namespace std;
int a[200010];
int ans[200010];
int main() {
int n;
cin >> 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;
}
| replace | 2 | 4 | 2 | 4 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.