結果
| 問題 | No.29 パワーアップ |
| コンテスト | |
| ユーザー |
lam6er
|
| 提出日時 | 2025-03-26 15:56:28 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 66 ms / 5,000 ms |
| + 418µs | |
| コード長 | 451 bytes |
| 記録 | |
| コンパイル時間 | 233 ms |
| コンパイル使用メモリ | 96,104 KB |
| 実行使用メモリ | 78,848 KB |
| 最終ジャッジ日時 | 2026-07-15 22:51:56 |
| 合計ジャッジ時間 | 2,982 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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)
lam6er