Main.cc:3:23: error: conflicting declaration ‘int cnt’ int res[105],cnt[105],cnt; ^~~ Main.cc:3:14: note: previous declaration as ‘int cnt [105]’ int res[105],cnt[105],cnt; ^~~ Main.cc: In function ‘void dfs(int, int)’: Main.cc:11:12: error: lvalue required as increment operand cnt++; ^~ Main.cc: In function ‘int main()’: Main.cc:28:20: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘int*’ [-Wformat=] printf("%d",cnt); ^ Main.cc:26:7: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] scanf("%d",&n); ~~~~~^~~~~~~~~