結果

問題 No.2334 Distinct Cards
ユーザー Maeda
提出日時 2025-04-14 16:46:10
言語 C#
(.NET 8.0.404)
結果
WA  
実行時間 -
コード長 590 bytes
コンパイル時間 8,694 ms
コンパイル使用メモリ 169,184 KB
実行使用メモリ 186,220 KB
最終ジャッジ日時 2025-04-14 16:46:22
合計ジャッジ時間 10,156 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 8 WA * 14
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.csproj を復元しました (99 ミリ秒)。
  main -> /home/judge/data/code/bin/Release/net8.0/main.dll
  main -> /home/judge/data/code/bin/Release/net8.0/publish/

ソースコード

diff #

    class Program
    {
        static void Main(string[] args)
        {
            int[] n = Array.ConvertAll(Console.ReadLine().Split(' '), num => int.Parse(num.ToString()));
            int[] cardList = Array.ConvertAll(Console.ReadLine().Split(' '), num => int.Parse(num.ToString()));
            Array.Sort(cardList);
            int count = 1;
            for(int i = 1; i < n[1]; i++)
            {
                if (cardList[i-1] != cardList[i])
                {
                    count++;
                }
            }
            Console.WriteLine(count);
        }
    }
0