結果

問題 No.182 新規性の虜
ユーザー pirorirori_n712pirorirori_n712
提出日時 2018-07-18 01:23:11
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 138 ms / 5,000 ms
コード長 619 bytes
コンパイル時間 3,073 ms
コンパイル使用メモリ 102,856 KB
実行使用メモリ 30,092 KB
最終ジャッジ日時 2023-08-18 13:54:04
合計ジャッジ時間 7,286 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 64 ms
21,612 KB
testcase_01 AC 64 ms
23,728 KB
testcase_02 AC 64 ms
21,636 KB
testcase_03 AC 64 ms
23,696 KB
testcase_04 AC 65 ms
21,820 KB
testcase_05 AC 65 ms
21,768 KB
testcase_06 AC 65 ms
23,680 KB
testcase_07 AC 65 ms
23,708 KB
testcase_08 AC 112 ms
29,144 KB
testcase_09 AC 138 ms
29,724 KB
testcase_10 AC 128 ms
28,952 KB
testcase_11 AC 118 ms
27,648 KB
testcase_12 AC 91 ms
21,764 KB
testcase_13 AC 64 ms
19,780 KB
testcase_14 AC 65 ms
21,720 KB
testcase_15 AC 62 ms
23,752 KB
testcase_16 AC 63 ms
19,660 KB
testcase_17 AC 64 ms
19,736 KB
testcase_18 AC 124 ms
25,576 KB
testcase_19 AC 106 ms
24,088 KB
testcase_20 AC 95 ms
23,016 KB
testcase_21 AC 134 ms
30,092 KB
testcase_22 AC 102 ms
25,644 KB
testcase_23 AC 62 ms
21,680 KB
testcase_24 AC 125 ms
29,056 KB
testcase_25 AC 122 ms
27,564 KB
testcase_26 AC 79 ms
22,644 KB
testcase_27 AC 64 ms
23,732 KB
evil01.txt AC 133 ms
30,784 KB
evil02.txt AC 133 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(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