Language: C

package main

import (
	"bufio"
	"fmt"
	"log"
	"math"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)
var buff []byte

func init() {
	sc.Split(bufio.ScanWords)
	sc.Buffer(buff, bufio.MaxScanTokenSize*1024)
	log.SetFlags(log.Lshortfile)
}

func main() {
	N := nextInt()
	A := nextInts(N - 1)
	ans := make([]int, N+1)
	for _, a := range A {
		ans[a]++
	}
	for i := 1; i <= N; i++ {
		fmt.Println(ans[i])
	}
}

func nextString() string {
	sc.Scan()
	return sc.Text()
}

func nextFloat64() float64 {
	sc.Scan()
	f, err := strconv.ParseFloat(sc.Text(), 64)
	if err != nil {
		panic(err)
	}
	return f
}

func nextInt() int {
	sc.Scan()
	i, err := strconv.Atoi(sc.Text())
	if err != nil {
		panic(err)
	}
	return i
}

func nextInts(n int) (r []int) {
	r = make([]int, n)
	for i := 0; i < n; i++ {
		r[i] = nextInt()
	}
	return r
}

var dy = []int{0, 1, 0, -1}
var dx = []int{1, 0, -1, 0}
var MAX = math.MaxInt32

func pow(a, b int) int {
	return int(math.Pow(float64(a), float64(b)))
}

func lcm(a, b int) int {
	return a * b / gcd(a, b)
}
func gcd(a, b int) int {
	if a < b {
		a, b = b, a
	}
	for b != 0 {
		a, b = b, a%b
	}
	return a
}
func max(a ...int) int {
	r := a[0]
	for i := 0; i < len(a); i++ {
		if r < a[i] {
			r = a[i]
		}
	}
	return r
}
func min(a ...int) int {
	r := a[0]
	for i := 0; i < len(a); i++ {
		if r > a[i] {
			r = a[i]
		}
	}
	return r
}
func sum(a []int) (r int) {
	for i := range a {
		r += a[i]
	}
	return r
}
func abs(a int) int {
	if a < 0 {
		return -a
	}
	return a
}

type Pair struct {
	a, b int
}

type Pairs []Pair

func (p Pairs) Len() int {
	return len(p)
}
func (p Pairs) Swap(i, j int) {
	p[i], p[j] = p[j], p[i]
}

func (p Pairs) Less(i, j int) bool {
	if p[i].a == p[j].a {
		return p[i].b < p[j].b
	}
	return p[i].a < p[j].a
}


Compiler output:
main.c:1:1: error: unknown type name 'package'
    1 | package main
      | ^~~~~~~
