結果

問題 No.48 ロボットの操縦
ユーザー kazutaka-machidakazutaka-machida
提出日時 2023-07-07 17:14:39
言語 TypeScript
(5.4.3)
結果
WA  
実行時間 -
コード長 422 bytes
コンパイル時間 7,142 ms
コンパイル使用メモリ 253,696 KB
実行使用メモリ 42,100 KB
最終ジャッジ日時 2023-09-28 18:00:00
合計ジャッジ時間 10,291 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
41,840 KB
testcase_01 AC 78 ms
41,648 KB
testcase_02 WA -
testcase_03 AC 78 ms
42,100 KB
testcase_04 AC 79 ms
41,700 KB
testcase_05 AC 80 ms
42,072 KB
testcase_06 AC 79 ms
41,708 KB
testcase_07 AC 79 ms
41,840 KB
testcase_08 AC 79 ms
41,816 KB
testcase_09 AC 79 ms
42,068 KB
testcase_10 AC 78 ms
41,900 KB
testcase_11 AC 77 ms
41,828 KB
testcase_12 AC 77 ms
41,656 KB
testcase_13 AC 78 ms
41,840 KB
testcase_14 AC 77 ms
41,808 KB
testcase_15 AC 78 ms
41,932 KB
testcase_16 AC 78 ms
41,672 KB
testcase_17 AC 79 ms
41,844 KB
testcase_18 AC 78 ms
41,904 KB
testcase_19 AC 78 ms
41,844 KB
testcase_20 AC 77 ms
41,896 KB
testcase_21 AC 77 ms
41,900 KB
testcase_22 AC 79 ms
41,800 KB
testcase_23 AC 81 ms
41,956 KB
testcase_24 AC 78 ms
41,808 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

function Main(input: string) {
  const inputs = input.split("\n");
  const X = Math.abs(Number(inputs[0]))
  const Y = Number(inputs[1])
  const L = Number(inputs[2])
  
  let count = 0
  
  if (Y != 0) {
  	count += Math.ceil(Math.abs(Y)/L)
  	if (Y < 0) {
  		count += 1
  	}
  }
  if (X != 0) {
  	count += 1
	count += Math.ceil(X/L)
  }
  
  console.log(count)
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
0