dyn.cpp: In function 'int dfs(int, int)':
dyn.cpp:13:6: warning: 'auto' changes meaning in C++11; please remove it [-Wc++0x-compat]
for(auto &i : gph[x]){
^
dyn.cpp:13:12: error: ISO C++ forbids declaration of 'i' with no type [-fpermissive]
for(auto &i : gph[x]){
^
dyn.cpp:13:16: warning: range-based 'for' loops only available with -std=c++11 or -std=gnu++11
for(auto &i : gph[x]){
^
dyn.cpp: In function 'int main()':
dyn.cpp:42:22: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d %d",&n,&m);
^
dyn.cpp:43:45: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
for(int i=1; i<=n; i++) scanf("%d",&chk[i]);
^
dyn.cpp:50:23: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d %d",&s,&e);
^