結果

問題 No.975 ミスターマックスバリュ
ユーザー kat0rikkat0rik
提出日時 2020-02-01 21:11:08
言語 Go
(1.22.1)
結果
AC  
実行時間 6 ms / 2,000 ms
コード長 638 bytes
コンパイル時間 11,383 ms
コンパイル使用メモリ 217,656 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-19 00:21:36
合計ジャッジ時間 12,008 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

package main

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

func nextInt(sc *bufio.Scanner) int {
	sc.Scan()
	t, _ := strconv.Atoi(sc.Text())
	return t
}

func main() {
	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)
	X := nextInt(sc)
	N := nextInt(sc)
	M := nextInt(sc)
	var v int
	var ok1, ok2 bool
	for i := 0; i < N; i++ {
		v = nextInt(sc)
		if v == X {
			ok1 = true
		}
	}
	for i := 0; i < M; i++ {
		v = nextInt(sc)
		if v == X {
			ok2 = true
		}
	}
	var ans string
	if ok1 && ok2 {
		ans = "MrMaxValu"
	} else if ok1 {
		ans = "MrMax"
	} else if ok2 {
		ans = "MaxValu"
	} else {
		ans = "-1"
	}
	fmt.Println(ans)
}
0