結果

問題 No.126 2基のエレベータ
ユーザー phptarophptaro
提出日時 2015-01-26 10:42:57
言語 PHP
(8.3.4)
結果
WA  
実行時間 -
コード長 253 bytes
コンパイル時間 967 ms
コンパイル使用メモリ 18,620 KB
実行使用メモリ 18,900 KB
最終ジャッジ日時 2023-09-05 06:55:29
合計ジャッジ時間 2,883 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
18,784 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 15 ms
18,780 KB
testcase_04 AC 16 ms
18,772 KB
testcase_05 WA -
testcase_06 AC 15 ms
18,608 KB
testcase_07 WA -
testcase_08 AC 16 ms
18,828 KB
testcase_09 AC 15 ms
18,800 KB
testcase_10 AC 16 ms
18,840 KB
testcase_11 AC 16 ms
18,756 KB
testcase_12 AC 15 ms
18,796 KB
testcase_13 AC 16 ms
18,880 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 16 ms
18,800 KB
testcase_17 WA -
testcase_18 AC 15 ms
18,900 KB
testcase_19 AC 16 ms
18,820 KB
testcase_20 WA -
testcase_21 AC 16 ms
18,836 KB
testcase_22 AC 16 ms
18,728 KB
testcase_23 AC 16 ms
18,808 KB
testcase_24 AC 16 ms
18,876 KB
testcase_25 AC 15 ms
18,840 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 15 ms
18,760 KB
testcase_29 AC 16 ms
18,756 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php
fscanf(STDIN, "%d %d %d", $A, $B, $S);

$absA = abs($S-$A);
$absB = abs($S-$B);

$ans = 0;

//Aを使うとき
if($absA <= $absB){
	$ans = $absA + $S;
}else{	//Bを使うとき
	if($A == 0){
		$ans +=2;
	}
	$ans = $absA + $absB + $A;
}
echo $ans;
0