Submission #12131838


Source Code Expand

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

typedef long long ll;
typedef long double ld;

int MOD=1000000007;


int main(){
    ll N,count=1;
    cin >> N;
    ll A[N+10]={},B[N+10]={};
    for(ll i=0; i<N-1; i++){
        cin >> A[i];
    }
    sort(A,A+N-1);
        for(ll i=0; i<N-1; i++){
            B[A[i]]++;
    }
    for(ll i=1; i<=N; i++){
            cout << B[i] << endl;
    }
    }

Submission Info

Submission Time
Task C - management
User onitakenoko
Language C++ (GCC 9.2.1)
Score 300
Code Size 502 Byte
Status AC
Exec Time 329 ms
Memory 6768 KiB

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:15:10: warning: unused variable ‘count’ [-Wunused-variable]
   15 |     ll N,count=1;
      |          ^~~~~

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 3
AC × 15
Set Name Test Cases
Sample sample_01, sample_02, sample_03
All binary_01, binary_02, line_01, line_02, random_01, random_02, random_03, random_04, sample_01, sample_02, sample_03, small_01, star_01, star_02, star_03
Case Name Status Exec Time Memory
binary_01 AC 311 ms 6520 KiB
binary_02 AC 318 ms 6576 KiB
line_01 AC 308 ms 6648 KiB
line_02 AC 319 ms 6676 KiB
random_01 AC 329 ms 6692 KiB
random_02 AC 260 ms 6088 KiB
random_03 AC 273 ms 6080 KiB
random_04 AC 112 ms 4620 KiB
sample_01 AC 3 ms 3640 KiB
sample_02 AC 2 ms 3572 KiB
sample_03 AC 2 ms 3392 KiB
small_01 AC 2 ms 3596 KiB
star_01 AC 288 ms 6768 KiB
star_02 AC 288 ms 6764 KiB
star_03 AC 298 ms 6696 KiB