結果

問題 No.586 ダブルブッキング
ユーザー ayaaya
提出日時 2019-08-02 12:20:20
言語 PHP
(8.3.4)
結果
AC  
実行時間 16 ms / 2,000 ms
コード長 437 bytes
コンパイル時間 69 ms
コンパイル使用メモリ 18,564 KB
実行使用メモリ 18,980 KB
最終ジャッジ日時 2023-09-18 18:11:27
合計ジャッジ時間 718 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
18,864 KB
testcase_01 AC 16 ms
18,920 KB
testcase_02 AC 16 ms
18,900 KB
testcase_03 AC 16 ms
18,760 KB
testcase_04 AC 16 ms
18,972 KB
testcase_05 AC 16 ms
18,980 KB
testcase_06 AC 16 ms
18,888 KB
testcase_07 AC 16 ms
18,912 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php
$yukiHotelPrice=(int)trim(fgets(STDIN));
$changeHotelPrice=(int)trim(fgets(STDIN));
$bookingCnt=(int)trim(fgets(STDIN));
$bookingRoom=array();
$dobleBookingCnt=0;
for($i=1;$i<=$bookingCnt;$i++){
  $roomNum=(int)trim(fgets(STDIN));
  if(array_search($roomNum,$bookingRoom)!==false){
    $dobleBookingCnt++;
  }else{
    array_push($bookingRoom,$roomNum);
  }
}
$loss=($yukiHotelPrice+$changeHotelPrice)*$dobleBookingCnt;
echo $loss;
0