[코드트리] 바이러스 백신 (삼성 SW 역량테스트 2019 상반기 오후 2번)
삼성 A형 전체 링크 https://www.codetree.ai/training-field/frequent-problems/problems/vaccine-for-virus 바이러스 백신 문제 풀이는 BOJ 17142 : 연구소 3과 같다.#include #define MAX (50 + 10)int T;int N, M;int MAP[MAX][MAX];int tmpMAP[MAX][MAX];typedef struct st{ int r; int c;}RC;RC queue[MAX*MAX];int wp, rp;RC virus[MAX*MAX];int vcnt;/* 순서대로 왼쪽, 위, 오른쪽, 아래 */int dr[] = { 0, -1, 0, 1 };int dc[] = { -1, 0, 1, 0 };int minAns..
2024. 6. 8.
[코드트리] 생명과학부 랩 인턴 (삼성 SW 역량테스트 2019 상반기 오전 2번)
삼성 A형 전체 링크 https://www.codetree.ai/training-field/frequent-problems/problems/biology-lab-intern 생명과학부 랩 인턴 문제 풀이는 BOJ 17143 : 낚시왕과 같다.#include #define MAX (100 + 20)int T;int R, C, M;typedef struct st{ int speed; int dir; int size;}MOLD;MOLD mold[MAX][MAX];/* 순서대로 1: 위, 2: 아래, 3: 오른쪽, 4: 왼쪽 */int dr[] = { 0, -1, 1, 0, 0 };int dc[] = { 0, 0, 0, 1, -1 };void input(){ scanf("%d %d %d", &R, &C, &M)..
2024. 6. 8.