結果
| 問題 |
No.29 パワーアップ
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-01-20 22:04:57 |
| 言語 | PHP (843.2) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 872 bytes |
| コンパイル時間 | 5,006 ms |
| コンパイル使用メモリ | 35,988 KB |
| 実行使用メモリ | 36,504 KB |
| 最終ジャッジ日時 | 2025-10-24 20:55:59 |
| 合計ジャッジ時間 | 2,055 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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";