結果
| 問題 | 
                            No.1692 Expectations
                             | 
                    
| コンテスト | |
| ユーザー | 
                             bluemegane
                         | 
                    
| 提出日時 | 2021-10-02 07:06:47 | 
| 言語 | C#(csc)  (csc 3.9.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 678 bytes | 
| コンパイル時間 | 3,844 ms | 
| コンパイル使用メモリ | 109,776 KB | 
| 実行使用メモリ | 52,572 KB | 
| 最終ジャッジ日時 | 2024-07-20 01:41:02 | 
| 合計ジャッジ時間 | 3,389 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge1 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 1 WA * 1 | 
| other | AC * 16 WA * 4 | 
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System.Collections.Generic;
using System.Linq;
using System;
public class Hello
{
    static void Main()
    {
        string[] line = Console.ReadLine().Trim().Split(' ');
        var n = int.Parse(line[0]);
        var m = int.Parse(line[1]);
        line = Console.ReadLine().Trim().Split(' ');
        var a = Array.ConvertAll(line, int.Parse);
        getAns(n, m, a);
    }
    static void getAns(int n, int m, int[] a)
    {
        int ansmax, ansmin;
        var hs = new HashSet<int>();
        for (int i = 0; i < n; i++) hs.Add(a[i]);
        ansmax = hs.Count();
        ansmin = n == m ? 1 : 0;
        Console.WriteLine("{0} {1}", ansmax, ansmin);
    }
}
            
            
            
        
            
bluemegane