Algorithm/BFS(너비우선 탐색)2 [백준][1325번][BFS] 효율적인 해킹 효율적인 해킹https://www.acmicpc.net/problem/1325123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263#include #include #include using namespace std; int main(void){ int N, M; vector a[10001]; queue que; int save[10001]; int size = 0; int max = 0; scanf("%d %d", &N, &M); for (int i = 0; i 2016. 4. 8. [백준][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. 이전 1 다음 728x90