bosses.cpp: In function 'int main()':
bosses.cpp:38:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
38 | scanf("%i",&n);
| ~~~~~^~~~~~~~~
bosses.cpp:40:21: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
40 | int sz;scanf("%i",&sz);
| ~~~~~^~~~~~~~~~
bosses.cpp:42:24: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
42 | int p;scanf("%i",&p);
| ~~~~~^~~~~~~~~
bosses.cpp: In function 'int BFS(int)':
bosses.cpp:10:32: warning: iteration 5049 invokes undefined behavior [-Waggressive-loop-optimizations]
10 | for(int i=1;i<=N;i++)was[i]=false,dist[i]=N*2;
| ~~~~~~^~~~~~
bosses.cpp:10:18: note: within this loop
10 | for(int i=1;i<=N;i++)was[i]=false,dist[i]=N*2;
| ~^~~