結果

問題 No.182 新規性の虜
ユーザー pirorirori_n712pirorirori_n712
提出日時 2018-07-18 01:19:34
言語 C#(csc)
(csc 3.9.0)
結果
RE  
実行時間 -
コード長 542 bytes
コンパイル時間 2,577 ms
コンパイル使用メモリ 104,068 KB
実行使用メモリ 31,084 KB
最終ジャッジ日時 2023-08-18 13:47:29
合計ジャッジ時間 6,705 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 63 ms
23,784 KB
testcase_01 AC 63 ms
21,800 KB
testcase_02 AC 63 ms
21,752 KB
testcase_03 AC 62 ms
19,688 KB
testcase_04 AC 62 ms
21,772 KB
testcase_05 AC 62 ms
21,724 KB
testcase_06 AC 62 ms
21,656 KB
testcase_07 AC 62 ms
21,660 KB
testcase_08 AC 110 ms
29,244 KB
testcase_09 AC 136 ms
29,696 KB
testcase_10 AC 127 ms
31,084 KB
testcase_11 AC 117 ms
27,684 KB
testcase_12 AC 89 ms
23,912 KB
testcase_13 AC 63 ms
21,748 KB
testcase_14 AC 63 ms
21,800 KB
testcase_15 RE -
testcase_16 AC 62 ms
21,664 KB
testcase_17 AC 64 ms
21,888 KB
testcase_18 AC 123 ms
29,640 KB
testcase_19 AC 106 ms
24,084 KB
testcase_20 AC 90 ms
22,948 KB
testcase_21 AC 131 ms
27,984 KB
testcase_22 AC 98 ms
23,628 KB
testcase_23 RE -
testcase_24 AC 123 ms
29,208 KB
testcase_25 AC 116 ms
27,512 KB
testcase_26 AC 79 ms
24,728 KB
testcase_27 AC 62 ms
23,704 KB
evil01.txt AC 130 ms
30,676 KB
evil02.txt AC 129 ms
30,796 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