結果

問題 No.975 ミスターマックスバリュ
ユーザー りあんりあん
提出日時 2020-01-31 13:26:55
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 56 ms / 2,000 ms
コード長 1,858 bytes
コンパイル時間 2,294 ms
コンパイル使用メモリ 111,656 KB
実行使用メモリ 30,608 KB
最終ジャッジ日時 2023-10-17 08:18:27
合計ジャッジ時間 3,715 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
25,500 KB
testcase_01 AC 28 ms
25,500 KB
testcase_02 AC 28 ms
25,500 KB
testcase_03 AC 29 ms
25,500 KB
testcase_04 AC 29 ms
25,500 KB
testcase_05 AC 33 ms
25,892 KB
testcase_06 AC 33 ms
25,884 KB
testcase_07 AC 33 ms
25,892 KB
testcase_08 AC 56 ms
30,608 KB
testcase_09 AC 28 ms
25,500 KB
testcase_10 AC 28 ms
25,500 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Threading;
using static util;

class Program {
    static void Main(string[] args) {
        var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
        var solver = new Solver(sw);
        // var t = new Thread(solver.solve, 1 << 26); // 64 MB
        // t.Start();
        // t.Join();
        solver.solve();
        sw.Flush();
    }
}

class Solver {
    StreamWriter sw;
    // Scan sc;
    void Prt(string a) => sw.WriteLine(a);
    void Prt<T>(IEnumerable<T> a) => Prt(string.Join(" ", a));
    void Prt(params object[] a) => Prt(string.Join(" ", a));
    public Solver(StreamWriter sw) {
        this.sw = sw;
        // this.sc = new Scan();
    }

    public void solve() {
        var (x, n, m) = new Func<(int, int, int)>(() => {
            var _ = Console.ReadLine().Split().Select(int.Parse).ToArray();
            return (_[0], _[1], _[2]);
        })();

        Assert(1 <= x, x <= 100000);
        Assert(1 <= n, n <= 100000);
        Assert(1 <= m, m <= 100000);

        var a = Console.ReadLine().Split().Select(int.Parse).ToArray();
        var b = Console.ReadLine().Split().Select(int.Parse).ToArray();
        Assert(a.Length == n);
        Assert(b.Length == m);
        Assert(1 <= a.Min(), a.Max() <= 1000000000);
        Assert(1 <= b.Min(), b.Max() <= 1000000000);

        if (a.Contains(x) && b.Contains(x)) {
            Prt("MrMaxValu");
        }
        else if (a.Contains(x)) {
            Prt("MrMax");
        }
        else if (b.Contains(x)) {
            Prt("MaxValu");
        }
        else {
            Prt("-1");
        }
    }
}

static class util {
    public static void Assert(params bool[] conds) {
        foreach (var cond in conds) if (!cond) throw new Exception();
    }
}
0