hdu1182食物鏈

這道題是並查集的稍微難一點的應用由於有三個元素,詳細代碼及講解以下ios #include <iostream> #include <stdio.h> using namespace std; int pre[150005]; int find(int x) { int r=x; while(r!=pre[r]) { r=pre[r]; }
相關文章
相關標籤/搜索