結果

問題 No.750 Frac #1
ユーザー dyechidyechi
提出日時 2019-03-28 14:07:08
言語 PHP
(8.3.4)
結果
AC  
実行時間 46 ms / 1,000 ms
コード長 520 bytes
コンパイル時間 3,045 ms
コンパイル使用メモリ 30,680 KB
実行使用メモリ 31,368 KB
最終ジャッジ日時 2024-04-20 22:17:28
合計ジャッジ時間 2,562 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 46 ms
31,224 KB
testcase_01 AC 45 ms
30,880 KB
testcase_02 AC 42 ms
30,944 KB
testcase_03 AC 43 ms
31,056 KB
testcase_04 AC 42 ms
31,368 KB
testcase_05 AC 42 ms
31,020 KB
testcase_06 AC 41 ms
30,912 KB
testcase_07 AC 43 ms
30,824 KB
testcase_08 AC 45 ms
31,324 KB
testcase_09 AC 43 ms
30,760 KB
testcase_10 AC 40 ms
31,316 KB
testcase_11 AC 40 ms
31,152 KB
testcase_12 AC 43 ms
30,936 KB
testcase_13 AC 42 ms
30,984 KB
testcase_14 AC 41 ms
31,368 KB
testcase_15 AC 39 ms
31,080 KB
testcase_16 AC 42 ms
31,140 KB
testcase_17 AC 45 ms
31,128 KB
testcase_18 AC 45 ms
31,088 KB
testcase_19 AC 41 ms
31,000 KB
testcase_20 AC 42 ms
30,988 KB
testcase_21 AC 42 ms
31,024 KB
testcase_22 AC 42 ms
30,708 KB
testcase_23 AC 42 ms
31,260 KB
testcase_24 AC 41 ms
31,284 KB
testcase_25 AC 42 ms
31,120 KB
testcase_26 AC 42 ms
30,932 KB
testcase_27 AC 43 ms
31,260 KB
testcase_28 AC 42 ms
31,156 KB
testcase_29 AC 42 ms
31,232 KB
testcase_30 AC 42 ms
31,204 KB
testcase_31 AC 40 ms
30,852 KB
testcase_32 AC 40 ms
31,276 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php
while ($line = fgets(STDIN)) {
    $s[] = trim($line);
}
foreach ($s as $key => $value) {
    $array[] = explode(" ", $value);
}
$lines = array_splice($array, 0, 1);

for ($i=0; $i<$lines[0][0]; $i++) {
    $fractions_answer[] = $array[$i][0] / $array[$i][1];
}

rsort($fractions_answer);

for ($i=0; $i<$lines[0][0]; $i++) {
    for ($j=0; $j<$lines[0][0]; $j++) {
        if ($fractions_answer[$i] == $array[$j][0] / $array[$j][1]) {
            echo $array[$j][0]." ".$array[$j][1].PHP_EOL;
        }
    }
}
?>
0