結果

問題 No.29 パワーアップ
ユーザー ymgckyo
提出日時 2017-11-04 16:43:19
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 31 ms / 5,000 ms
コード長 539 bytes
コンパイル時間 226 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-11-23 17:55:53
合計ジャッジ時間 1,617 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
input_list, tmp_list, check_list = [], [], []

for i in range(n):
    input_list.extend(map(int, (input().split())))

tmp_list.extend(input_list)

powerup_counter = 0
for e in input_list:
    if e in check_list:
        continue
    if input_list.count(e) >= 2:
        powerup_counter += input_list.count(e) // 2
        for i in range(input_list.count(e) // 2 * 2):
            tmp_list.remove(e)
            check_list.append(e)

if len(tmp_list) >= 4:
    powerup_counter += len(tmp_list) // 4

print(powerup_counter)
0