'백준' 태그의 글 목록 (4 Page)
본문 바로가기
728x90
반응형

백준164

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.
2022-04-25-21610-마법사상어와비바라기 01.구름이동 int dir, S; scanf("%d %d", &dir, &S); S = S % N; for (int c = 0; c < cloud.size(); c++) {// 구름이동 for (int s = 0; s < S; s++) { Data n; n.y = cloud[c].y + dy[dir]; n.x = cloud[c].x + dx[dir]; if (n.y == 0) n.y = N; else if (n.y == N + 1)n.y = 1; if (n.x == 0) n.x = N; else if (n.x == N + 1)n.x = 1; cloud[c].y = n.y; cloud[c].x = n.x; } } 02.구름 위치에 비1씩 증가 int visit[NS][NS] = { 0 };// 사라지는 .. 2022. 4. 25.
728x90
반응형