본문 바로가기
반응형

알고리즘/[ADV] 삼성 SW 역량 테스트 A형117

[코드트리] 방화벽 설치하기 (삼성 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.
[코드트리] 2개의 사탕 (삼성 SW 역량테스트 2015 하반기 2번 문제) SW 역량테스트 합격하기 A형 강의 오픈!! (인프런 바로가기) 삼성 A형 전체 링크  https://www.codetree.ai/training-field/frequent-problems/problems/two-candies 2개의 사탕 문제 풀이는 BOJ 13460 : 구슬 탈출 2와 같다.#include #define MAX (10 + 5)int T;int N, M;char MAP[MAX][MAX];typedef struct st{ int r; int c;}CANDY;CANDY red;CANDY blue;int dr[] = { 0, -1, 0, 1 };int dc[] = { -1, 0, 1, 0 };int minAnswer;void input(void){ minAnswer = 0x7FFF0000; .. 2024. 6. 5.
[코드트리] 바이러스 검사 (삼성 SW 역량테스트 2015 하반기 1번 문제) A형 필수 알고리즘을 체계적으로 배우고 싶다면? (인프런 바로가기) 삼성 A형 전체 링크  https://www.codetree.ai/training-field/frequent-problems/problems/virus-detector 바이러스 검사 문제 풀이는 BOJ 13458 : 시험 감독과 같다.#include #define MAX (1000000 + 50000)typedef long long ll;int T;int N;int restaurant[MAX];int leader, member;void input(){ scanf("%d", &N); for (int i = 0; i 0) sum += (restaurant[i] - 1) / member + 1; } printf("%llu\n", .. 2024. 6. 3.
BOJ 23291 : 어항 정리 (삼성 SW TEST A형) A형 필수 알고리즘을 체계적으로 배우고 싶다면? (인프런 바로가기) 삼성 A형 전체 링크 www.acmicpc.net/workbook/view/1152 (A형 문제집) https://www.acmicpc.net/problem/23291 어항은 N x N 배열의 row = N 부터 채워나간다.#define MAX (100 + 10)int N, K;int FISH[MAX][MAX];void input(){ scanf("%d %d", &N, &K); for (int i = 1; i  main은 아래와 같이 구성된다. addFish() - 가장 적은 어항에 물고기 추가move() - 가능한 만큼 어항 쌓기spreadFish() - 물고기의 이동fishSort() - 어항 재정리fold() - 어항 2번 접기sp.. 2021. 11. 6.
반응형