코드 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778#include #include #include using namespace std; struct n { int number; // 숫자 string res; // 연산과정}; bool isVisit[10001];queue q; int calD(int n){ // D연산 return (n * 2) % 10000;} int calS(int n) { // S연산 return n-1 >= 0 ? n-1 : 9999;} int calL(int n)..
코드 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970#include #include #include #include using namespace std; int len;char map[25][25]; // 실제 지도(0,1)bool visit[25][25] = { false, }; // 방문 여부 표시int dir[4][2] = { { 1,0 },{ -1,0 },{ 0,1 },{ 0,-1 } }; // 동서남북 이동queue q; // 모든 단지의 위치를 담는 큐 bool check(int row, int col) { ..
코드 1) pair 이용 현재 위치와 해당 위치까지 이동하는 데 걸린 시간을 함께 저장하기 위해 pair를 이용한다. 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 31 #include #include using namespace std; int bfs(int s, int e) { bool visit[100001] = { false }; // 왔던 곳에 중복해서 가는 경우를 피하기 위해 queue q; // 현재 위치, 걸린 시간 q.push({ s,0 }); // 맨 처음의 위치, 시간을 큐에 넣음 while (!q.empty()) { pair now = q.front(); // 현재위치 걸린 시간 vis..
- Total
- Today
- Yesterday
- 합승 택시 요금
- java
- 스티커모으기2
- dovecot
- git
- 아두이노
- mysql
- ESP8266
- 리눅스
- 워드프레스
- 2981
- 집배원 한상덕
- 구슬 탈출2
- the pads
- FTP
- 11503
- 백준
- hc-06
- 키 순서
- 자바
- 블루투스
- BFS
- dht11
- 프로그래머스
- DP
- 라즈비안
- 메일서버
- c++
- hackerrank
- 라즈베리파이
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |