'완전탐색' 태그의 글 목록 (3 Page)
2021.09.23_17143-낚시왕
소스코드 #include #include #include #include #include using namespace std; #define SIZE 101 struct Data { int y, x, speed, dir, size; }; int R, C, M;//가로 세로 상어 수 int answer;//결과값 vectorsea; int dy[] = { 0,-1,1,0,0 }; int dx[] = { 0,0,0,1,-1 }; void init();//초기화 bool safeZone(int y, int x);// 범위 체크 void fishing();//낚시 시작 bool cmp(Data a, Data b) {//오름 차순 정렬 if (a.y == b.y)return a.x < b.x; return a.y..
2021. 9. 23.
2021.09.20_16236-아기상어
소스코드 #include #include #include #include #include #include using namespace std; #define SIZE 21 int N;//배열의 크기, 물고기 숫자 int answer;//결과값 int sea[SIZE][SIZE];//바다의 정보 저장 int dy[] = { 0,1,0,-1 }; int dx[] = { 1,0,-1,0 }; struct Data { int y, x, size,cnt; }shark; void init();//초기화 void eatingShark();//실제 시뮬레이션 bool safeZone(int y, int x);//범위 체크 int main(void) { int testCase = 1; for (int tc = 1; tc
2021. 9. 21.