fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. vector<int>v[2005];
  4. map<int,bool>m;
  5. void dfs(int source)
  6. {
  7. if(v[source].empty())
  8. return;
  9.  
  10. if(!m[source])
  11. {
  12. m[source]=1;
  13. for(int i=0;i<v[source].size();i++)
  14. {
  15.  
  16. }
  17.  
  18. }
  19.  
  20.  
  21.  
  22. }
  23. int main() {
  24. // your code goes here
  25. int t;
  26. cin>>t;
  27. while(t--)
  28. {
  29. int n,u;
  30. cin>>n>>u;
  31. for(int i=0;i<u;i++)
  32. {
  33. int a,b;
  34. cin>>a>>b;
  35. v[a].push_back(b);
  36. v[b].push_back(a);
  37. }
  38. }
  39. return 0;
  40. }
Time limit exceeded #stdin #stdout 5s 3124KB
stdin
Standard input is empty
stdout
Standard output is empty