結果
問題 | No.29 パワーアップ |
ユーザー |
|
提出日時 | 2016-01-20 22:04:57 |
言語 | PHP (843.2) |
結果 |
WA
|
実行時間 | - |
コード長 | 872 bytes |
コンパイル時間 | 161 ms |
コンパイル使用メモリ | 32,272 KB |
実行使用メモリ | 32,532 KB |
最終ジャッジ日時 | 2024-09-21 14:51:49 |
合計ジャッジ時間 | 1,764 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 8 WA * 14 |
コンパイルメッセージ
No syntax errors detected in Main.php
ソースコード
<?php $input = trim(fgets(STDIN)); for($j =1; $j <=10; $j ++){ $itemList[$j] = 0; } for($i = 1; $i <= $input; $i ++){ $inputItem = trim(fgets(STDIN)); $explode = explode(" ", $inputItem); foreach($explode as $explodeKey => $explodeValue){ foreach($itemList as $itemListKey => $itemListValue){ if($explodeValue == $itemListKey){ $itemList[$explodeValue] ++; } } } } $answerCount = 0; $answerAmari = 0; for($p = 1; $p <= 10; $p ++){ $itemListAnswer = floor($itemList[$p] / 2); if($itemListAnswer >= 1){ $answerCount += $itemListAnswer; }else if($itemListAnswer <= 0){ $itemListAmariAnswer = floor($itemList[$p] % 2); $answerAmari += $itemListAmariAnswer; } } $answerAmari4 = floor($answerAmari / 4); $answerCount += $answerAmari4; echo $answerCount."\n";