結果

問題 No.182 新規性の虜
ユーザー しらゆきしらゆき
提出日時 2015-11-19 09:03:11
言語 C#(csc)
(csc 3.9.0)
結果
RE  
実行時間 -
コード長 530 bytes
コンパイル時間 3,290 ms
コンパイル使用メモリ 103,112 KB
実行使用メモリ 30,616 KB
最終ジャッジ日時 2023-10-11 18:03:02
合計ジャッジ時間 7,604 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 60 ms
21,768 KB
testcase_01 AC 61 ms
21,688 KB
testcase_02 AC 61 ms
21,720 KB
testcase_03 AC 61 ms
21,636 KB
testcase_04 AC 60 ms
19,696 KB
testcase_05 AC 59 ms
21,504 KB
testcase_06 AC 61 ms
21,620 KB
testcase_07 AC 61 ms
23,520 KB
testcase_08 AC 101 ms
26,448 KB
testcase_09 AC 121 ms
30,616 KB
testcase_10 AC 116 ms
27,952 KB
testcase_11 AC 106 ms
26,716 KB
testcase_12 AC 85 ms
23,284 KB
testcase_13 AC 61 ms
23,516 KB
testcase_14 AC 61 ms
23,656 KB
testcase_15 RE -
testcase_16 AC 61 ms
21,608 KB
testcase_17 AC 61 ms
23,548 KB
testcase_18 AC 106 ms
26,624 KB
testcase_19 AC 96 ms
25,392 KB
testcase_20 AC 83 ms
24,484 KB
testcase_21 AC 112 ms
29,012 KB
testcase_22 AC 90 ms
23,420 KB
testcase_23 RE -
testcase_24 AC 110 ms
27,944 KB
testcase_25 AC 102 ms
24,316 KB
testcase_26 AC 76 ms
22,296 KB
testcase_27 AC 61 ms
23,708 KB
evil01.txt AC 118 ms
29,344 KB
evil02.txt AC 117 ms
29,508 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.Linq;

class Program
{
    static void Main()
    {
        int n = int.Parse(Console.ReadLine());
        int[] a = Console.ReadLine().Split().Select(int.Parse).ToArray();

        Array.Sort(a);
        int cnt = 0;

        for (int i = 0; i < n - 2; i++)
        {
            if (a[i] != a[i + 1] && a[i + 1] != a[i + 2])
            {
                cnt++;
            }
        }

        if (a[0] != a[1]) cnt++;
        if (a[n - 2] != a[n - 1]) cnt++;

        Console.WriteLine(cnt);
    }
}
0