結果

問題 No.182 新規性の虜
ユーザー pirorirori_n712pirorirori_n712
提出日時 2018-07-18 01:19:34
言語 C#(csc)
(csc 3.9.0)
結果
RE  
実行時間 -
コード長 542 bytes
コンパイル時間 941 ms
コンパイル使用メモリ 105,984 KB
実行使用メモリ 28,416 KB
最終ジャッジ日時 2024-05-05 18:59:03
合計ジャッジ時間 3,248 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
19,072 KB
testcase_01 AC 29 ms
18,944 KB
testcase_02 AC 30 ms
18,816 KB
testcase_03 AC 30 ms
18,944 KB
testcase_04 AC 30 ms
18,944 KB
testcase_05 AC 31 ms
19,072 KB
testcase_06 AC 28 ms
18,944 KB
testcase_07 AC 27 ms
18,816 KB
testcase_08 AC 70 ms
24,576 KB
testcase_09 AC 96 ms
28,416 KB
testcase_10 AC 84 ms
27,136 KB
testcase_11 AC 73 ms
25,216 KB
testcase_12 AC 48 ms
22,400 KB
testcase_13 AC 28 ms
19,200 KB
testcase_14 AC 26 ms
19,200 KB
testcase_15 RE -
testcase_16 AC 27 ms
18,944 KB
testcase_17 AC 27 ms
19,072 KB
testcase_18 AC 83 ms
25,216 KB
testcase_19 AC 66 ms
23,212 KB
testcase_20 AC 51 ms
21,476 KB
testcase_21 AC 90 ms
25,856 KB
testcase_22 AC 57 ms
22,660 KB
testcase_23 RE -
testcase_24 AC 81 ms
27,392 KB
testcase_25 AC 74 ms
25,088 KB
testcase_26 AC 36 ms
20,736 KB
testcase_27 AC 26 ms
18,944 KB
evil01.txt AC 88 ms
29,952 KB
evil02.txt AC 90 ms
29,952 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 No182{
    static void Main(){
        var b=Int32.Parse(Console.ReadLine());
        var a=Console.ReadLine().Split(' ').Select(x=>Int32.Parse(x)).OrderBy(x=>x).ToArray();
        var c=0;
        for(int i=0;i<b;i++){
            if(i==0){
                if(a[0]!=a[1])c++;
            }
            else if(i==b-1){
                if(a[i]!=a[i-1])c++;
            }
            else if(a[i]!=a[i+1]&&a[i-1]!=a[i]){
                c++;
            }
        }
        Console.WriteLine(c);
    }
}
0