結果

問題 No.182 新規性の虜
ユーザー mencottonmencotton
提出日時 2017-12-29 21:11:32
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 126 ms / 5,000 ms
コード長 743 bytes
コンパイル時間 3,821 ms
コンパイル使用メモリ 102,080 KB
実行使用メモリ 28,956 KB
最終ジャッジ日時 2023-08-27 16:58:01
合計ジャッジ時間 6,146 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 64 ms
23,648 KB
testcase_01 AC 63 ms
23,812 KB
testcase_02 AC 64 ms
23,736 KB
testcase_03 AC 64 ms
23,740 KB
testcase_04 AC 63 ms
21,552 KB
testcase_05 AC 64 ms
21,664 KB
testcase_06 AC 64 ms
21,756 KB
testcase_07 AC 64 ms
21,712 KB
testcase_08 AC 105 ms
28,520 KB
testcase_09 AC 126 ms
26,568 KB
testcase_10 AC 119 ms
28,240 KB
testcase_11 AC 111 ms
28,956 KB
testcase_12 AC 87 ms
21,280 KB
testcase_13 AC 64 ms
23,812 KB
testcase_14 AC 63 ms
23,704 KB
testcase_15 AC 56 ms
21,512 KB
testcase_16 AC 64 ms
23,700 KB
testcase_17 AC 63 ms
21,720 KB
testcase_18 AC 109 ms
26,724 KB
testcase_19 AC 99 ms
25,508 KB
testcase_20 AC 87 ms
22,704 KB
testcase_21 AC 117 ms
27,016 KB
testcase_22 AC 95 ms
21,740 KB
testcase_23 AC 58 ms
21,636 KB
testcase_24 AC 115 ms
27,980 KB
testcase_25 AC 108 ms
26,320 KB
testcase_26 AC 79 ms
20,492 KB
testcase_27 AC 63 ms
21,616 KB
evil01.txt AC 123 ms
29,432 KB
evil02.txt AC 122 ms
29,540 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());
            if (n == 1) Console.WriteLine(1);
            else
            {
                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