結果

問題 No.2851 Make Pairs
ユーザー titia
提出日時 2024-08-27 03:34:50
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 209 ms / 2,000 ms
コード長 259 bytes
コンパイル時間 607 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 31,028 KB
最終ジャッジ日時 2024-08-27 03:34:53
合計ジャッジ時間 2,516 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 8
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
A=list(map(int,input().split()))

A.sort(reverse=True)
ANS=0

while A:
    if len(A)>=2:
        if A[-1]==A[-2]:
            ANS+=1
            A.pop()
            A.pop()
        else:
            A.pop()
    else:
        A.pop()

print(ANS)
0