목록 ToTal (296)
:: ADVANCE ::
BAEKJOON ONLINE JUDGE 2792 보석 상자 https://www.acmicpc.net/problem/2792 보석을 받지 못하는 학생도 있다 -> 보석은 꼭 배분해야 한다. 라고 해석최대값을 지정해 놓고 그 이하의 개수로 분배를 할 때 받는 학생의 수를 세서분배를 위해 필요한 학생의 수가 존재하는 학생의 수보다 많으면 -> 보석을 전부 분배할 수 없다 -> 최대값을 늘린다.분배를 위해 필요한 학생의 수가 존재하는 학생의 수보다 작으면 -> 보석을 전부 분배할 수 있다 -> 최대값을 줄일 수 있다.=> 이분탐색 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748#include int n..
BAEKJOON ONLINE JUDGE 3649 로봇 프로젝트 https://www.acmicpc.net/problem/3649 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859#include #include using namespace std; int len;int n;int lego[1000001]; int bsearch(int num){ int s = 0, e = n - 1; int m; while (s
BAEKJOON ONLINE JUDGE 3079 입국심사 https://www.acmicpc.net/problem/3079 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253#include #include using namespace std; int n, m;int time[100001]; bool cmp(const int &first, const int &second) { return first > second;} int ispossible(long long t){ int num = m; int i = 0; while (i 0) { num = num - t / time[i]; i+..
BAEKJOON ONLINE JUDGE 3020 개똥벌레 https://www.acmicpc.net/problem/3020 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576#include #include using namespace std; int n, h;int bottom[100100], top[100100];int cut[500001]; int bsearch(int num){ int s = 0, e = n / 2 - 1; int m; int ans; while (s
BAEKJOON ONLINE JUDGE 10815 숫자 카드 2 https://www.acmicpc.net/problem/10816 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849#include #include using namespace std; int n;int card[500001]; int bsearch(int num){ int s = 0, e = n - 1; int m, cnt = 0; while (s
BAEKJOON ONLINE JUDGE 1620 나는야 포켓몬 마스터 이다솜 https://www.acmicpc.net/problem/1620 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667#include #include #include using namespace std; int n, m;int index[100001];char pocketmon[100001][21]; bool cmp(const int &first, const int &second){ string F = pocketmon[first]; string S = poc..
BAEKJOON ONLINE JUDGE 10815 숫자 카드 https://www.acmicpc.net/problem/10815 123456789101112131415161718192021222324252627282930313233343536373839404142434445#include #include using namespace std; int n;int number[500001]; int bsearch(int num){ int s = 0, e = n - 1; while (s
BAEKJOON ONLINE JUDGE 한국정보올림피아드 시.도 지역본선 2005 2589 보물섬 https://www.acmicpc.net/problem/2589 10분 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869#include #include using namespace std; int height, width;char map[51][51]; int bfs(int starty, int startx){ int visit[51][51] = { 0, }; int mx = 0; int dy[4] = { -1, 0, 0, 1..
BAEKJOON ONLINE JUDGE 1068 트리 https://www.acmicpc.net/problem/1068 1. 리프노트 세기입력이 parent 니까 parent 로 나온 개수를 세면 자식 노드의 수를 알 수 있다.값이 0인 것이 리프노드2. 노드 제거노드를 제거하였을 때 -> 부모노드가 리프노드가 될 수 있다. -> 자식노드들과 함께 사라질 수 있다.살아있는 노드인지 확인하는 배열하나 더 추가하여 확인 리프노드인데 부모가 사라지는 노드이면 같이 사라지면서 개수를 세지 않음 2번 틀림 -> 노드를 제거했을 때 부모노드가 리프노드가 될 수 있는 경우를 생각하지 못함22분 123456789101112131415161718192021222324252627282930313233343536373839..
BAEKJOON ONLINE JUDGE 한국정보올림피아드 2002 2169 로봇 조종하기 https://www.acmicpc.net/problem/2169 왼쪽, 오른쪽, 아래로만 이동 -> 윗줄 까지는 최적한 지점을 갈 때 왼쪽에서, 오른쪽에서, 위에서 가장 최대값 + 그 위치의 가치이 때 이전 지점들은 예를들어 왼쪽에서 왔으면 그 지점은 그 왼쪽과 위만 경로롤 가질 수 있다 -> 중복탐색이 안되기 때문에따라서 탐색할 때 한 줄을 위와 왼쪽에서 올 수 있는 값을 미리 저장, 오른쪽에서 올 수 있는 값을 따로 저장한 후 최종적으로 이 둘 중 Max값을 저장하면 최적의 값이 저장된다.첫째 줄은 위와 오른쪽으로는 경로로 삼을 수 없다계속 틀려서 1시간 30분 걸림 123456789101112131415161..