結果

問題 No.79 過小評価ダメ・ゼッタイ
ユーザー yukirinyukirin
提出日時 2015-05-15 17:01:55
言語 Go
(1.22.1)
結果
WA  
実行時間 -
コード長 871 bytes
コンパイル時間 12,407 ms
コンパイル使用メモリ 219,088 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-18 11:22:11
合計ジャッジ時間 11,011 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

package main

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

var sc = bufio.NewScanner(os.Stdin)

var rdr = bufio.NewReaderSize(os.Stdin, 1000000)

func nextLine() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	i, _ := strconv.Atoi(nextLine())
	return i
}

func nextFloat() float64 {
	f, _ := strconv.ParseFloat(nextLine(), 64)
	return f
}

func readLine() string {
	buf := make([]byte, 0, 1000000)
	for {
		l, p, e := rdr.ReadLine()
		if e != nil {
			panic(e)
		}
		buf = append(buf, l...)
		if !p {
			break
		}
	}
	return string(buf)
}

func main() {
	sc.Split(bufio.ScanWords)

	m := [2]int{}
	counter := make(map[int]int)

	nextInt()

	for _, v := range strings.Split(readLine(), " ") {
		i, _ := strconv.Atoi(v)
		counter[i]++
	}

	for k, v := range counter {
		if m[1] <= v && m[0] <= k {
			m[0], m[1] = k, v
		}
	}
	fmt.Println(m[0])
}
0