PAT 1094. The Largest Generation (25)

簡單BFS,要注意判斷每一層開始的標誌web #include<stdio.h> #include<vector> #include<queue> #define SIZE 105 using namespace std; vector<int> family[SIZE]; queue<int>q; int maxgen, gen; void bfs(int n){ maxgen =
相關文章
相關標籤/搜索