13244번

· 백준
코드#include #include #include #include using namespace std;bool cycle = false;int t,n,m,a,b,visited[1004];vector adj[1004];void FASTIO() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);}void dfs(int x) { visited[x] = 1; for(int i : adj[x]) { if(!visited[i]) dfs(i); }}int main() { FASTIO(); cin >> t; string res; while(t--) { for(int i =0; i > n; cin >> m; fo..