結果

問題 No.182 新規性の虜
ユーザー ynyn
提出日時 2015-06-25 11:38:06
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 93 ms / 5,000 ms
コード長 343 bytes
コンパイル時間 266 ms
コンパイル使用メモリ 10,732 KB
実行使用メモリ 19,548 KB
最終ジャッジ日時 2023-08-27 07:24:34
合計ジャッジ時間 2,719 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
7,800 KB
testcase_01 AC 16 ms
7,824 KB
testcase_02 AC 16 ms
7,792 KB
testcase_03 AC 16 ms
7,868 KB
testcase_04 AC 16 ms
7,740 KB
testcase_05 AC 16 ms
7,796 KB
testcase_06 AC 15 ms
7,920 KB
testcase_07 AC 16 ms
7,708 KB
testcase_08 AC 60 ms
13,620 KB
testcase_09 AC 82 ms
17,380 KB
testcase_10 AC 74 ms
15,836 KB
testcase_11 AC 64 ms
14,372 KB
testcase_12 AC 35 ms
10,784 KB
testcase_13 AC 16 ms
7,792 KB
testcase_14 AC 16 ms
7,836 KB
testcase_15 AC 15 ms
7,888 KB
testcase_16 AC 15 ms
7,740 KB
testcase_17 AC 15 ms
7,776 KB
testcase_18 AC 80 ms
16,364 KB
testcase_19 AC 58 ms
14,036 KB
testcase_20 AC 41 ms
11,480 KB
testcase_21 AC 93 ms
17,520 KB
testcase_22 AC 49 ms
12,556 KB
testcase_23 AC 16 ms
7,868 KB
testcase_24 AC 72 ms
19,548 KB
testcase_25 AC 62 ms
10,080 KB
testcase_26 AC 23 ms
9,448 KB
testcase_27 AC 16 ms
7,740 KB
evil01.txt AC 72 ms
18,992 KB
evil02.txt AC 73 ms
18,776 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
a = list(map(int, input().split()))
a.sort()

count = 1
if n == 1:
    print(count)

else:
    if a[1] == a[0]:
        count -= 1
    else :
        count += 1

    for i in range(2,n):
        if a[i] == a[i-1]:
            if a[i] != a[i-2]:
                count -= 1
        else:
            count += 1

    print(count)
0