BOJ

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

180212_5554_심부름 가는 길

//https://www.acmicpc.net/problem/5554 #include using namespace std; int sum(){ int a; int ans=0; for(int i=0; i> a; ans+=a; } return ans;} int main(){ int sum1=0; sum1=sum(); cout

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

180210_1057_토너먼트

//https://www.acmicpc.net/problem/1057 #include using namespace std;int N, A, B; int main(){ cin >> N >> A >> B; int ans=1; while(1){ if((!(A%2) && B==A-1) ||(!(B%2) && A==B-1)) break; else { if(A%2) A=(A+1)/2; else A=A/2; if(B%2) B=(B+1)/2; else B=B/2; } ans++; } cout

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

180210_3055_탈출

//https://www.acmicpc.net/problem/3055 #include #include #include using namespace std;char map[52][52];int visited[52][52];int R, C;int sy1, sx1, desy, desx;bool wchk;int cnt;int dy[4]={0,0,1,-1};int dx[4]={1,-1,0,0};queue water; void input(){ cin >> R >> C; for(int i=0; i> map[i]; } void find_start_point(){ for(int i=0; i q; q.push(make_pair(sy1,sx1)); int cnt2=0; int tmp=cnt; int tmp2=..

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

180210_1018_체스판 다시 칠하기

//https://www.acmicpc.net/problem/1018 #include #include using namespace std;int N, M, mn;char map[50][50]; void input(){ cin >> N >> M; for(int i=0; i> map[i];} int painting_white_fst(int y, int x){ int cnt=0; for(int i=y; i> M; for(int i=0; i> map[i];} int painting_white_fst(int y, int x){ int cnt=0; for(int i=y; i

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