結果
| 問題 | No.29 パワーアップ |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-06-02 17:21:21 |
| 言語 | PHP (843.2) |
| 結果 |
AC
|
| 実行時間 | 52 ms / 5,000 ms |
| コード長 | 407 bytes |
| コンパイル時間 | 189 ms |
| コンパイル使用メモリ | 36,248 KB |
| 実行使用メモリ | 36,628 KB |
| 最終ジャッジ日時 | 2025-10-24 20:57:35 |
| 合計ジャッジ時間 | 2,103 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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;