백준 :: BOJ :: 16236 :: 아기 상어 출처 : https://www.acmicpc.net/problem/16236 #include using namespace std; int N, t, tt, fs, ss, si, sj, ni, nj,arr[21][21], v[21][21], di[] = {-1,0,0,1}, dj[] = {0,-1,1,0};queue q; priority_queue pq; void clear() { queue e; priority_queueee; swap(pq, ee); swap(q, e);memset(v, 0, sizeof(v)); q.push(make_pair(ni, nj)); } void bfs() {while (!q.empty()) {int s = q.size(); ..
백준 :: BOJ :: 5373 :: 큐빙 출처 : https://www.acmicpc.net/problem/5373 #include using namespace std;int T, N, i, h,c[21] = {13,8,3,18,14,9,4,0,19,15,10,5,1,20,16,11,6,2,17,12,7 },u[6][21] = {{ 20,19,18,27,8,7,6,11,28,5,4,3,10,29,2,1,0,9,45,46,47 },{ 18,21,24,6,11,14,17,36,3,10,13,16,39,0,9,12,15,42,47,50,53 },{ 6,7,8,11,18,19,20,27,14,21,22,23,30,17,24,25,26,33,36,37,38 },{ 26,23,20,38,33,30,27,8,41,..
백준 :: BOJ :: 15686 :: 치킨 배달 출처 : https://www.acmicpc.net/problem/15686 #include using namespace std; struct s {int r, c, ch;};int N, M, tmp, ans;vector h, c;vectora;vector hh; void dfs(int n, int ii) {if (n == M) {int r = 0;for (int i = 0; i < h.size(); i++) {int rr = 1e9;for (int j = 0; j < a.size(); j++) {rr = min(rr, hh[i][a[j]]);}r += rr;}ans = min(ans, r);return;} for (int i = ii; i < c.siz..
백준 :: BOJ :: 15685 :: 드래곤 커브 출처 : https://www.acmicpc.net/problem/15685 #include using namespace std; struct dc {int x, y, d, s;};int N, ans, arr[101][101]; dc p;int dx[] = {1,0,-1,0}, dy[] = {0,-1,0,1};bool visited[101][101];vector v; vector dir; inline bool check(int x, int y) { return arr[y][x] && arr[y + 1][x] && arr[y][x + 1] && arr[y + 1][x + 1] ? true : false; } void cal() {dir.push_back(..
[업데이트 중...] 최신 문제들 풀이 : https://2heedu.tistory.com/16919 하반기, 19 상반기, 18 하반기, 18 상반기 관련 문제 : https://2heedu.tistory.com/169 옛날 코드들은 코드를 작성한지 꽤 시간이 지나서 좋지않은 코드가 많습니다. 참고해주세요.다시 풀면서 수정해나가겠습니다. 삼성 SW 테스트 (S직군 인적성) 관련 알고리즘 문제들을 정리하였다. 백준 사이트에 있는 기출 문제와 SWEA에 있는 모의 SW 테스트 문제를 정리하였다. 문제의 분류는 직접 푼 방법으로 나누어 보았고, 난이도는 주관적인 기준이다. 문제 정리 [완전탐색]시험 감독 (기출) / 백준 13458 / 난이도 1보물상자 비밀번호 (모의 기출) / SWEA 5658 / 난이도..
백준 :: BOJ :: 14499 :: 주사위 굴리기 출처 : https://www.acmicpc.net/problem/14499 #include using namespace std; int N, M, x, y, K;int arr[20][20];vectordice = { 0,0,0,0,0,0 };int dx[] = {0,1,-1,0,0}, dy[] = {0,0,0,-1,1}; inline bool check(int i, int j) { return i >= 0 && j >= 0 && i < N && j < M ? true : false; } void Rolling(int d) {vectortmp(dice);if (d == 1) {dice[0] = tmp[3]; dice[2] = tmp[0]; dice[3..
백준 :: BOJ :: 7576 :: 토마토 출처 : https://www.acmicpc.net/problem/7576 #include using namespace std; struct a {int i, j;};int N, M, ans, result;int arr[1000][1000];int di[] = { 0,0,1,-1 }, dj[] = {1,-1,0,0};bool visited[1000][1000];queue q; inline bool check(int i, int j) { return (i >= 0 && j >= 0 && i < N && j < M) ? true : false; } int bfs() {if (ans == 0) return 0;while (!q.empty()) {int t = q.s..
백준 :: BOJ :: 2178 :: 미로탐색 출처 : https://www.acmicpc.net/problem/2178 #include using namespace std; struct a {int i, j, c;};int N, M, ans;int arr[101][101];int di[] = { 0,0,1,-1 }, dj[] = {1,-1,0,0};bool visited[101][101]; inline bool check(int i, int j) { return (i > 0 && j > 0 && i N >> M; ans = 0;for (int i = 1; i
출처 : https://www.hackerrank.com/challenges/connected-cell-in-a-grid/problem #include using namespace std; bool visited[10][10];int cnt, dy[] = {0,0,1,-1, 1, 1 , -1, -1}, dx[] = {1,-1,0,0,-1,1,1,-1};inline bool check(int i, int j, int n, int m) { return (i >= 0 && j >= 0 && i < n && j < m) ? true : false; } int dfs(int n, int m, int i, int j, int cnt, vector v) { visited[i][j] = 1; cnt++; for (in..
출처 : https://www.hackerrank.com/challenges/lilys-homework/problem #include using namespace std; vector split_string(string); int cnt(vectorarr, vectora, map m) { int ans = 0; for (int i = 0; i> n; cin.ignore(numeric_limits::max(), '\n'); string arr_temp_temp; getline(cin, arr_temp_temp); vector arr_temp = split_string(arr_temp_temp); vector arr(n); for (int i = 0; i < n; i++) { int arr_item = st..
- Total
- Today
- Yesterday
- SW Expert Academy
- 알고리즘
- STL
- 트렌드
- 새로운 게임 2
- SWEA
- DP
- 연구소 3
- 17837
- 17142
- 백준
- string
- DFS
- 팁
- boj
- 17144
- 이차원 배열과 연산
- scanf
- 미세먼지 안녕!
- 시간 복잡도
- 17143
- 역량 테스트
- 2018 KAKAO BLIND RECRUITMENT
- 게리맨더링 2
- 17140
- 입출력
- hackerrank
- 17779
- 2018 카카오 블라인드 채용
- 삼성
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |