[코드트리] 자율주행 자동차 (삼성 SW 역량테스트 2017 상반기 오후 1번)
삼성 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 상반기 오전 1번 문제)
삼성 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 }, { 1, 0, 0, 0 } }, { { 1, 1, 0, 0 ..
2024. 6. 6.
[코드트리] 정육면체 굴리기 (삼성 SW 역량테스트 2016 하반기 1번 문제)
삼성 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[] = { 0, 1, -1, 0, 0 };void moveEast(){ int..
2024. 6. 5.