結果

問題 No.182 新規性の虜
ユーザー tarotaro789
提出日時 2017-10-22 17:41:49
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 126 ms / 5,000 ms
コード長 331 bytes
コンパイル時間 443 ms
コンパイル使用メモリ 12,288 KB
実行使用メモリ 20,396 KB
最終ジャッジ日時 2024-12-27 19:53:43
合計ジャッジ時間 3,321 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 27
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
ls=list(map(int,input().split()))
ls.sort()
cnt=0
if n==1:
    cnt+=1
if n==2:
    if ls[0]!=ls[1]:
        cnt+=2
for i in range(n-2):
    if i==0:
        if ls[i]!=ls[i+1]:
            cnt+=1
    if i==n-3:
        if ls[i+1]!=ls[i+2]:
            cnt+=1
    if ls[i]!=ls[i+1]!=ls[i+2]:
        cnt+=1
print(cnt)
0