結果

問題 No.182 新規性の虜
ユーザー excnct
提出日時 2025-01-02 00:06:49
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 398 bytes
コンパイル時間 296 ms
コンパイル使用メモリ 12,160 KB
実行使用メモリ 20,172 KB
最終ジャッジ日時 2025-01-02 00:06:53
合計ジャッジ時間 3,617 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 9 WA * 16 RE * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    n = int(input())
    a = [int(i) for i in input().split(" ")]
    sorted_a = sorted(a)
    count = 0
    for i in range(1, n - 1):
        if sorted_a[i] != sorted_a[i + 1] and sorted_a[i] != sorted_a[i - 1]:
            count += 1

    if sorted_a[0] != sorted_a[1] or sorted_a[n - 2] != sorted_a[n - 1]:
        count += 1

    print(count)


if __name__ == "__main__":
    main()
0