[ 백준 / C++ ] 19237 : 어른 상어
[ 문제 ] 19237번: 어른 상어 [ 접근방법 ] 상어의 이동하기, 쫓아내기, 냄새 뿌리기를 각각 함수로 구현하여 main 함수를 깔끔하게 만들었다. [ 소스코드 ] #include using namespace std;struct Cell{ int smellNum, smellTime, sharkNum;};struct Shark{ int x, y, curDir, priorDir[5][5]; bool isDead = false;};int n, m, k, sharkCount, timeElapsed;Cell grid[25][25];Shark sharks[405];int dx[5] = {0, -1, 1, 0, 0};int dy[5] = {0, 0, 0, -1, 1};void init(){ ..