結果

問題 No.2153 何コーダーが何人?
ユーザー eroge_mastereroge_master
提出日時 2022-12-24 00:43:56
言語 Go
(1.22.1)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 484 bytes
コンパイル時間 11,942 ms
コンパイル使用メモリ 224,588 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-29 04:43:52
合計ジャッジ時間 12,958 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
5,248 KB
testcase_01 AC 1 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 1 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 2 ms
5,376 KB
testcase_07 AC 1 ms
5,376 KB
testcase_08 AC 1 ms
5,376 KB
testcase_09 AC 2 ms
5,376 KB
testcase_10 AC 2 ms
5,376 KB
testcase_11 AC 2 ms
5,376 KB
testcase_12 AC 1 ms
5,376 KB
testcase_13 AC 1 ms
5,376 KB
testcase_14 AC 1 ms
5,376 KB
testcase_15 AC 2 ms
5,376 KB
testcase_16 AC 2 ms
5,376 KB
testcase_17 AC 2 ms
5,376 KB
testcase_18 AC 2 ms
5,376 KB
testcase_19 AC 2 ms
5,376 KB
testcase_20 AC 1 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Scan()
	n, _ := strconv.Atoi(scanner.Text())

	cnt := make([]int, 8)
	mp := make(map[string]int)

	for i := 0; i < n; i++ {
		scanner.Scan()
		input := strings.Split(scanner.Text(), " ")
		s := input[0]
		c, _ := strconv.Atoi(input[1])
		mp[s] = c
	}

	for k, v := range mp {
		cnt[v]++
		_ = k
	}

	for i := 0; i < 8; i++ {
		fmt.Println(cnt[i])
	}
}
0