結果

問題 No.975 ミスターマックスバリュ
コンテスト
ユーザー tanson
提出日時 2025-12-18 00:19:13
言語 Standard ML
(MLton 20210117)
結果
AC  
実行時間 26 ms / 2,000 ms
コード長 767 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 3,066 ms
コンパイル使用メモリ 689,532 KB
実行使用メモリ 12,704 KB
最終ジャッジ日時 2025-12-18 00:19:17
合計ジャッジ時間 4,254 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 9
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

fun readInt () =
    valOf (TextIO.scanStream (Int.scan StringCvt.DEC) TextIO.stdIn)


val () =
    let
        val x = readInt ()
        val n = readInt ()
        val m = readInt ()
        val a_s = List.tabulate (n, fn _ => readInt ())
        val b_s = List.tabulate (m, fn _ => readInt ())

        val isExistMrMax =
            List.exists
                (fn a => a = x)
                a_s
        val isExistMaxValu =
            List.exists
                (fn b => b = x)
                b_s
        
        val ans = if isExistMrMax andalso isExistMaxValu then "MrMaxValu"
                  else if isExistMrMax then "MrMax"
                  else if isExistMaxValu then "MaxValu"
                  else "-1"
    in
        print (ans ^ "\n")
    end
0