結果

問題 No.48 ロボットの操縦
コンテスト
ユーザー kazutaka-machida
提出日時 2023-07-07 17:12:00
言語 TypeScript
(6.0.2)
コンパイル:
tsc.sh -p tsconfig.json
実行:
node main.js ONLINE_JUDGE
結果
WA  
実行時間 -
コード長 388 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 4,689 ms
コンパイル使用メモリ 349,584 KB
実行使用メモリ 52,736 KB
最終ジャッジ日時 2026-06-05 06:49:59
合計ジャッジ時間 8,048 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other WA * 25
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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(Y/L)
  	if (Y < 0) {
  		count += 1
  	}
  }
  if (X != 0) {
  	count += 1
	count += Math.ceil(X/L)
  }
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
0