結果

問題 No.1692 Expectations
ユーザー eSeFeSeF
提出日時 2020-09-30 01:07:31
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 171 ms / 2,000 ms
コード長 2,049 bytes
コンパイル時間 3,274 ms
コンパイル使用メモリ 105,856 KB
実行使用メモリ 48,328 KB
最終ジャッジ日時 2023-09-26 15:30:05
合計ジャッジ時間 7,619 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 64 ms
21,872 KB
testcase_01 AC 63 ms
23,828 KB
testcase_02 AC 71 ms
22,068 KB
testcase_03 AC 72 ms
24,088 KB
testcase_04 AC 72 ms
22,092 KB
testcase_05 AC 73 ms
22,076 KB
testcase_06 AC 72 ms
22,028 KB
testcase_07 AC 61 ms
21,680 KB
testcase_08 AC 68 ms
21,844 KB
testcase_09 AC 69 ms
21,972 KB
testcase_10 AC 131 ms
38,168 KB
testcase_11 AC 132 ms
38,164 KB
testcase_12 AC 63 ms
21,856 KB
testcase_13 AC 64 ms
21,864 KB
testcase_14 AC 80 ms
25,180 KB
testcase_15 AC 148 ms
41,564 KB
testcase_16 AC 79 ms
25,388 KB
testcase_17 AC 107 ms
33,096 KB
testcase_18 AC 87 ms
26,364 KB
testcase_19 AC 171 ms
48,328 KB
testcase_20 AC 146 ms
45,896 KB
testcase_21 AC 159 ms
46,188 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.Linq;
namespace Solution
{
    class AC
    {
        static void Main(string[] args)
        {
            var (N, M) = Cin.Input<int, int>();
            var A = Cin.ReadSplitInt();
            int type = A.Distinct().Count();
            if (N == M && type == 1) { Console.WriteLine("1 1"); }
            else { Console.WriteLine($"{type} 0"); }
        }
    }
}
static class Cin
{
    public static string Str() => Console.ReadLine();
    public static int Int() => int.Parse(Cin.Str());
    public static long Long() => long.Parse(Cin.Str());
    public static double Double() => double.Parse(Cin.Str());

    private static T Conv<T>(string value) => (T)Convert.ChangeType(value, typeof(T));
    public static (T, U) ReadTuple<T, U>(string[] input) => (Conv<T>(input[0]), Conv<U>(input[1]));
    public static (T, U, V) ReadTuple<T, U, V>(string[] input) => (Conv<T>(input[0]), Conv<U>(input[1]), Conv<V>(input[2]));
    public static (T, U, V, W) ReadTuple<T, U, V, W>(string[] input) => (Conv<T>(input[0]), Conv<U>(input[1]), Conv<V>(input[2]), Conv<W>(input[3]));
    public static (T, U, V, W, X) ReadTuple<T, U, V, W, X>(string[] input) => (Conv<T>(input[0]), Conv<U>(input[1]), Conv<V>(input[2]), Conv<W>(input[3]), Conv<X>(input[4]));

    public static (T, U) Input<T, U>() => ReadTuple<T, U>(ReadSplit());
    public static (T, U, V) Input<T, U, V>() => ReadTuple<T, U, V>(ReadSplit());
    public static (T, U, V, W) Input<T, U, V, W>() => ReadTuple<T, U, V, W>(ReadSplit());
    public static (T, U, V, W, X) Input<T, U, V, W, X>() => ReadTuple<T, U, V, W, X>(ReadSplit());

    public static string[] ReadSplit() => Console.ReadLine().Split();
    public static string[] ReadSplit(char separator) => Console.ReadLine().Split(separator);
    public static int[] ReadSplitInt() => Array.ConvertAll(ReadSplit(), int.Parse);
    public static long[] ReadSplitLong() => Array.ConvertAll(ReadSplit(), long.Parse);
    public static double[] ReadSplit_Double() => Array.ConvertAll(ReadSplit(), double.Parse);
}
0