전체 글

Problem Set/Dynamic Programming

[BOJ] 25421. 조건에 맞는 정수의 개수

https://www.acmicpc.net/problem/25421 25421번: 조건에 맞는 정수의 개수 2개의 자릿수를 갖고 첫 번째 자리의 숫자와 두 번째 자리의 숫자의 차이가 2보다 작거나 같은 양의 정수 11, 12, 13, 21, 22, 23, 24, 31, 32, ... , 97, 98, 99가 A에 해당된다. 따라서 정답은 39이다. www.acmicpc.net 문제 분석 & 풀이 간단한 DP문제다. 많이 가볼 필요 없이 n=3까지만 손으로 세보면 규칙을 쉽게 파악할 수 있다. 점화식은 dp[n][i] = dp[n-1][i-2] + dp[n-1][i-1] + dp[n-1][i] + dp[n-1][i+1] + dp[n-1][i+2]. 1, 2, 8, 9일 때 예외처리만 신경쓰면 된다. 코드 ..

Problem Set

[Programmers] Lv2. 할인 행사

https://school.programmers.co.kr/learn/courses/30/lessons/131127?language=java 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 문제를 읽고 든 생각은 그냥 문제가 제시한대로 따라가면 풀면 될 것 같은데? 라는 생각이 들었다. 첫 번째 풀이 단순하게 discount 배열의 0번째부터 discount.length - 10까지 반복문을 돌면서 10개씩 자르며 원하는 수량을 다 채웠는지 체크한다. import java.util.*; class Solution { private boolean canReg..

Issue

nGrinder를 활용한 서버 부하 테스트 만들기 (with HAProxy) - 1

전공 프로젝트로 분산 시스템 환경을 만들기로 했다. 주제는 nGrinder로 서버 부하 테스트를 진행하고, 수없이 쌓이는 요청 로그들을 Hadoop을 활용해서 수집해보는 것이다. System Architecture 프로젝트의 전체적인 아키텍처를 간략하게 구성해보자. - 우선 서버는 Spring Boot, 클라이언트는 React를 사용해서 만든다. - LB구성은 Nginx를 이용하려 했으나, health check를 사용하려면 유료 버전을 사용해야 한다길래 HAProxy로 변경.. - 호스팅 서버의 경우 1TB Storage 32GB Memory CPU를 구했다. - 여기서 docker container 설정으로 각 서버를 2Core CPU/4GiB Memory로 제한해 테스트를 진행할 예정 부하 테스트를..

Computer Science/Computer Architecture

[Computer Organization & Design] The Processor - 2

https://kangcoder.tistory.com/entry/Computer-Organization-Design-The-Processor-1 [Computer Organization & Design] The Processor - 1 Building a Datapath Datapath: CPU에서 데이터와 주소를 처리하는 요소 (register, ALU, MUX 등) Instruction Fetch 모든 Instruction을 처리하기 위한 첫 단계 - PC(Program Counter): 다음 실행할 명령어의 주소를 저장하고 kangcoder.tistory.com Control Unit - Instruction의 상위 6bits인 opcode를 입력으로 받아 명령어에 맞는 signal을 보내 data..

Computer Science/Computer Architecture

[Computer Organization & Design] The Processor - 1

Building a Datapath Datapath: CPU에서 데이터와 주소를 처리하는 요소 (register, ALU, MUX 등) Instruction Fetch 모든 Instruction을 처리하기 위한 첫 단계 - PC(Program Counter): 다음 실행할 명령어의 주소를 저장하고 있는 register. - IM(Instruction Memory): PC로부터 받은 주소에 맞는 Instruction을 내보낸다. - Add(Adder): 다음 명령어의 주소를 가리키기 위해 있다. MIPS는 Instruction의 단위가 word(4byte)이기 때문에 PC + 4를 한다. Decoding Inst. Fetch해온 Instruction을 해석하는 단계 - 명령어의 opcode와 functio..

Computer Science/Computer Architecture

[Computer Organization & Design] Arithmetic for Computers - 1

Integer Addition & Subtraction 컴퓨터에서의 정수형 덧셈 - 결과가 표현 가능한 범위를 벗어나면 Overflow가 일어난다. - 양 + 음의 덧셈에서는 Overflow가 일어나지 않는다. - 양 + 양의 덧셈에서 Overflow가 일어날 수 있다. (MSB가 1로 carry되면서 음수화 발생) - 음 + 음의 덧셈에서 Underflow가 일어날 수 있다. (MSB가 1->0으로 되면서 양수화 발생) 컴퓨터에서의 정수형 뺄셈 - 정수형 뺄셈은 빼지는 수를 음수(2의 보수 + 1)로 만들고 덧셈을 진행하면 된다. - 양 - 음의 뺄셈에서 Overflow가 발생할 수 있고, 음 - 양의 뺄셈에서 Underflow가 발생할 수 있다. Dealing with Overflow 몇몇 언어에서는..

Computer Science/Computer Architecture

[Computer Organization & Design] Instructions: Language of the Computer - Part 3

https://kangcoder.tistory.com/entry/Computer-Organization-Design-Instructions-Language-of-the-Computer-Part-2 [Computer Organization & Design] Instructions: Language of the Computer - Part 2 https://kangcoder.tistory.com/entry/Computer-Organization-Design-Instructions-Language-of-the-Computer-Part-1 [Computer Organization & Design] Instructions: Language of the Computer - Part 1 Instruction Set ..

Computer Science/Computer Architecture

[Computer Organization & Design] Instructions: Language of the Computer - Part 2

https://kangcoder.tistory.com/entry/Computer-Organization-Design-Instructions-Language-of-the-Computer-Part-1 [Computer Organization & Design] Instructions: Language of the Computer - Part 1 Instruction Set 컴퓨터에서 사용되는 명령어들의 집합 - 서로 다른 컴퓨터는 서로 다른 Instruction Set을 가진다 (대부분 유사한 특징을 가지고 있긴 하다) - 초기 컴퓨터는 아주 단순한 IS를 가졌지만, kangcoder.tistory.com MIPS의 여러 Instructions에 대해 살펴보자. Logical Operations AND Ope..

주니어 개발자의 아카이브
KangCoder`s Dev