foo.cc: In function ‘int dfs(int)’:
foo.cc:6:12: warning: array subscript -1 is below array bounds of ‘int [1005]’ [-Warray-bounds=]
6 | f[x]=1;
| ~~~^
foo.cc:3:11: note: while referencing ‘f’
3 | int n,ans,f[1005];
| ^
In function ‘int dfs(int)’,
inlined from ‘int main()’ at foo.cc:13:13:
foo.cc:6:12: warning: array subscript -1 is below array bounds of ‘int [1005]’ [-Warray-bounds=]
6 | f[x]=1;
| ~~~^
foo.cc: In function ‘int main()’:
foo.cc:3:11: note: while referencing ‘f’
3 | int n,ans,f[1005];
| ^