結果

問題 No.706 多眼生物の調査
ユーザー tsuchinagatsuchinaga
提出日時 2019-03-03 09:27:52
言語 Go
(1.22.1)
結果
WA  
実行時間 -
コード長 352 bytes
コンパイル時間 12,328 ms
コンパイル使用メモリ 211,092 KB
実行使用メモリ 4,356 KB
最終ジャッジ日時 2023-09-05 17:38:09
合計ジャッジ時間 13,834 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,356 KB
testcase_01 AC 1 ms
4,352 KB
testcase_02 AC 1 ms
4,356 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 2 ms
4,356 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