結果

問題 No.756 チャンパーノウン定数 (1)
ユーザー aya
提出日時 2019-08-06 13:52:19
言語 PHP
(843.2)
結果
AC  
実行時間 43 ms / 2,000 ms
コード長 428 bytes
コンパイル時間 71 ms
コンパイル使用メモリ 31,372 KB
実行使用メモリ 31,604 KB
最終ジャッジ日時 2024-07-18 13:54:59
合計ジャッジ時間 1,850 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php
$input=str_split(trim(fgets(STDIN)));
$ans;
if(count($input)==1){
  $ans=$input[0];
}else if(count($input)==2){
  if((int)$input[0]%2==0){
    if((int)$input[1]%2==0){
      $ans=ceil((int)$input[0]/2);
    }else{
      $ans=5+floor($input[1]/2);
    }
  }else{
      if((int)$input[1]%2==0){
        $ans=ceil((int)$input[0]/2);
      }else{
        $ans=0+floor($input[1]/2);
      }
  }
}else{
  $ans=5;
}



echo $ans;
0