結果

問題 No.24 数当てゲーム
ユーザー fmhrfmhr
提出日時 2015-05-22 04:16:48
言語 Go
(1.22.1)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 526 bytes
コンパイル時間 9,873 ms
コンパイル使用メモリ 233,636 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-18 11:30:11
合計ジャッジ時間 10,421 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,816 KB
testcase_01 AC 1 ms
6,812 KB
testcase_02 AC 1 ms
6,812 KB
testcase_03 AC 1 ms
6,940 KB
testcase_04 AC 1 ms
6,948 KB
testcase_05 AC 1 ms
6,944 KB
testcase_06 AC 1 ms
6,944 KB
testcase_07 AC 1 ms
6,940 KB
testcase_08 AC 2 ms
6,940 KB
testcase_09 AC 1 ms
6,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package main

import (
	"fmt"
)

func main() {
	var n int
	fmt.Scan(&n)
	var a, b, c, d int
	var r string
	nums := make([]int, 10)
	for i := 0; i < n; i++ {
		fmt.Scan(&a, &b, &c, &d, &r)
		numsran := []int{a, b, c, d}
		if r == "NO" {
			for _, j := range numsran {
				nums[j] = -1
			}
		}
		if r == "YES" {
			for _, j := range numsran {
				if nums[j] >= 0 {
					nums[j] += 1
				}
			}
		}
	}
	max := 0
	var ans int
	for i := 0; i < 10; i++ {
		if nums[i] >= max {
			ans = i
			max = nums[i]
		}
	}
	fmt.Println(ans)
}
0