목록SWtest (10)
Deep Learning study
#include using namespace std; #define FOR(i,a,b) for(int i=a ; ib ; i--) int x[4] = {0,0,1,-1}; int y[4] = {1,-1,0,0}; int R,C,T,r1,r2,r[2],m[51][51],v[51][51]; bool check(int x, int y){ return (x=0 && y=0); } void proliferation(int a, int b){ int cnt=0,prol = m[a][b]/5; FOR(i,0,4){ int nx = a + x[i], ny = b + y[i]; if(check(nx,ny) && m[nx][ny]!=-1) cnt++; } m[a][b] = m[a][b] - prol * cnt; v[a][..
#include using namespace std; #define FOR(i,a,b) for(int i=a ; i
#include using namespace std; #define x first #define y second #define FOR(i,a,b) for(int i=a ; i=0 && b =0 && board[a][b] != 2; } bool move(int nxt){ a += gox[cur_dir%4], b+= goy[cur_dir%4]; if(!check()) return false; snake.push(make_pair(a,b)); if(board[a][b] == 0){ pair tmp = snake.front(); board[tmp.x][tmp.y] = 0; snake.pop(); } board[a][b] = 2; if(nxt == 'L') cur_dir += 3; else if..
#include using namespace std; #define FOR(i,a,b) for(int i = a; i=b; i--) #define x first #define y second int board[16][16],pos[3],tmp[16][16],N,M,D,ANS; int dist(int a, int b, int c, int d){ return abs(a-c) + abs(b-d); } void update(){ FOR_(i,N-1,1) FOR(j,0,M) board[i][j] = board[i-1][j]; FOR(j,0,M) board[0][j] = 0; } int attack(){ int min[3] = {99,99,99}; vector co(3); FOR(i,0,3) co[i].x = 99..
#include using namespace std; int A[50][50],N,M,K,ANS = 1e9; vector order; struct{ int r,c,s; }rot[6]; void go(int r, int c, int s){ if(!s) return; int sr = r - s, sc = c - s, er = r + s, ec = c + s; int x = A[sr][sc], y = A[sr][ec], z = A[er][ec], w = A[er][sc]; for(int i = sr ; i sc ; i--) if(i==sc+1) A[sr..
#include using namespace std; #define pb push_back bool bracket[30]; vector oper; vector num; vector new_num; vector new_oper; int ANS = -1e9; int cal(int a , int b , char oper){ if(oper == '+') return a + b; else if(oper == '-') return a - b; else return a * b; } int fin_cal(int N){ new_num.clear(); new_oper.clear(); for(int i=0 ;i> N; cin >> arr; for(int i=0 ;i
#include using namespace std; int N; int arr[17][17]; //1 : 가로 ,2 : 세로 , 3 : 대각선 bool chk(int x, int y){ if(x N ; for(int i=1 ; i arr[i][j]; cout