[백준/C++] 2637 장난감 조립
https://www.acmicpc.net/problem/2637코드#include #include #include using namespace std; #define FASTIO ios::sync_with_stdio(false);cin.tie(NULL); typedef pair pi; int n,m; int main() { FASTIO; cin >> n >> m; vectordepth(n + 1, 0); vector p(n+1); vector cnt(n + 1, vector(n + 1, 0)); for (int i = 0,x, y, k; i > x >> y >> k; depth[x]++; p[y].push_back({ x,k }); } queue q; for (int i ..