結果

問題 No.182 新規性の虜
ユーザー pirorirori_n712pirorirori_n712
提出日時 2018-07-18 01:23:11
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 103 ms / 5,000 ms
コード長 619 bytes
コンパイル時間 3,410 ms
コンパイル使用メモリ 111,072 KB
実行使用メモリ 34,620 KB
最終ジャッジ日時 2024-05-05 19:05:44
合計ジャッジ時間 4,966 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
27,244 KB
testcase_01 AC 32 ms
25,308 KB
testcase_02 AC 33 ms
25,268 KB
testcase_03 AC 33 ms
27,484 KB
testcase_04 AC 32 ms
23,224 KB
testcase_05 AC 32 ms
25,132 KB
testcase_06 AC 31 ms
25,308 KB
testcase_07 AC 32 ms
27,344 KB
testcase_08 AC 77 ms
30,468 KB
testcase_09 AC 103 ms
33,188 KB
testcase_10 AC 93 ms
34,620 KB
testcase_11 AC 84 ms
32,904 KB
testcase_12 AC 56 ms
29,568 KB
testcase_13 AC 33 ms
25,300 KB
testcase_14 AC 33 ms
27,248 KB
testcase_15 AC 31 ms
27,212 KB
testcase_16 AC 33 ms
25,304 KB
testcase_17 AC 33 ms
25,308 KB
testcase_18 AC 91 ms
31,136 KB
testcase_19 AC 74 ms
29,792 KB
testcase_20 AC 58 ms
26,932 KB
testcase_21 AC 98 ms
31,132 KB
testcase_22 AC 65 ms
27,572 KB
testcase_23 AC 31 ms
25,132 KB
testcase_24 AC 89 ms
32,608 KB
testcase_25 AC 83 ms
31,064 KB
testcase_26 AC 45 ms
28,400 KB
testcase_27 AC 33 ms
27,092 KB
evil01.txt AC 96 ms
32,272 KB
evil02.txt AC 97 ms
36,200 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(b==1){
            c=1;
            break;
            }
            else 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