fork download
  1. while(!q.empty())
  2. {
  3. int x = q.front();
  4. q.pop();
  5. for(int y: graph[x])
  6. {
  7. if(used[y] == false)
  8. {
  9. q.push(y);
  10. used[y] = true;
  11. w[y] = w[x] + 1;
  12. }
  13. }
  14. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:1:1: error: expected unqualified-id before ‘while’
 while(!q.empty())
 ^~~~~
stdout
Standard output is empty