結果
| 問題 | No.29 パワーアップ |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-06-02 17:21:21 |
| 言語 | PHP (8.5.4) |
| 結果 |
AC
|
| 実行時間 | 32 ms / 5,000 ms |
| + 613µs | |
| コード長 | 407 bytes |
| 記録 | |
| コンパイル時間 | 39 ms |
| コンパイル使用メモリ | 36,752 KB |
| 実行使用メモリ | 37,392 KB |
| 最終ジャッジ日時 | 2026-07-15 21:41:59 |
| 合計ジャッジ時間 | 1,970 ms |
|
ジャッジサーバーID (参考情報) |
judge2_1 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 22 |
コンパイルメッセージ
No syntax errors detected in Main.php
ソースコード
<?php
$items = array_fill(0, 11, 0);
$count = trim(fgets(STDIN));
$total = 3*$count;
$pwrUp = 0;
while($count) {
list($item1, $item2, $item3) = explode(' ', trim(fgets(STDIN)));
$items[$item1]++;
$items[$item2]++;
$items[$item3]++;
$count--;
}
for($i = 1; $i <= 10; $i++) {
$pwrUp += floor($items[$i]/2);
}
$rest = $total - $pwrUp * 2;
$pwrUp += floor($rest/4);
echo $pwrUp.PHP_EOL;