結果

問題 No.182 新規性の虜
ユーザー mencottonmencotton
提出日時 2017-12-29 21:10:21
言語 C#(csc)
(csc 3.9.0)
結果
RE  
実行時間 -
コード長 612 bytes
コンパイル時間 2,124 ms
コンパイル使用メモリ 105,028 KB
実行使用メモリ 30,136 KB
最終ジャッジ日時 2023-08-23 09:03:57
合計ジャッジ時間 5,974 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 63 ms
21,744 KB
testcase_01 AC 62 ms
19,784 KB
testcase_02 AC 62 ms
21,572 KB
testcase_03 AC 62 ms
23,632 KB
testcase_04 AC 63 ms
23,700 KB
testcase_05 AC 63 ms
21,688 KB
testcase_06 AC 62 ms
21,704 KB
testcase_07 AC 63 ms
21,648 KB
testcase_08 AC 105 ms
24,508 KB
testcase_09 AC 126 ms
28,616 KB
testcase_10 AC 118 ms
30,136 KB
testcase_11 AC 110 ms
27,004 KB
testcase_12 AC 86 ms
23,448 KB
testcase_13 AC 63 ms
23,780 KB
testcase_14 AC 64 ms
23,692 KB
testcase_15 RE -
testcase_16 AC 62 ms
21,800 KB
testcase_17 AC 64 ms
21,792 KB
testcase_18 AC 112 ms
26,708 KB
testcase_19 AC 99 ms
23,476 KB
testcase_20 AC 88 ms
22,748 KB
testcase_21 AC 116 ms
27,024 KB
testcase_22 AC 92 ms
25,624 KB
testcase_23 RE -
testcase_24 AC 114 ms
27,844 KB
testcase_25 AC 106 ms
24,272 KB
testcase_26 AC 77 ms
22,492 KB
testcase_27 AC 63 ms
21,712 KB
evil01.txt AC 122 ms
27,408 KB
evil02.txt AC 122 ms
29,484 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;

namespace Test
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            int[] x = Console.ReadLine().Split().Select(int.Parse).ToArray();
            Array.Sort(x);
            int ret = 0;
            if (x[0] != x[1]) ret++;
            for (int i = 1; i < n - 1; i++)
            {
                if (x[i - 1] != x[i] && x[i] != x[i + 1]) ret++;
            }
            if (x[n - 2] != x[n - 1]) ret++;
            Console.WriteLine(ret);
        }
    }
}
0