結果

問題 No.182 新規性の虜
ユーザー funakoshifunakoshi
提出日時 2019-06-26 13:57:41
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 115 ms / 5,000 ms
コード長 1,213 bytes
コンパイル時間 2,220 ms
コンパイル使用メモリ 100,248 KB
実行使用メモリ 29,108 KB
最終ジャッジ日時 2023-09-07 03:13:11
合計ジャッジ時間 6,159 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 58 ms
20,772 KB
testcase_01 AC 56 ms
20,764 KB
testcase_02 AC 57 ms
20,732 KB
testcase_03 AC 57 ms
20,684 KB
testcase_04 AC 58 ms
22,920 KB
testcase_05 AC 57 ms
18,732 KB
testcase_06 AC 57 ms
20,768 KB
testcase_07 AC 56 ms
20,680 KB
testcase_08 AC 97 ms
23,588 KB
testcase_09 AC 115 ms
25,948 KB
testcase_10 AC 107 ms
27,168 KB
testcase_11 AC 101 ms
26,048 KB
testcase_12 AC 80 ms
24,436 KB
testcase_13 AC 57 ms
22,648 KB
testcase_14 AC 57 ms
20,680 KB
testcase_15 AC 56 ms
22,872 KB
testcase_16 AC 58 ms
20,940 KB
testcase_17 AC 60 ms
20,816 KB
testcase_18 AC 101 ms
25,876 KB
testcase_19 AC 90 ms
22,672 KB
testcase_20 AC 80 ms
23,964 KB
testcase_21 AC 107 ms
26,176 KB
testcase_22 AC 84 ms
22,792 KB
testcase_23 AC 55 ms
18,604 KB
testcase_24 AC 104 ms
29,108 KB
testcase_25 AC 97 ms
25,436 KB
testcase_26 AC 73 ms
23,708 KB
testcase_27 AC 58 ms
22,640 KB
evil01.txt AC 109 ms
26,660 KB
evil02.txt AC 107 ms
30,684 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
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 yukicoderTest
{
    class Program
    {
        static void Main(string[] args)
        {
            string input = Console.ReadLine();
            string findlist = Console.ReadLine();
            string[] list = findlist.Split(' ');
            int[] num = new int[list.Length];
            int Newcnt = int.Parse(input);
            bool flg = false;
            for (int i = 0; i < num.Length; i++) 
            {
                num[i] = int.Parse(list[i]);
            }
            Array.Sort(num);
            for (int i = 0; i < num.Length - 1; i++)
            {
                if (num[i] == num[i+1])
                {
                    if(flg==false)
                    {
                        Newcnt -= 2;
                        flg = true;
                    }
                    else
                    {
                        Newcnt--;
                    }

                }
                else
                {
                    flg = false;
                }
                
            }

            Console.WriteLine(Newcnt);
        }

    }
}
0