ロボットの移動 (paizaランク D 相当)
x,yそれぞれの絶対値の和が答えです。
const fs = require("fs");
const input = fs.readFileSync("/dev/stdin", "utf-8").trim();
const lines = input.split("\n");
console.log(lines[0].split(" ").reduce((x, y) => Math.abs(x) + Math.abs(y)));
Go to list of users who liked
More than 1 year has passed since last update.
ロボットの移動 (paizaランク D 相当)
x,yそれぞれの絶対値の和が答えです。
const fs = require("fs");
const input = fs.readFileSync("/dev/stdin", "utf-8").trim();
const lines = input.split("\n");
console.log(lines[0].split(" ").reduce((x, y) => Math.abs(x) + Math.abs(y)));
Register as a new user and use Qiita more conveniently
Go to list of users who liked