본문 바로가기
반응형

분류 전체보기1062

[코드트리] 바이러스 백신 (삼성 SW 역량테스트 2019 상반기 오후 2번) SW 역량테스트 합격하기 A형 강의 오픈!! (인프런 바로가기) 삼성 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 };i.. 2024. 6. 8.
[코드트리] 격자 숫자 놀이 (삼성 SW 역량테스트 2019 상반기 오후 1번) SW 역량테스트 합격하기 A형 강의 오픈!! (인프런 바로가기) 삼성 A형 전체 링크 https://www.codetree.ai/training-field/frequent-problems/problems/matrix-number-play 격자 숫자 놀이 문제 풀이는 BOJ 17140 : 이차원 배열과 연산과 같다.#include #define MAX (100 + 20)int T;int R, C, K;int MAP[MAX][MAX];typedef struct st{ int number; int count;}NC;NC numberCount[MAX];int ncnt = 0;void input(){ scanf("%d %d %d", &R, &C, &K); for (int r = 0; r numberCount[k.. 2024. 6. 8.
[코드트리] 생명과학부 랩 인턴 (삼성 SW 역량테스트 2019 상반기 오전 2번) SW 역량테스트 합격하기 A형 강의 오픈!! (인프런 바로가기) 삼성 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 in.. 2024. 6. 8.
[코드트리] 시공의 돌풍 (삼성 SW 역량테스트 2019 상반기 오전 1번) SW 역량테스트 합격하기 A형 강의 오픈!! (인프런 바로가기) 삼성 A형 전체 링크 https://www.codetree.ai/training-field/frequent-problems/problems/heros-of-storm 시공의 돌풍 문제 풀이는 BOJ 17144 : 미세먼지 안녕! 과 같다.#include #define MAX (50 + 10)int T;int R, C, time;int MAP[MAX][MAX];typedef struct st{ int r; int c;}RC;RC tornado[2];int tcnt;void input(){ scanf("%d %d %d", &R, &C, &time); tcnt = 0; for (int r = 1; r 0) { int cnt, dust;.. 2024. 6. 8.
[코드트리] 전투 로봇 (삼성 SW 역량테스트 2018 하반기 오후 2번) SW 역량테스트 합격하기 A형 강의 오픈!! (인프런 바로가기) 삼성 A형 전체 링크 https://www.codetree.ai/training-field/frequent-problems/problems/fighting-robot 전투 로봇 문제 풀이는 BOJ 16236 : 아기 상어와 같다.#include #define MAX (20 + 10)int T;int N;int MAP[MAX][MAX];int visit[MAX][MAX];typedef struct st1{ int r; int c; int eat; int size;}ROBOT;ROBOT attackRobot;typedef struct st2{ int r; int c;}QUEUE;QUEUE queue[MAX * MAX];int wp, rp;int.. 2024. 6. 8.
[코드트리] 바이러스 실험 (삼성 SW 역량테스트 2018 하반기 오후 1번) SW 역량테스트 합격하기 A형 강의 오픈!! (인프런 바로가기) 삼성 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, .. 2024. 6. 8.
[코드트리] 토스트 계란틀 (삼성 SW 역량테스트 2018 하반기 오전 2번) SW 역량테스트 합격하기 A형 강의 오픈!! (인프런 바로가기) 삼성 A형 전체 링크 https://www.codetree.ai/training-field/frequent-problems/problems/toast-eggmold 토스트 계란틀 문제 풀이는 BOJ 16234 : 인구 이동과 같다.#include #define MAX (100 + 20)#define abs(a) (((a) > 0) ? (a) : -(a))int T;int N, L, R;int A[MAX][MAX];typedef struct st{ int r; int c;}QUEUE;QUEUE queue[MAX * MAX];int wp, rp;void input(){ scanf("%d %d %d", &N, &L, &R); for (int r .. 2024. 6. 8.
[코드트리] 병원 거리 최소화하기 (삼성 SW 역량테스트 2018 상반기 오후 2번) A형 필수 알고리즘을 체계적으로 배우고 싶다면? (인프런 바로가기) 삼성 A형 전체 링크 https://www.codetree.ai/training-field/frequent-problems/problems/min-of-hospital-distance 병원 거리 최소화하기 문제 풀이는 BOJ 15686 : 치킨 배달과 같다.#include #define MAX (50 + 10)int T;int N, M;int MAP[MAX][MAX];int hospitalList[MAX * 2];typedef struct st{ int r; int c;}RC;RC person[MAX * 2];RC hospital[13 + 5];int pcnt, hcnt;int minAnswer;int abs(int a, int b){ .. 2024. 6. 8.
[코드트리] 드래곤 커브 (삼성 SW 역량테스트 2018 상반기 오후 1번) A형 필수 알고리즘을 체계적으로 배우고 싶다면? (인프런 바로가기) 삼성 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.
반응형