BOJ

알고리즘 문제 풀이/1DP_과제(~180615)

180417_15685_드래곤커브

//https://www.acmicpc.net/problem/15685 #include #include using namespace std; #define right 0#define up 1#define left 2#define down 3 int dy[4]={0,-1, 0, 1};int dx[4]={1, 0,-1, 0}; bool map[101][101]; int main(){ int N; cin >> N; int cnt=0; for(int i=0; i> x >> y >> d >>g; map[y][x]=1; map[y+dy[d]][x+dx[d]]=1; vector st; st.push_back(d); st.push_back(d); int tmpy=y+dy[d]; int tmpx=x+dx[d]; int ..

알고리즘 문제 풀이/1DP_과제(~180615)

180410_2161_카드1

//https://www.acmicpc.net/problem/2161 #include #include using namespace std; queue q;queue card;int main(){ int N; cin >> N; for(int i=1; i

알고리즘 문제 풀이/1DP_과제(~180615)

180408_3190_뱀

//https://www.acmicpc.net/problem/3190 #include #include #include using namespace std;int N, K, L; int map[100][100]; //머리의 방향#define UP 0#define RIGHT 1#define DOWN 2#define LEFT 3//머리의 방향에 따른 다음 이동 방향//UP일 때, ny=y+dy[0], nx=x+dx[0]...int dy[4]={-1,0,1,0};int dx[4]={0,1,0,-1}; //뱀 몸통은 큐를 이용//사과를 먹지않으면 꼬리(=front, 제일 처음 집어넣은 값) pop//매초 이동시에 머리(=back, 제일 마지막에 집어넣은 값) pushqueue snake; int main(){ c..

알고리즘 문제 풀이/1DP_과제(~180615)

180407_13460_째로탈출 2

//https://www.acmicpc.net/problem/13460 #include #include using namespace std; #define UP 0#define DOWN 1#define LEFT 2#define RIGHT 3 class ball{public : int x; int y; ball(int _x=0, int _y=0) : x(_x), y(_y) {}};char map[10][10];char cache[11][10][10];int N, M;int mn=11; ball R;ball B;int chk; //map inputvoid input(){ cin >> N >> M; for(int i=0; i map[i][j]; if(map[i][j]=='R'){ R.y=i; R.x=j; } ..

bong sue
'BOJ' 태그의 글 목록 (5 Page)