結果

問題 No.182 新規性の虜
ユーザー ooh_21
提出日時 2018-01-15 14:32:02
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 90 ms / 5,000 ms
コード長 1,172 bytes
コンパイル時間 2,341 ms
コンパイル使用メモリ 104,704 KB
実行使用メモリ 30,976 KB
最終ジャッジ日時 2024-12-27 20:41:14
合計ジャッジ時間 4,166 ms
ジャッジサーバーID
(参考情報)
judge4 / 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;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace lecture2018._1._15
{
    class Program
    {
        static void Main(string[] args)
        {
            string line = Console.ReadLine();
            int N = int.Parse(line);

            line = Console.ReadLine();

            string[] hoge = line.Split();

            int[] Num = new int[N];
            for(int i = 0;i < N;i++)
            {
                Num[i] = int.Parse(hoge[i]);
            }

            Dictionary<int, int> counts = new Dictionary<int,int>();
            for(int i = 0;i < N;i++)
            {
                if (counts.ContainsKey(Num[i])){
                    counts[Num[i]] += 1;
                }
                else
                {
                    counts[Num[i]] = 1;
                }
            }
            int ans = 0;
            foreach (int key in counts.Keys)
            {
                if (counts[key] == 1)
                {
                    ans++;
                }
            }

            Console.WriteLine(ans);
        }
    }
}
0