結果

問題 No.564 背の順
ユーザー clef_delphclef_delph
提出日時 2020-02-19 02:02:08
言語 PHP
(8.3.4)
結果
AC  
実行時間 42 ms / 2,000 ms
コード長 418 bytes
コンパイル時間 85 ms
コンパイル使用メモリ 30,540 KB
実行使用メモリ 30,972 KB
最終ジャッジ日時 2024-04-16 04:22:17
合計ジャッジ時間 1,163 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
30,656 KB
testcase_01 AC 41 ms
30,656 KB
testcase_02 AC 42 ms
30,948 KB
testcase_03 AC 41 ms
30,744 KB
testcase_04 AC 41 ms
30,972 KB
testcase_05 AC 41 ms
30,836 KB
testcase_06 AC 41 ms
30,520 KB
testcase_07 AC 41 ms
30,596 KB
testcase_08 AC 41 ms
30,592 KB
testcase_09 AC 40 ms
30,868 KB
testcase_10 AC 41 ms
30,780 KB
testcase_11 AC 41 ms
30,912 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php
 list($height,$person)=explode(" ",trim(fgets(STDIN)));
 $array[]=$height;
 
 //配列に格納して並び替え
for($i=0;$i<$person-1;$i++){
  $array[]= trim(fgets(STDIN)); 
}
rsort($array);

$num=array_keys($array, $height);
$order=$num[0]+1;

if($order%10==1){
    echo $order."st";
}elseif($order%10==2){
    echo $order."nd";
}elseif($order%10==3){
    echo $order."rd";
}else{
    echo $order."th";
}
 
?>
0