fork(1) download
  1. ->
  2. ->
  3.  
  4. green_counter = 0 ;
  5. size_of_component = 0 ;
  6. dfs(){
  7.  
  8.  
  9.  
  10.  
  11.  
  12. }
  13.  
  14.  
  15. final_answer = INF;
  16. for(x=1;x<=n;x++){
  17. //delete node x
  18. //declare new graph -> g[]
  19. for(i=0;i<=m-1;i++){
  20. u = edges[i][0];
  21. v = edges[i][1];
  22. if(u==x || v==x){
  23.  
  24. }else{
  25. g[u].push_back(v);
  26. g[v].push_back(u)
  27. }
  28. }
  29.  
  30. answer = 0 ;
  31. for(i=1;i<=n;i++){
  32. if(i==x){
  33.  
  34. }else{
  35. if(visited[i]==false){
  36. green_count = 0 ;
  37. size_of_component = 0 ;
  38. dfs(i);
  39. if(green_count>=1){
  40. answer = answer + size_of_component;
  41. }else{
  42. answer = answer + 0 ;
  43. }
  44. }
  45.  
  46. }
  47.  
  48.  
  49. }
  50. final_answer = min(final_answer,answer);
  51.  
  52.  
  53.  
  54. }
  55. print(final_answer)
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Traceback (most recent call last):
  File "/usr/lib/python3.12/py_compile.py", line 144, in compile
    code = loader.source_to_code(source_bytes, dfile or file,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap_external>", line 1059, in source_to_code
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "./prog.py", line 1
    ->
    ^^
SyntaxError: invalid syntax

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python3.12/py_compile.py", line 150, in compile
    raise py_exc
py_compile.PyCompileError:   File "./prog.py", line 1
    ->
    ^^
SyntaxError: invalid syntax

stdout
Standard output is empty