foo.cpp:7:7: error: 'MAXN' was not declared in this scope
int a[MAXN], f[MAXN], visit[MAXN], d, step[MAXN];
^
foo.cpp:7:16: error: 'MAXN' was not declared in this scope
int a[MAXN], f[MAXN], visit[MAXN], d, step[MAXN];
^
foo.cpp:7:29: error: 'MAXN' was not declared in this scope
int a[MAXN], f[MAXN], visit[MAXN], d, step[MAXN];
^
foo.cpp:7:44: error: 'MAXN' was not declared in this scope
int a[MAXN], f[MAXN], visit[MAXN], d, step[MAXN];
^
foo.cpp:9:11: error: 'MAXN' was not declared in this scope
bool flag[MAXN], okay;
^
foo.cpp: In function 'int main()':
foo.cpp:13:9: error: 'flag' was not declared in this scope
memset(flag, 0, sizeof(flag));
^
foo.cpp:14:9: error: 'f' was not declared in this scope
memset(f, 0, sizeof(f));
^
foo.cpp:15:9: error: 'step' was not declared in this scope
memset(step, 0, sizeof(step));
^
foo.cpp:16:8: error: 'MAXN' was not declared in this scope
ans = MAXN;
^
foo.cpp:21:10: error: 'a' was not declared in this scope
cin >> a[i];
^
foo.cpp:30:8: error: 'visit' was not declared in this scope
d = visit[0] = i;
^
foo.cpp:33:17: error: 'a' was not declared in this scope
while (!flag[a[d]]) {
^
foo.cpp:40:24: error: 'a' was not declared in this scope
if (visit[head] == a[d])
^