結果
| 問題 | No.29 パワーアップ |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-10-05 22:14:27 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 31 ms / 5,000 ms |
| コード長 | 409 bytes |
| 記録 | |
| コンパイル時間 | 95 ms |
| コンパイル使用メモリ | 12,032 KB |
| 実行使用メモリ | 10,368 KB |
| 最終ジャッジ日時 | 2025-10-24 21:03:11 |
| 合計ジャッジ時間 | 1,376 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 22 |
ソースコード
from collections import Counter
from itertools import chain
def main():
N = int(input())
gen = (input().split() for _ in range(N))
c = Counter(chain.from_iterable(gen))
n_up = 0
total_rem = 0
for count in c.values():
quotient, rem = divmod(count, 2)
n_up += quotient
total_rem += rem
print(n_up + total_rem // 4)
if __name__ == '__main__':
main()