[백준 1325번] 효율적인 해킹 (C++)
·
📚알고리즘/백준
https://www.acmicpc.net/problem/1325 > n >> m; bool* visited = new bool[n+1]; memset(visited,false,sizeof(visited)); int* ans = new int[n+1]; vector com(n+1,vector()); for(int i = 0; i > a >> b; com[b].push_back(a); } for(int i = 1; i < n+1 ; i++){ BFS(i, com, visited, ans); fill_n(visited, n+1, false); } int max_val = *max_element(ans+1, ans + n+1); for(int i = 1; i < n+1; i++){..