結果

問題 No.182 新規性の虜
ユーザー HIROPON87069639
提出日時 2016-02-14 00:25:37
言語 Python2
(2.7.18)
結果
AC  
実行時間 139 ms / 5,000 ms
コード長 336 bytes
コンパイル時間 469 ms
コンパイル使用メモリ 6,784 KB
実行使用メモリ 14,924 KB
最終ジャッジ日時 2024-12-27 00:55:36
合計ジャッジ時間 3,410 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 27
権限があれば一括ダウンロードができます

ソースコード

diff #

N = input()
Alist = []
Alist = map(int, raw_input().split())
Alist.sort()
cnt = 0
if N != 1:
    for i in range(1, N-1):
        if Alist[i-1] != Alist[i] and Alist[i] != Alist[i+1]:
            cnt = cnt + 1
    if Alist[0] != Alist[1]:
        cnt += 1
    if Alist[N-2] != Alist[N-1]:
        cnt += 1
    print cnt
else:
    print 1
0