'마스터' 태그의 글 목록
본문 바로가기
728x90
반응형

마스터4

2021.10.30_1220-Magnetic 소스코드 #include #include #include #include using namespace std; #define SIZE 100 struct Data { int y, x; }; int answer; int board[SIZE][SIZE]; vectormagnetic; void initData();//초기화 및 초기 입력 void moveMagnetic();//마그네틱 이동 int main() { int test_case; int T; for (test_case = 1; test_case =SIZE) { board[i][j] = 0; continue; } if (board[i+1][j] == 0) { board[i][j] = 0; board[i+1][j] = 1; i++; flag = 1; }.. 2021. 10. 30.
14502 연구소(리팩토링) www.acmicpc.net/problem/14502 14502번: 연구소 인체에 치명적인 바이러스를 연구하던 연구소에서 바이러스가 유출되었다. 다행히 바이러스는 아직 퍼지지 않았고, 바이러스의 확산을 막기 위해서 연구소에 벽을 세우려고 한다. 연구소는 크 www.acmicpc.net #include #include #include #include #include using namespace std; #define MAP_MAX_SIZE 9 #define INSTALL_WALL 1 #define UNINSTALL_WALL 0 #define VIRUS 2 int N, M;//가로 세로의 크기 입력 변수 int map_arr[MAP_MAX_SIZE][MAP_MAX_SIZE];//입력으로 주어지는 맵 정보 i.. 2021. 3. 19.
15686 치킨 배달 www.acmicpc.net/problem/15686 15686번: 치킨 배달 크기가 N×N인 도시가 있다. 도시는 1×1크기의 칸으로 나누어져 있다. 도시의 각 칸은 빈 칸, 치킨집, 집 중 하나이다. 도시의 칸은 (r, c)와 같은 형태로 나타내고, r행 c열 또는 위에서부터 r번째 칸 www.acmicpc.net #include #include #include #include using namespace std; #define NS 51//배열 최대 크기 int N, M;//배열크기, 치킨 뽑는수; struct Pos { int y; int x; }; vectorH;//집 정보 vectorC;//치킨 정보 vectorD;//뽑는 치킨 int ret;//최소 값 void dfs(int idx, int.. 2021. 3. 16.
연구소 2 www.acmicpc.net/problem/17141 17141번: 연구소 2 인체에 치명적인 바이러스를 연구하던 연구소에 승원이가 침입했고, 바이러스를 유출하려고 한다. 승원이는 연구소의 특정 위치에 바이러스 M개를 놓을 것이고, 승원이의 신호와 동시에 바이�� www.acmicpc.net #include #include #include #include #include using namespace std; #define NS 51//연구소의 최대 크기 #define MS 11 int N, M, ret;//연구소의 크기, 바이러스 선정 개수, 결과값 저장 변수 int lab[NS][NS];//연구소 배열 int dy[] = { 0,1,0,-1 }; int dx[] = { 1,0,-1,0 }; struct.. 2020. 10. 12.
728x90
반응형