main.c:3:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'import'
    3 | import (
      | ^~~~~~
main.c:21:1: error: unknown type name 'func'
   21 | func main() {
      | ^~~~
main.c: In function 'main':
main.c:22:12: error: expected expression before '=' token
   22 |         N := nextInt()
      |            ^
main.c:22:14: error: implicit declaration of function 'nextInt' [-Wimplicit-function-declaration]
   22 |         N := nextInt()
      |              ^~~~~~~
main.c:28:21: error: 'i' undeclared (first use in this function)
   28 |         for i := 1; i <= N; i++ {
      |                     ^
main.c:28:21: note: each undeclared identifier is reported only once for each function it appears in
main.c:28:26: error: 'N' undeclared (first use in this function)
   28 |         for i := 1; i <= N; i++ {
      |                          ^
main.c:28:32: error: expected ';' before '{' token
   28 |         for i := 1; i <= N; i++ {
      |                                ^~
      |                                ;
main.c: At top level:
main.c:33:1: error: unknown type name 'func'
   33 | func nextString() string {
      | ^~~~
main.c: In function 'nextString':
main.c:33:19: error: expected declaration specifiers before 'string'
   33 | func nextString() string {
      |                   ^~~~~~
main.c:38:1: error: unknown type name 'func'
   38 | func nextFloat64() float64 {
      | ^~~~
main.c:38:20: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'float64'
   38 | func nextFloat64() float64 {
      |                    ^~~~~~~
main.c:47:1: error: unknown type name 'func'
   47 | func nextInt() int {
      | ^~~~
main.c:47:16: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'int'
   47 | func nextInt() int {
      |                ^~~
main.c:56:1: error: unknown type name 'func'
   56 | func nextInts(n int) (r []int) {
      | ^~~~
main.c:56:15: error: unknown type name 'n'
   56 | func nextInts(n int) (r []int) {
      |               ^
main.c:64:1: error: unknown type name 'var'
   64 | var dy = []int{0, 1, 0, -1}
      | ^~~
main.c:64:1: error: parameter 'dy' is initialized
main.c:64:10: error: expected expression before '[' token
   64 | var dy = []int{0, 1, 0, -1}
      |          ^
main.c:65:1: error: unknown type name 'var'
   65 | var dx = []int{1, 0, -1, 0}
      | ^~~
main.c:65:1: error: parameter 'dx' is initialized
main.c:65:10: error: expected expression before '[' token
   65 | var dx = []int{1, 0, -1, 0}
      |          ^
main.c:66:1: error: unknown type name 'var'
   66 | var MAX = math.MaxInt32
      | ^~~
main.c:66:1: error: parameter 'MAX' is initialized
main.c:66:11: error: 'math' undeclared (first use in this function)
   66 | var MAX = math.MaxInt32
      |           ^~~~
main.c:68:1: error: expected ',' or ';' before 'func'
   68 | func pow(a, b int) int {
      | ^~~~
main.c:72:1: error: unknown type name 'func'
   72 | func lcm(a, b int) int {
      | ^~~~
main.c:72:14: error: expected ')' before 'int'
   72 | func lcm(a, b int) int {
      |              ^~~~
      |              )
main.c:75:1: error: unknown type name 'func'
   75 | func gcd(a, b int) int {
      | ^~~~
main.c:75:14: error: expected ')' before 'int'
   75 | func gcd(a, b int) int {
      |              ^~~~
      |              )
main.c:84:1: error: unknown type name 'func'
   84 | func max(a ...int) int {
      | ^~~~
main.c:84:11: error: expected ')' before '...' token
   84 | func max(a ...int) int {
      |           ^~~~
      |           )
main.c:93:1: error: unknown type name 'func'
   93 | func min(a ...int) int {
      | ^~~~
main.c:93:11: error: expected ')' before '...' token
   93 | func min(a ...int) int {
      |           ^~~~
      |           )
main.c:102:1: error: unknown type name 'func'
  102 | func sum(a []int) (r int) {
      | ^~~~
main.c:102:10: error: unknown type name 'a'
  102 | func sum(a []int) (r int) {
      |          ^
main.c:108:1: error: unknown type name 'func'
  108 | func abs(a int) int {
      | ^~~~
main.c:108:10: error: unknown type name 'a'
  108 | func abs(a int) int {
      |          ^
main.c:115:1: error: unknown type name 'type'; did you mean 'typeof'?
  115 | type Pair struct {
      | ^~~~
      | typeof
main.c:115:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'struct'
  115 | type Pair struct {
      |           ^~~~~~
main.c:119:1: error: unknown type name 'type'; did you mean 'typeof'?
  119 | type Pairs []Pair
      | ^~~~
      | typeof
main.c:119:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'Pair'
  119 | type Pairs []Pair
      |              ^~~~
main.c:124:1: error: expected declaration specifiers before 'func'
  124 | func (p Pairs) Swap(i, j int) {
      | ^~~~
main.c:128:1: error: expected declaration specifiers before 'func'
  128 | func (p Pairs) Less(i, j int) bool {
      | ^~~~
main.c:66:5: error: declaration for parameter 'MAX' but no such parameter
   66 | var MAX = math.MaxInt32
      |     ^~~
main.c:65:5: error: declaration for parameter 'dx' but no such parameter
   65 | var dx = []int{1, 0, -1, 0}
      |     ^~
main.c:64:5: error: declaration for parameter 'dy' but no such parameter
   64 | var dy = []int{0, 1, 0, -1}
      |     ^~
main.c:134: error: expected '{' at end of input