結果

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

ソースコード

diff #

def main():
    N = int(input())
    nums = [int(i) for i in input().split()]
    print(get_new_num_count(nums))

def get_new_num_count(values):
    sorted_values = sorted(values)
    first_loop = True
    duplicate = []
    for value in sorted_values:
        if first_loop:
            prev = value
            first_loop = False
            continue
        if prev == value:
            duplicate.append(prev)
        prev = value
    #print("values", values)
    #print("duplicate", duplicate)
    return len(set(values)) - len(set(duplicate))


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