結果

問題 No.1692 Expectations
ユーザー eSeF
提出日時 2020-09-30 01:07:31
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 134 ms / 2,000 ms
コード長 2,049 bytes
コンパイル時間 4,663 ms
コンパイル使用メモリ 110,920 KB
実行使用メモリ 43,776 KB
最終ジャッジ日時 2024-07-19 09:36:40
合計ジャッジ時間 5,390 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 20
権限があれば一括ダウンロードができます
コンパイルメッセージ
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);
}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
0