본문 바로가기

알고리즘7

[11382] 꼬마 정민 var fs = require("fs"); var input = fs.readFileSync("/dev/stdin").toString().split(" "); var a = parseInt(input[0]); var b = parseInt(input[1]); var c = parseInt(input[2]); console.log(a + b + c); 2023. 3. 19.
[10926] ??! 입력에 ??!을 붙여 출력하는 문제였다. var fs = require("fs"); var input = fs.readFileSync("/dev/stdin").toString().trim(); //var input = fs.readFileSync("input.txt").toString(); console.log(`${input}??!`); 문자열을 입력받을 때 trim()을 입력해주어야 한다. https://velog.io/@ho2yahh/%EB%B0%B1%EC%A4%80-10926.-joonas-feat.-Javascript-node.js-%EC%95%8C%EA%B3%A0%EB%A6%AC%EC%A6%98 [백준] 10926. joonas??! (feat. Javascript / node.js) 알고리즘.. 2023. 3. 19.
[10869] 사칙연산 var fs = require("fs"); var input = fs.readFileSync("/dev/stdin").toString().split(" "); // var input = fs.readFileSync("input.txt").toString().split(" "); var a = parseInt(input[0]); var b = parseInt(input[1]); console.log(a + b); console.log(a - b); console.log(a * b); console.log(Math.floor(a / b)); console.log(a % b); 2023. 3. 19.
[15235] Olympiad Pizza 문제 15235번: Olympiad Pizza 15235번: Olympiad Pizza The contestants that get a slice are, in order: 1, 2, 3, 4, 2, 4, 2, 4, 4. So at t=1s the first contestant get all slices, at t=3s the third contestant gets a slice, at t=7s the second student finishes and finally at t=9s the fourth student gets the last s www.acmicpc.net 풀이 영어라서 흠칫했지만 별 문제 없이 읽혀서 다행.. 피자먹으려고 줄 서는데 피자 한조각으로 부족한 사람들이 있다. 입력으로 참가자 수.. 2023. 3. 11.