結果

問題 No.182 新規性の虜
ユーザー y_nakamura_CC2y_nakamura_CC2
提出日時 2018-01-17 01:52:16
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 335 bytes
コンパイル時間 105 ms
コンパイル使用メモリ 10,592 KB
実行使用メモリ 19,728 KB
最終ジャッジ日時 2023-08-25 19:26:36
合計ジャッジ時間 2,736 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,784 KB
testcase_01 AC 15 ms
7,832 KB
testcase_02 AC 15 ms
7,808 KB
testcase_03 AC 15 ms
7,804 KB
testcase_04 AC 15 ms
7,796 KB
testcase_05 AC 14 ms
7,780 KB
testcase_06 AC 15 ms
7,864 KB
testcase_07 AC 14 ms
7,796 KB
testcase_08 AC 60 ms
13,644 KB
testcase_09 AC 90 ms
17,316 KB
testcase_10 AC 87 ms
15,832 KB
testcase_11 AC 67 ms
14,396 KB
testcase_12 AC 36 ms
10,892 KB
testcase_13 AC 14 ms
7,808 KB
testcase_14 AC 15 ms
7,852 KB
testcase_15 WA -
testcase_16 AC 15 ms
7,924 KB
testcase_17 AC 15 ms
7,824 KB
testcase_18 AC 69 ms
16,468 KB
testcase_19 AC 54 ms
14,144 KB
testcase_20 AC 38 ms
11,628 KB
testcase_21 AC 78 ms
17,640 KB
testcase_22 AC 45 ms
12,608 KB
testcase_23 WA -
testcase_24 AC 81 ms
19,728 KB
testcase_25 AC 56 ms
10,036 KB
testcase_26 AC 24 ms
9,284 KB
testcase_27 AC 15 ms
7,796 KB
evil01.txt AC 83 ms
18,940 KB
evil02.txt AC 84 ms
18,784 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
A = sorted([int(i) for i in input().split()])
ans = 0
isOnly = True

for i in range(N-1):

    if A[i] == A[i+1]:
        isOnly = False

    elif isOnly:
        ans += 1
        
        if i == N-2:
            ans += 1

    else:
        isOnly = True
        if i == N-2:
            ans += 1
        
print(ans)
0