본문 바로가기
반응형

분류 전체보기1062

[코드트리] 디버깅 (삼성 SW 역량테스트 2018 상반기 오전 2번) A형 필수 알고리즘을 체계적으로 배우고 싶다면? (인프런 바로가기) 삼성 A형 전체 링크 https://www.codetree.ai/training-field/frequent-problems/problems/debugging 디버깅 문제 풀이는 BOJ 15684 : 사다리 조작과 같다.#include int T;int N, M, H;int MAP[30 + 5][10 + 5];int PASS;void input(){ scanf("%d %d %d", &N, &M, &H); for (int r = 0; r 2024. 6. 7.
[코드트리] 이상한 체스 (삼성 SW 역량테스트 2018 상반기 오전 1번) A형 필수 알고리즘을 체계적으로 배우고 싶다면? (인프런 바로가기) 삼성 A형 전체 링크 https://www.codetree.ai/training-field/frequent-problems/problems/odd-chess 이상한 체스 문제 풀이는 BOJ 15683 : 감시와 같다.#include #define MAX (10 + 2)int T;int N, M;int MAP[MAX][MAX];typedef struct st { int r; int c; int number;}CAMERA;CAMERA camera[8 + 2];CAMERA camera5[8 + 2];int cidx;int cidx5;int minAnswer;/* 순서대로 왼쪽, 위, 오른쪽, 아래 */int dr[] = { 0,-1,0,1 }.. 2024. 6. 7.
[코드트리] 연산자 배치하기 (삼성 SW 역량테스트 2017 하반기 오후 2번) A형 필수 알고리즘을 체계적으로 배우고 싶다면? (인프런 바로가기) 삼성 A형 전체 링크 https://www.codetree.ai/training-field/frequent-problems/problems/arrange-operator 연산자 배치하기 문제 풀이는 BOJ 14888 : 연산자 끼워넣기와 같다.#include #define MAX (100 + 20)int T;int N;int numbers[MAX];int possible[5];int minAnswer, maxAnswer;void input(){ scanf("%d", &N); for (int i = 0; i N - 2) { int tmp = calculate(); if (maxAnswer tmp) minAnswer = tmp; } .. 2024. 6. 7.
[코드트리] 돌아가는 팔각의자 (삼성 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.
반응형