Development/Program Solving
-
[백준 단계별로 풀어보기] 2. if문 (feat.NodeJS)Development/Program Solving 2020. 12. 23. 00:42
1330번: 두 수 비교하기 1330번: 두 수 비교하기 두 정수 A와 B가 주어졌을 때, A와 B를 비교하는 프로그램을 작성하시오. www.acmicpc.net const readline = require('readline'); const rl = readline.createInterface({ input: process.stdin, output: process.stdout }); let inputString; const onInput = (input) => inputString = input; const onClose = () => { const [num1, num2] = inputString.split(" "); if(Number(num1) > Number(num2)) { console.log(">..
-
[백준 단계별로 풀어보기] 1.입출력과 사칙연산 (feat.NodeJS)Development/Program Solving 2020. 12. 20. 23:25
2557번: Hello World 2557번: Hello World Hello World!를 출력하시오. www.acmicpc.net console.log("Hello World!"); 10718번: We love krill 10718번: We love kriii ACM-ICPC 인터넷 예선, Regional, 그리고 World Finals까지 이미 2회씩 진출해버린 kriii는 미련을 버리지 못하고 왠지 모르게 올 해에도 파주 World Finals 준비 캠프에 참여했다. 대회를 뜰 줄 모르는 지박 www.acmicpc.net console.log("강한친구 대한육군"); console.log("강한친구 대한육군"); 10171번: 고양이 10171번: 고양이 아래 예제와 같이 고양이를 출력하시오. w..
-
[알고리즘] 빅오 표기법(Big-O notation) feat. JSDevelopment/Program Solving 2020. 11. 28. 01:52
빅오 표기법이란? 시간 복잡도와 공간 복잡도 분석을 위한 알고리즘이다. 빅오 표기법을 사용해서 알고리즘이 얼마나 효율적인지 분석할 수 있다. 시간 복잡도와 공간 복잡도 시간 복잡도는 입력의 개수(n)에 따라 알고리즘의 수행 시간이 얼마인지를 나타낸다. 공간 복잡도는 알고리즘이 메모리 공간을 얼마나 필요로 하는지를 나타낸다. 빅오 표기법을 사용해서 일반적인 시간 복잡도 구분하기 O(1) : 상수 시간 입력에 관계없이 연산이 수행되는 알고리즘이다. function testFN(n) { console.log('Big-O'); } O(n) : 선형 시간 입력의 개수인 n만큼 연산이 수행되는 알고리즘이다. function testFN(n) { for(let i=0; i