BOJ

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

180406_14716_현수막

//https://www.acmicpc.net/problem/14716 #include #include #include using namespace std; bool map[250][250];//bool visited[250][250]; int N, M;int dy[8]={-1,-1,-1,0,0,1,1,1};int dx[8]={-1,0,1,-1,1,-1,0,1}; void input();void bfs(int y, int x); int main(){ int ans=0; input(); for(int i=0; i>N; for(int i=0; i map[i][j]; } }} void bfs(int y, int x){ queue q; q.push(make_pair(y, x)); map[y][x]=0; whil..

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

180406_14889_스타트와 링크

//https://www.acmicpc.net/problem/14889 #include #include using namespace std;int abs(int a, int b) { return (a-b)>(b-a)? (a-b):(b-a); } int s[21][21];bool start[20];int ss;//start scoreint ls;//link scoreint n;int mn=1e9; void dfs(int idx, int depth);int main(){ cin >> n; for(int i=0; i s[i][j]; else{ int a; cin >> a; s[j][i]+=a; } } for(int i=0; i

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

180405_14501_퇴사

//https://www.acmicpc.net/problem/14501 #include #include using namespace std; int N; int counsel[16][2];int dp[16]; void input();void solve(int today, int earn); int main(){ cin >> N; input(); solve(counsel[1][0], counsel[1][1]); solve(1, 0); cout counsel[i][0] >> counsel[i][1];} void solve(int today, int earn){ if(today=N){ return; } solve(today+counsel[today+1][0], earn+counsel[today+1][1]); ..

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

180404_14500_테트로미노

//https://www.acmicpc.net/problem/14500 #include #include using namespace std; int map[500][500];bool visited[500][500]; int dy[4]={0,0,1,-1};int dx[4]={1,-1,0,0};int N, M;int mx=0; void solve(int y, int x, int now);void dfs(int y, int x, int now, int depth); int main(){ cin >> N >> M; for(int i=0; i map[i][j]; } } for(int i=0; i

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