๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
๊ฐœ์ธ๊ณต๋ถ€/Algorithm

[๋ฐฑ์ค€][Node.js] 5543๋ฒˆ : ์ƒ๊ทผ๋‚ ๋“œ

by ๐Ÿ‡๋ฐ•๋ด‰๋ด‰๐Ÿ‡ 2021. 11. 18.

 

 

Algorithm

-  ์ƒ๊ทผ๋‚ ๋“œ -

 


 

๋ฌธ์ œ

์ƒ๊ทผ๋‚ ๋“œ์—์„œ ๊ฐ€์žฅ ์ž˜ ํŒ”๋ฆฌ๋Š” ๋ฉ”๋‰ด๋Š” ์„ธํŠธ ๋ฉ”๋‰ด์ด๋‹ค.

์ฃผ๋ฌธํ•  ๋•Œ, ์ž์‹ ์ด ์›ํ•˜๋Š” ํ–„๋ฒ„๊ฑฐ์™€ ์Œ๋ฃŒ๋ฅผ ํ•˜๋‚˜์”ฉ ๊ณจ๋ผ, ์„ธํŠธ๋กœ ๊ตฌ๋งคํ•˜๋ฉด, ๊ฐ€๊ฒฉ์˜ ํ•ฉ๊ณ„์—์„œ 50์›์„ ๋บ€ ๊ฐ€๊ฒฉ์ด ์„ธํŠธ ๋ฉ”๋‰ด์˜ ๊ฐ€๊ฒฉ์ด ๋œ๋‹ค.

 

ํ–„๋ฒ„๊ฑฐ๋Š” ์ด 3์ข…๋ฅ˜ ์ƒ๋•๋ฒ„๊ฑฐ, ์ค‘๋•๋ฒ„๊ฑฐ, ํ•˜๋•๋ฒ„๊ฑฐ๊ฐ€ ์žˆ๊ณ , ์Œ๋ฃŒ๋Š” ์ฝœ๋ผ์™€ ์‚ฌ์ด๋‹ค ๋‘ ์ข…๋ฅ˜๊ฐ€ ์žˆ๋‹ค.

 

ํ–„๊ฑฐ๋ฒ„์™€ ์Œ๋ฃŒ์˜ ๊ฐ€๊ฒฉ์ด ์ฃผ์–ด์กŒ์„ ๋•Œ, ๊ฐ€์žฅ ์‹ผ ์„ธํŠธ ๋ฉ”๋‰ด์˜ ๊ฐ€๊ฒฉ์„ ์ถœ๋ ฅํ•˜๋Š” ํ”„๋กœ๊ทธ๋žจ์„ ์ž‘์„ฑํ•˜์‹œ์˜ค.

 

์ž…์ถœ๋ ฅ ์˜ˆ์‹œ

 

๋ฌธ์ œ ํ’€๊ธฐ

const readline = require("readline");
const rl = readline.createInterface({
	input: process.stdin,
	output: process.stdout,
});
let input = [];
rl.on("line", function (line) {
	input.push(line.toString());
}).on("close", function () {
	let minBurger = Math.min(...input.slice(0, 3));
let minDrink = Math.min(...input.slice(-2));

console.log(minBurger + minDrink - 50);
	process.exit();
});

 

 

 

๋ฐ˜์‘ํ˜•

๋Œ“๊ธ€