結果

問題 No.112 ややこしい鶴亀算
ユーザー papinianuspapinianus
提出日時 2016-06-20 10:47:15
言語 PHP
(8.3.4)
結果
AC  
実行時間 40 ms / 5,000 ms
コード長 239 bytes
コンパイル時間 117 ms
コンパイル使用メモリ 32,144 KB
実行使用メモリ 31,452 KB
最終ジャッジ日時 2024-04-19 13:03:55
合計ジャッジ時間 1,779 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
31,408 KB
testcase_01 AC 37 ms
31,216 KB
testcase_02 AC 38 ms
31,228 KB
testcase_03 AC 37 ms
31,148 KB
testcase_04 AC 34 ms
30,912 KB
testcase_05 AC 34 ms
31,008 KB
testcase_06 AC 33 ms
31,452 KB
testcase_07 AC 35 ms
31,032 KB
testcase_08 AC 35 ms
31,356 KB
testcase_09 AC 36 ms
31,252 KB
testcase_10 AC 35 ms
31,336 KB
testcase_11 AC 35 ms
31,408 KB
testcase_12 AC 36 ms
30,932 KB
testcase_13 AC 35 ms
31,144 KB
testcase_14 AC 36 ms
31,388 KB
testcase_15 AC 35 ms
31,176 KB
testcase_16 AC 37 ms
31,252 KB
testcase_17 AC 37 ms
31,224 KB
testcase_18 AC 36 ms
30,860 KB
testcase_19 AC 34 ms
31,352 KB
testcase_20 AC 35 ms
30,944 KB
testcase_21 AC 34 ms
31,324 KB
testcase_22 AC 33 ms
31,332 KB
testcase_23 AC 34 ms
30,840 KB
testcase_24 AC 35 ms
31,192 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php
$num = trim(fgets(STDIN));
$counts = explode(' ', trim(fgets(STDIN)));
$totalLeg = array_sum($counts)/($num-1);
$ifAllBird = 2*$num;
$turtles = ($totalLeg - $ifAllBird)/2;
$birds = $num - $turtles;
echo "{$birds} {$turtles}".PHP_EOL;
0