5644. 무선 충전
#define ABS(X) ((X > 0) ? X : -X) using namespace std; typedef struct { int y, x, c, p; }BC; static int M, A; static int d[5][2] = { 0, 0, //dont move -1, 0, //up 0, 1, //right 1, 0, //down 0, -1 //left }; //문제에서 제시하는 방향을 정확히 볼 것, static int find_max(vector& used, const vector & BCs) { int max = 0; //used가 사용할 수 있는 BC들의 리스트 중 충전양이 최대인 것을 찾는다. for (int i = 0; i < used.size(); i++) { int idx = use..
5650. 핀볼게임
#define UP 0 #define DOWN 1 #define LEFT 2 #define RIGHT 3 using namespace std; static int N; static int board[100][100]; static int d[4][2] = { -1, 0, 1, 0, 0, -1, 0, 1 }; //row: y, column: x static int changed[4][6] = { DOWN, DOWN, RIGHT, LEFT, DOWN, DOWN, UP, RIGHT, UP, UP, LEFT, UP, RIGHT, UP, DOWN, RIGHT, RIGHT, RIGHT, LEFT, LEFT, LEFT, DOWN, UP, LEFT }; //row: current direction, column: ob..
8673
static int K; static int tables[2][100000]; static int cnt[] = { 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024 }; static int solution(void) { int n, loop, turn = 0, tot = 0; scanf("%d", &K); for (int i = 0; i 0) { for (int i = 0, j = 0; i tables[turn][i + 1]) { tables[1 - tu..
5650
static int N; static int board[100][100]; static int map_y[11][100]; static int map_x[11][100]; static int d[4][2] = { -1, 0, //up, 0 1, 0, //down, 1 0, -1, //left, 2 0, 1 //right, 3 }; static int changed[4][6] = { 1, 1, 3, 2, 1, 1, 0, 3, 0, 0, 2, 0, 3, 0, 1, 3, 3, 3, 2, 2, 2, 1, 0, 2 }; static bool out_of_bound(int y, int x) { if (y = N) return true; if (x = N) return true; ..
1949
static int N, K; static int board[8][8]; static int start[5][2]; //최고봉 위치는 최대 5개, static int d[4][2] = { -1, 0, //up 1, 0, //down 0, -1, //left 0, 1 //right }; static int visit[8][8]; static int max_len; static inline bool out_of_bound(int y, int x) { if (y = N) return true; if (x = N) return true; return false; } static void __solution(int y, int x, int len, int is_cut) { if..