gondola.cpp: In function 'int valid(int, int*)':
gondola.cpp:21:18: error: 'a' was not declared in this scope
for(i=0;i<n;i++)a[i]=inputSeq[i];
^
gondola.cpp:24:6: error: 'a' was not declared in this scope
if(a[i]<=n)break;
^
gondola.cpp:25:8: error: 'a' was not declared in this scope
if(v[a[i]])return 0;
^
gondola.cpp:26:5: error: 'a' was not declared in this scope
v[a[i]]=1;
^
gondola.cpp:29:9: error: 'a' was not declared in this scope
int nr=a[i],lst=i+n-a[i]+1,cnt=0;
^
gondola.cpp:30:7: error: 'cnt' was not declared in this scope
for(;cnt<n;i++,cnt++)
^~~
gondola.cpp:30:7: note: suggested alternative: 'int'
for(;cnt<n;i++,cnt++)
^~~
int
gondola.cpp:32:3: error: 'lst' was not declared in this scope
lst--;
^~~