結果

問題 No.182 新規性の虜
ユーザー ooh_23
提出日時 2018-01-15 11:41:44
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 95 ms / 5,000 ms
コード長 1,100 bytes
コンパイル時間 1,920 ms
コンパイル使用メモリ 104,064 KB
実行使用メモリ 32,512 KB
最終ジャッジ日時 2024-12-27 20:40:24
合計ジャッジ時間 4,422 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 27
権限があれば一括ダウンロードができます
コンパイルメッセージ
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.Text;
using System.Threading.Tasks;

namespace ConsoleApplication5
{
    class Program
    {
        static void Main(string[] args)
        {
            Dictionary<string, int> seisu = new Dictionary<string, int>();

            string row = Console.ReadLine();
            int N = int.Parse(row);

            row = Console.ReadLine();
            // 空白区切りで一旦文字列の配列に区切る
            string[] A = row.Split();

            for (int j = 0; j < N; j++)
            {
                string num = A[j];
                if (seisu.ContainsKey(num))
                {
                    seisu[num] += 1;
                }
                else
                {
                    seisu[num] = 1;
                }
            }
            int count = 0;
            foreach(string key in seisu.Keys)
            {
                if(seisu[key] == 1)
                {
                    count++;
                }
            }

            Console.WriteLine(count);
        }
    }
}
0