일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
- 데이터베이스
- Database
- BHS
- 임베디드
- 전송 계층
- C++
- 문제풀이
- 릿코드
- Embedded
- 부트시퀀스
- Application Layer
- 관계형 모델
- Transport layer
- leetcode
- DB
- dp
- BST
- 응용 계층
- 백준
- Network
- Djikstra
- 네트워크
- swea
- 프로그래머스
- 자료구조
- boot sequence
- ps
- baekjoon
- 다익스트라
- STL
- Today
- Total
목록Algorithm/Problem Solving (26)
BOBO's Note
https://www.acmicpc.net/problem/3190 3190번: 뱀 문제 'Dummy' 라는 도스게임이 있다. 이 게임에는 뱀이 나와서 기어다니는데, 사과를 먹으면 뱀 길이가 늘어난다. 뱀이 이리저리 기어다니다가 벽 또는 자기자신의 몸과 부딪히면 게임이 끝난다. www.acmicpc.net 풀이 방법 뱀의 위치, 움직임, 회전 등을 Snake라는 클래스로 나타냈다. enum Dir{RIGHT, DOWN, LEFT, UP}; class Snake{ public: Snake(): dir(RIGHT) { body.push_front(0); body_pos.insert(0); }; void rotate(int d){ if(d == RIGHT) dir = (dir + 1) % 4; else dir ..
https://www.acmicpc.net/problem/17140 17140번: 이차원 배열과 연산 첫째 줄에 r, c, k가 주어진다. (1 ≤ r, c, k ≤ 100) 둘째 줄부터 3개의 줄에 배열 A에 들어있는 수가 주어진다. 배열 A에 들어있는 수는 100보다 작거나 같은 자연수이다. www.acmicpc.net 풀이 방법 배열의 (r, c)의 값이 k이 될 때까지 반복문을 돌며 배열에 연산을 적용한다. 이때, 100초를 초과하면 -1을 출력하고 프로그램을 종료한다. 배열의 연산은 Array 클래스 내의 change() 메소드로 구현했다. while(!arr.is_equal(k)){ t++; if(t > 100){ cout = C) op_row(); else op_col(); } row-wis..