전체 글
-
[백준 15898] 피아의 아틀리에 ~신비한 대회의 연금술사~C 프로그래밍/BOJ 2022. 10. 30. 00:14
https://www.acmicpc.net/problem/15898 15898번: 피아의 아틀리에 ~신비한 대회의 연금술사~ "피아의 아틀리에 ~신비한 대회의 연금술사~"는 가난한 연금술사 피아의 성장스토리를 담은 게임이다. 이 게임의 가장 중요한 부분은 "대회"인데, 연금술로 높은 품질의 물건을 만들어 상금을 타 www.acmicpc.net #include #include #include int N; int ingred[10 + 2][4][4]; char color[10 + 2][4][4]; int ans; int Gama[5][5]; char Gama_c[5][5]; int choice[10 + 2]; int Location[4][2] = { {0, 0}, {0, 1}, {1, 0}, {1, 1} }..
-
[백준 18809] GaaaaaaaaaardenC 프로그래밍/BOJ 2022. 10. 28. 22:41
=https://www.acmicpc.net/problem/18809 18809번: Gaaaaaaaaaarden 첫째 줄에 정원의 행의 개수와 열의 개수를 나타내는 N(2 ≤ N ≤ 50)과 M(2 ≤ M ≤ 50), 그리고 초록색 배양액의 개수 G(1 ≤ G ≤ 5)와 빨간색 배양액의 개수 R(1 ≤ R ≤ 5)이 한 칸의 빈칸을 사이에 두 www.acmicpc.net #include #include #include #include int N, M, G, R;// 최대 50 * 50맵// G, R 최대 5개 int board[50 + 2][50 + 2];// 정보맵 int F[50 + 2][50 + 2];// 꽃 피우는 맵 int visited[50 + 2][50 + 2];// 시간 저장 int ans..
-
[코드트리 44] 술래잡기C 프로그래밍/CODE TREE 삼성 기출 복원 2022. 10. 28. 22:37
++ 22.12.12 갱신 https://www.codetree.ai/training-field/frequent-problems/hide-and-seek/description?page=3&pageSize=20 코드트리 국가대표가 만든 코딩 공부의 가이드북 코딩 왕초보부터 꿈의 직장 코테 합격까지, 국가대표가 엄선한 커리큘럼으로 준비해보세요. www.codetree.ai #include #include #include int N, M, H, K; struct _st { int x, y; int dir; bool alive; }; _st Runner[10000 + 2]; int Tree[100 + 2][100 + 2]; struct _ct { int x, y; }; _ct Catcher_NPOS[10000 ..
-
[백준 2917] 늑대 사냥꾼C 프로그래밍/BOJ 2022. 10. 28. 00:19
https://www.acmicpc.net/problem/2917 2917번: 늑대 사냥꾼 첫째 줄에 N과 M (1 ≤ N, M ≤ 500)이 주어진다. 둘째 줄부터 N개 줄에는 숲의 지도가 주어진다. 지도에 'V'와 'J'는 딱 하나만 있고, 적어도 하나의 '+'가 있다. www.acmicpc.net #include #include #include #include int R, C;// 행,열 char board[500 + 2][500 + 2]; int Dist[500 + 2][500 + 2]; int hx, hy;// 현우좌표 int ox, oy;// 오두막 좌표 struct _st { int x, y; int dist; }; std::vector V; std::queue Q; int visited[5..
-
[자료구조] GreedyC 프로그래밍/BOJ 2022. 10. 26. 22:12
[백준 19598] 최소 회의실 개수 https://www.acmicpc.net/problem/19598 19598번: 최소 회의실 개수 서준이는 아빠로부터 N개의 회의를 모두 진행할 수 있는 최소 회의실 개수를 구하라는 미션을 받았다. 각 회의는 시작 시간과 끝나는 시간이 주어지고 한 회의실에서 동시에 두 개 이상의 회의 www.acmicpc.net #include #include #include #include int N; struct _st { int s, e; bool operator
-
[백준 1162] 도로포장C 프로그래밍/BOJ 2022. 10. 26. 00:24
https://www.acmicpc.net/problem/1162 1162번: 도로포장 첫 줄에는 도시의 수 N(1 ≤ N ≤ 10,000)과 도로의 수 M(1 ≤ M ≤ 50,000)과 포장할 도로의 수 K(1 ≤ K ≤ 20)가 공백으로 구분되어 주어진다. M개의 줄에 대해 도로가 연결하는 두 도시와 도로를 통과하 www.acmicpc.net #include #include #include int N, M, K; struct _lt { int node; long long int cost; }; std::list L[10000 + 2]; struct _qt { long long int node; long long int wrap; long long int cost; }; struct COMP { boo..
-
[백준 1175] 배달C 프로그래밍/BOJ 2022. 10. 25. 01:40
https://www.acmicpc.net/problem/1175 1175번: 배달 어제 선물을 모두 포장한 민식이는 이제 선물을 배달하려고 한다. 민식이가 선물을 배달할 곳은 이 문제를 읽는 사람들이 앉아 있는 교실이다. 교실은 직사각형모양이고, 모두 같은 크기의 정사 www.acmicpc.net #include #include int N, M; char board[50 + 2][50 + 2]; int visited[50 + 2][50 + 2][4 + 2][3 + 2];// (좌표) (방향) (어디어디 방문했는지) int arrv_bit[2] = { 1, 2 }; struct _qt { int x, y; int dir; int cnt; int arrv; bool chk[2] = {false, }; };..
-
[백준 1039] 교환C 프로그래밍/BOJ 2022. 10. 24. 21:28
https://www.acmicpc.net/problem/1039 1039번: 교환 첫째 줄에 정수 N과 K가 주어진다. N은 1,000,000보다 작거나 같은 자연수이고, K는 10보다 작거나 같은 자연수이다. www.acmicpc.net #include #include #include std::string s; int K; int visited[1000000 + 2][10 + 2];// 10번까지 바꿀 수 있다. struct _qt { std::string num; int change; }; struct COMP { bool operator() (_qt &a, _qt &b) { if (a.change == b.change) return a.num b.c..