Problem floors
User ThePwo
Submission Time 2023-09-14 14:58:05
Score 0
Max Time N/A
Max Memory N/A

Compile Error

floors.cpp: In function ‘int find(const int&)’:
floors.cpp:7:6: error: ‘p’ was not declared in this scope
7 | if (p[x] == x) return x;
| ^
floors.cpp:8:9: error: ‘p’ was not declared in this scope
8 | return p[x] = find(p[x]);
| ^
floors.cpp: In function ‘int32_t main()’:
floors.cpp:14:18: error: expected initializer before ‘for’
14 | int p[10000000] for (int i = 1; i <= n; i++) p[i] = i;
| ^~~
floors.cpp:14:34: error: ‘i’ was not declared in this scope
14 | int p[10000000] for (int i = 1; i <= n; i++) p[i] = i;
| ^
floors.cpp:19:3: error: ‘p’ was not declared in this scope
19 | p[x] = (x == 1 ? n : x - 1);
| ^