본문 바로가기

분류 전체보기114

[백준][1963번][BFS] 소수경로 소수 경로https://www.acmicpc.net/problem/1963123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100#include #include #include using namespace std;int primGroup[10001]; struct couple{ int a; int b;}; couple make_couple(int a, int b){ couple temp; temp.a = a; temp.b.. 2016. 4. 8.
[백준][2805번][이분탐색] 나무 자르기 나무자르기https://www.acmicpc.net/problem/28051234567891011121314151617181920212223242526272829303132333435363738394041#include long long tree[1000001]; int main(void){ long long M, N; long long max = 0; long long left, right; long long result = 0; scanf("%lld %lld", &N, &M); for (int i = 0; i 2016. 4. 7.
[백준][10815번][이분탐색] 숫자 카드 숫자 카드 https://www.acmicpc.net/problem/10815123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960#include #include using namespace std;int card[500001];int serch[500001]; bool twoserch(int left, int right, int serchnum){ int mid = (left + right) / 2; bool result; if (left > right) return false; else { if (card[mid] > serchnum){ result = tw.. 2016. 4. 7.
[백준][1920번][이분탐색] 수 찾기 수 찾기 https://www.acmicpc.net/problem/1920123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960#include #include using namespace std;int card[100001];int serch[100001]; bool twoserch(int left, int right, int serchnum){ int mid = (left + right) / 2; bool result; if (left > right) return false; else { if (card[mid] > serchnum){ result = twos.. 2016. 4. 7.
[백준][3079번][이분탐색] 입국심사 입국심사 https://www.acmicpc.net/problem/3079123456789101112131415161718192021222324252627282930313233343536373839#include long long T[1000001]; int main(void){ int N, M; long long max = 0; scanf("%d %d", &N, &M); for (int i = 0; i 2016. 4. 6.
[백준][1939번][이분탐색] 중량제한 중량제한 https://www.acmicpc.net/problem/193912345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273#include #include #include using namespace std; vector bridge[100010];int visit[100010] = {}; bool finalmap(int vertx, int weight,int finalvertx){ bool result = false; if (finalvertx == vertx) return true; for (int i = 0.. 2016. 4. 6.
728x90