結果

問題 No.79 過小評価ダメ・ゼッタイ
ユーザー k.h
提出日時 2019-08-04 11:02:33
言語 Go
(1.23.4)
結果
AC  
実行時間 7 ms / 5,000 ms
コード長 437 bytes
コンパイル時間 15,624 ms
コンパイル使用メモリ 217,288 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-07-07 22:22:48
合計ジャッジ時間 13,976 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

package main

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

func main() {
	var N, t, answer, max int
	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)
	sc.Scan()
	N, _ = strconv.Atoi(sc.Text())
	m := make(map[int]int, 6)
	for i := 0; i < N; i++ {
		sc.Scan()
		t, _ = strconv.Atoi(sc.Text())
		m[t]++
	}
	for k, v := range m {
		if (v > max) || (v == max && k > answer) {
			answer = k
			max = v
		}
	}
	fmt.Println(answer)
}
0