結果

問題 No.706 多眼生物の調査
ユーザー tsuchinagatsuchinaga
提出日時 2019-03-03 09:32:57
言語 Go
(1.22.1)
結果
AC  
実行時間 548 ms / 2,000 ms
コード長 352 bytes
コンパイル時間 12,442 ms
コンパイル使用メモリ 210,884 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-05 17:38:23
合計ジャッジ時間 12,637 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 10 ms
4,380 KB
testcase_04 AC 42 ms
4,376 KB
testcase_05 AC 201 ms
4,376 KB
testcase_06 AC 548 ms
4,380 KB
testcase_07 AC 2 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package main

import (
	"fmt"
	"strings"
)

func main() {
	var n, max, maxI int
	_, _ = fmt.Scan(&n)

	s := ""
	is := make(map[int]int, 0)
	for i := 0; i < n; i++ {
		_, _ = fmt.Scan(&s)
		c := strings.Count(s, "^")
		is[c]++
		if max < is[c] {
			max = is[c]
			maxI = c
		} else if max == is[c] && maxI < c {
			maxI = c
		}
	}

	fmt.Println(maxI)
}
0