본문 바로가기
반응형

기출 문제93

[코드트리] 돌아가는 팔각의자 (삼성 SW 역량테스트 2017 하반기 오후 1번) A형 필수 알고리즘을 체계적으로 배우고 싶다면? (인프런 바로가기) 삼성 A형 전체 링크 https://www.codetree.ai/training-field/frequent-problems/problems/rounding-eight-angle 돌아가는 팔각의자 문제 풀이는 BOJ 14891 : 톱니바퀴와 같다.#include #define MAX (100 + 20)int T;int wheel[5][10];int N;int number[MAX];int direct[MAX];int list[6];void input(){ for (int number = 1; number = 2; index--) { wheel[number][index] = wheel[number][index - 1]; } wheel.. 2024. 6. 7.
[코드트리] 보도블럭 (삼성 SW 역량테스트 2017 하반기 오전 2번) A형 필수 알고리즘을 체계적으로 배우고 싶다면? (인프런 바로가기) 삼성 A형 전체 링크 https://www.codetree.ai/training-field/frequent-problems/problems/crosswalk 보도블럭 문제 풀이는 BOJ 14890 : 경사로와 같다.#include #define MAX (100 + 20)int T;int N, L;int MAP[MAX][MAX];int TMAP[MAX][MAX];void input(){ scanf("%d %d", &N, &L); for (int r = 0; r b) ? a - b : b - a;}int isFlat(int* arr, int start, int end){ int value = arr[start]; for (int i = s.. 2024. 6. 7.
[코드트리] 조삼모사 (삼성 SW 역량테스트 2017 하반기 오전 1번) A형 필수 알고리즘을 체계적으로 배우고 싶다면? (인프런 바로가기) 삼성 A형 전체 링크 https://www.codetree.ai/training-field/frequent-problems/problems/three-at-dawn-and-four-at-dusk 조삼모사 문제 풀이는 BOJ 14889 : 스타트와 링크와 같다.#include #define MAX (20 + 5)int T, N, halfN;int MAP[MAX][MAX];int visit[MAX];int minAnswer;void input(){ scanf("%d", &N); halfN = N / 2; for (int r = 0; r b) ? a - b : b - a;}int minValue(){ int pair[MAX * 2] = { .. 2024. 6. 7.
[코드트리] 방화벽 설치하기 (삼성 SW 역량테스트 2017 상반기 오후 2번) A형 필수 알고리즘을 체계적으로 배우고 싶다면? (인프런 바로가기) 삼성 A형 전체 링크 https://www.codetree.ai/training-field/frequent-problems/problems/firewall-installation 방화벽 설치하기 문제 풀이는 BOJ 14502 : 연구소와 같다.#include #define MAX (15)int T;int N, M;int MAP[MAX][MAX];int tmpMAP[MAX][MAX];typedef struct st{ int r; int c;}QUEUE;QUEUE queue[MAX*MAX];int wp, rp;void input(){ scanf("%d %d", &N, &M); for (int r = 0; r rp) { QUEUE out .. 2024. 6. 7.
[코드트리] 자율주행 자동차 (삼성 SW 역량테스트 2017 상반기 오후 1번) A형 필수 알고리즘을 체계적으로 배우고 싶다면? (인프런 바로가기) 삼성 A형 전체 링크 https://www.codetree.ai/training-field/frequent-problems/problems/autonomous-driving 자율주행 자동차 문제 풀이는 BOJ 14503 : 로봇 청소기와 같다.#include #define MAX (50 + 5)int T;int N, M, R, C, D;int MAP[MAX][MAX];int dr[] = { -1, 0, 1, 0 };int dc[] = { 0, 1, 0, -1 };void input(){ scanf("%d %d %d %d %d", &N, &M, &R, &C, &D); for (int r = 0; r 2024. 6. 6.
[코드트리] 외주 수익 최대화하기 (삼성 SW 역량테스트 2017 상반기 오전 2번) A형 필수 알고리즘을 체계적으로 배우고 싶다면? (인프런 바로가기) 삼성 A형 전체 링크 https://www.codetree.ai/training-field/frequent-problems/problems/max-of-outsourcing-profit 외주 수익 최대화하기 문제 풀이는 BOJ 14501 : 퇴사와 같다.#include #define MAX (20+10)int T;int N;int time[MAX];int profit[MAX];int answer;void input(){ scanf("%d", &N); for (int i = 1; i N) { if (start + time[start] == N + 1) sum += profit[start]; if (answer 2024. 6. 6.
[코드트리] 테트리스 블럭 안의 합 최대화 하기 (삼성 SW 역량테스트 2017 상반기 오전 1번 문제) A형 필수 알고리즘을 체계적으로 배우고 싶다면? (인프런 바로가기) 삼성 A형 전체 링크 https://www.codetree.ai/training-field/frequent-problems/problems/max-sum-of-tetris-block 테트리스 블럭 안의 합 최대화 하기 문제 풀이는 BOJ 14500 : 테트로미노와 같다.#include #define MAX (500 +50)int T;int N, M;int MAP[MAX][MAX];int BLOCK[19][4][4] ={ { { 1, 1, 1, 1 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 } }, { { 1, 0, 0, 0 }, { 1, 0, 0, 0 }, { 1, 0, 0, 0 .. 2024. 6. 6.
[코드트리] 2048 게임 (삼성 SW 역량테스트 2016 하반기 2번 문제) SW 역량테스트 합격하기 A형 강의 오픈!! (인프런 바로가기) 삼성 A형 전체 링크 https://www.codetree.ai/training-field/frequent-problems/problems/2048-game 2048 게임 문제 풀이는 BOJ 12100 : 2048 Easy와 같다.#include #define MAX (20 + 5)#define LEFT (0)#define UP (1)#define RIGHT (2)#define DOWN (3)int T;int N;int MAP[MAX][MAX];int ANSWER;void(*pMove[5])(int map[][MAX]);void input(){ scanf("%d", &N); for (int r = 0; r = 0; c--) { if (.. 2024. 6. 6.
[코드트리] 정육면체 굴리기 (삼성 SW 역량테스트 2016 하반기 1번 문제) A형 필수 알고리즘을 체계적으로 배우고 싶다면? (인프런 바로가기) 삼성 A형 전체 링크 https://www.codetree.ai/training-field/frequent-problems/problems/cube-rounding 정육면체 굴리기 문제 풀이는 BOJ 14499 : 주사위 굴리기와 같다.#include #define MAX (20+5)int T;int N, M, X, Y, K;int MAP[MAX][MAX];int command[1000 + 50];typedef struct st{ int up; int left; int top; int right; int down; int bottom;}CUBE;CUBE cube;int dr[] = { 0, 0, 0, -1, 1 };int dc[] = {.. 2024. 6. 5.
반응형