結果
| 問題 | 
                            No.349 干支の置き物
                             | 
                    
| コンテスト | |
| ユーザー | 
                             t_murano
                         | 
                    
| 提出日時 | 2016-05-14 14:39:46 | 
| 言語 | Go  (1.23.4)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 688 bytes | 
| コンパイル時間 | 11,188 ms | 
| コンパイル使用メモリ | 229,428 KB | 
| 実行使用メモリ | 6,824 KB | 
| 最終ジャッジ日時 | 2024-10-11 00:50:04 | 
| 合計ジャッジ時間 | 12,169 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge4 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 22 WA * 7 | 
ソースコード
package main
import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)
func nextInt(sc *bufio.Scanner) int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}
func nextString(sc *bufio.Scanner) string {
	sc.Scan()
	return sc.Text()
}
func maxCount(counter map[string]int) int {
	maxCount := 0
	for _, v := range counter {
		if v > maxCount {
			maxCount = v
		}
	}
	return maxCount
}
func main() {
	sc := bufio.NewScanner(os.Stdin)
	n := nextInt(sc)
	counter := make(map[string]int)
	for i := 0; i < n; i++ {
		zodiac := nextString(sc)
		counter[zodiac] += 1
	}
	mc := maxCount(counter)
	if mc > (n-1)/2 {
		fmt.Println("NO")
	} else {
		fmt.Println("YES")
	}
}
            
            
            
        
            
t_murano