[코드트리] 바이러스 실험 (삼성 SW 역량테스트 2018 하반기 오후 1번)
삼성 A형 전체 링크 https://www.codetree.ai/training-field/frequent-problems/problems/virus-experiment 바이러스 실험 문제 풀이는 BOJ 16235 : 나무 재테크와 같다.#include #define MAX (10 + 5)int T;int N, M, K;int energy[MAX][MAX];int A[MAX][MAX];int virus[MAX][MAX][50000 + 50000];int front[MAX][MAX];int back[MAX][MAX];int dr[] = { -1, -1, -1, 0, 0, 1, 1, 1 };int dc[] = { -1, 0, 1, -1, 1, -1, 0, 1 };void input(){ scanf("%d %..
2024. 6. 8.
[코드트리] 드래곤 커브 (삼성 SW 역량테스트 2018 상반기 오후 1번)
삼성 A형 전체 링크 https://www.codetree.ai/training-field/frequent-problems/problems/dragon-curve 드래곤 커브 문제 풀이는 BOJ 15685 : 드래곤 커브와 같다. (x, y 좌표가 반대)#include #define MAX (100 + 20)int T;int N, y, x, d, g;int MAP[MAX][MAX];int moveList[2000];int dx[] = { 0, -1, 0, 1 };int dy[] = { 1, 0, -1, 0 };void DFS(int L, int length){ if (L > g) return; for (int i = length + 1; i
2024. 6. 7.
[코드트리] 이상한 체스 (삼성 SW 역량테스트 2018 상반기 오전 1번)
삼성 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 };int dc[] = { -1,0,1,0 };void input(){..
2024. 6. 7.