結果

問題 No.706 多眼生物の調査
コンテスト
ユーザー tsuchinaga
提出日時 2019-03-03 09:27:52
言語 Go
(1.26.1)
コンパイル:
env GOCACHE=/tmp go build _filename_
実行:
./Main
結果
WA  
実行時間 -
コード長 352 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 14,026 ms
コンパイル使用メモリ 296,504 KB
実行使用メモリ 7,844 KB
最終ジャッジ日時 2026-03-08 08:21:54
合計ジャッジ時間 15,130 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 1 WA * 4
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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