結果
問題 | No.29 パワーアップ |
ユーザー |
![]() |
提出日時 | 2025-03-26 15:56:28 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 38 ms / 5,000 ms |
コード長 | 451 bytes |
コンパイル時間 | 204 ms |
コンパイル使用メモリ | 82,764 KB |
実行使用メモリ | 53,984 KB |
最終ジャッジ日時 | 2025-03-26 15:56:58 |
合計ジャッジ時間 | 1,821 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 22 |
ソースコード
n = int(input()) counts = [0] * 11 # Using 1-based index for items 1-10 for _ in range(n): a, b, c = map(int, input().split()) counts[a] += 1 counts[b] += 1 counts[c] += 1 total_power = 0 # Calculate power-ups from pairs for i in range(1, 11): total_power += counts[i] // 2 counts[i] %= 2 # Calculate power-ups from remaining items (groups of four) remaining = sum(counts) total_power += remaining // 4 print(total_power)