'분류 전체보기' 카테고리의 글 목록 (21 Page)
본문 바로가기
728x90
반응형

분류 전체보기826

2022-04-28-19238-스타트택시 01.택시 승하차 01.1 손님 탐색 int visit[NS][NS] = { 0, }; queuet; Taxi.feul = F; t.push(Taxi); int minY, minX, minCnt; minY = minX = minCnt = 0x7fffffff; int fuel, used; visit[Taxi.y][Taxi.x] = 0; int number = 0; while (!t.empty()) { Pos c = t.front(); t.pop(); //if (c.feul == 0 && startBoard[c.y][c.x].isStart != 1) return -1; if (startBoard[c.y][c.x].isStart == 1) { // 최소값 뽑는 부분 if (minCnt >= c.cnt) { m.. 2022. 4. 28.
2022-04-27-17837-새로운게임2 01.white이동 int white(int number, int y, int x, int dir) { Data n; n.num = number; n.y = y + dy[dir]; n.x = x + dx[dir]; int chk = 0; for (int i = 0; i < board[y][x].size(); i++) { if (board[y][x][i] == number || chk) { chk = 1; board[n.y][n.x].push_back(board[y][x][i]);//변경 horse[board[y][x][i]].y = n.y; horse[board[y][x][i]].x = n.x; board[y][x].erase(board[y][x].begin() + i); //삭제 i--; } } if .. 2022. 4. 28.
2022-04-27-17825-주사위윷놀이 01.말의 순서 뽑기 void dfs(int idx) { if (idx == 10) { int num = play(); if (num == 0) return; ret = ret 25 horse[num].pidx = 30; } else if (horse[num].idx == 32)horse[num].pidx = 20;//35->40 else if (horse[num].idx == 21)horse[num].pidx = -1;//40->도착 } for (int j = 1; j 13 else if (horse[num].idx == 10)horse[num].pidx = 25;//20->22 else if (horse[.. 2022. 4. 28.
2022-04-26-17779-게리맨더링2 01.1번구역지정 void one(int x, int y, int d1, int d2) { for (int i = 1; i < x + d1; i++) { for (int j = 1; j 2022. 4. 28.
728x90
반응형