# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
848983 |
2023-09-13T19:29:44 Z |
lbadea1000 |
Cave (IOI13_cave) |
C++17 |
|
23 ms |
604 KB |
#include "cave.h"
void exploreCave(int N) {
/* ... */
int s[N];
int poz[N];
bool ok[N];
for(int i = 0; i < N; i++)
s[i] = 0, ok[i] = false, poz[i] = -1;
int cnt = 0;
while(cnt < N) {
for(int i = 0; i < N; i++)
if(ok[i] == false)
s[i] = 0;
int x;
//= tryCombination(s);
for(int i = 0; i < N; i++) {
/*cout << "OK : ";
for(int j = 0; j < N; j++)
cout << ok[j] << ' ';
cout << endl;
cout << "POZ : ";
for(int j = 0; j < N; j++)
cout << poz[j] << ' ';
cout << endl;*/
if(ok[i] == false) {
x = tryCombination(s);
if(x == -1)
x = N;
s[i] = 1;
int y = tryCombination(s);
if(y == -1)
y = N;
//cout << "TRY: " << y << endl;
if(y > x) {
ok[i] = true;
s[i] = 1;
poz[i] = x;
cnt++;
} else if(y < x) {
ok[i] = true;
s[i] = 0;
poz[i] = y;
cnt++;
}
//x = y;
}
}
}
answer(s, poz);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
12 ms |
348 KB |
Output is correct |
2 |
Correct |
10 ms |
532 KB |
Output is correct |
3 |
Correct |
14 ms |
348 KB |
Output is correct |
4 |
Correct |
10 ms |
528 KB |
Output is correct |
5 |
Correct |
21 ms |
348 KB |
Output is correct |
6 |
Correct |
14 ms |
344 KB |
Output is correct |
7 |
Correct |
21 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
424 KB |
Output is correct |
9 |
Correct |
0 ms |
428 KB |
Output is correct |
10 |
Correct |
0 ms |
344 KB |
Output is correct |
11 |
Correct |
0 ms |
376 KB |
Output is correct |
12 |
Correct |
15 ms |
488 KB |
Output is correct |
13 |
Correct |
14 ms |
344 KB |
Output is correct |
14 |
Correct |
14 ms |
344 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
21 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
21 ms |
544 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
432 KB |
Output is correct |
6 |
Correct |
21 ms |
344 KB |
Output is correct |
7 |
Correct |
23 ms |
348 KB |
Output is correct |
8 |
Correct |
22 ms |
348 KB |
Output is correct |
9 |
Correct |
23 ms |
552 KB |
Output is correct |
10 |
Correct |
22 ms |
592 KB |
Output is correct |
11 |
Correct |
20 ms |
348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
1 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
1 ms |
380 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
0 ms |
348 KB |
Output is correct |
10 |
Correct |
1 ms |
348 KB |
Output is correct |
11 |
Correct |
0 ms |
348 KB |
Output is correct |
12 |
Correct |
0 ms |
348 KB |
Output is correct |
13 |
Correct |
0 ms |
348 KB |
Output is correct |
14 |
Correct |
0 ms |
604 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
1 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
1 ms |
380 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
0 ms |
348 KB |
Output is correct |
10 |
Correct |
1 ms |
348 KB |
Output is correct |
11 |
Correct |
0 ms |
348 KB |
Output is correct |
12 |
Correct |
0 ms |
348 KB |
Output is correct |
13 |
Correct |
0 ms |
348 KB |
Output is correct |
14 |
Correct |
0 ms |
604 KB |
Output is correct |
15 |
Correct |
0 ms |
348 KB |
Output is correct |
16 |
Correct |
0 ms |
348 KB |
Output is correct |
17 |
Correct |
0 ms |
348 KB |
Output is correct |
18 |
Correct |
0 ms |
348 KB |
Output is correct |
19 |
Correct |
0 ms |
344 KB |
Output is correct |
20 |
Incorrect |
1 ms |
348 KB |
too much calls on tryCombination() |
21 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
12 ms |
348 KB |
Output is correct |
2 |
Correct |
10 ms |
532 KB |
Output is correct |
3 |
Correct |
14 ms |
348 KB |
Output is correct |
4 |
Correct |
10 ms |
528 KB |
Output is correct |
5 |
Correct |
21 ms |
348 KB |
Output is correct |
6 |
Correct |
14 ms |
344 KB |
Output is correct |
7 |
Correct |
21 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
424 KB |
Output is correct |
9 |
Correct |
0 ms |
428 KB |
Output is correct |
10 |
Correct |
0 ms |
344 KB |
Output is correct |
11 |
Correct |
0 ms |
376 KB |
Output is correct |
12 |
Correct |
15 ms |
488 KB |
Output is correct |
13 |
Correct |
14 ms |
344 KB |
Output is correct |
14 |
Correct |
14 ms |
344 KB |
Output is correct |
15 |
Correct |
21 ms |
348 KB |
Output is correct |
16 |
Correct |
0 ms |
348 KB |
Output is correct |
17 |
Correct |
21 ms |
544 KB |
Output is correct |
18 |
Correct |
0 ms |
348 KB |
Output is correct |
19 |
Correct |
0 ms |
432 KB |
Output is correct |
20 |
Correct |
21 ms |
344 KB |
Output is correct |
21 |
Correct |
23 ms |
348 KB |
Output is correct |
22 |
Correct |
22 ms |
348 KB |
Output is correct |
23 |
Correct |
23 ms |
552 KB |
Output is correct |
24 |
Correct |
22 ms |
592 KB |
Output is correct |
25 |
Correct |
20 ms |
348 KB |
Output is correct |
26 |
Correct |
0 ms |
344 KB |
Output is correct |
27 |
Correct |
0 ms |
348 KB |
Output is correct |
28 |
Correct |
0 ms |
348 KB |
Output is correct |
29 |
Correct |
1 ms |
348 KB |
Output is correct |
30 |
Correct |
0 ms |
348 KB |
Output is correct |
31 |
Correct |
1 ms |
380 KB |
Output is correct |
32 |
Correct |
0 ms |
348 KB |
Output is correct |
33 |
Correct |
0 ms |
348 KB |
Output is correct |
34 |
Correct |
0 ms |
348 KB |
Output is correct |
35 |
Correct |
1 ms |
348 KB |
Output is correct |
36 |
Correct |
0 ms |
348 KB |
Output is correct |
37 |
Correct |
0 ms |
348 KB |
Output is correct |
38 |
Correct |
0 ms |
348 KB |
Output is correct |
39 |
Correct |
0 ms |
604 KB |
Output is correct |
40 |
Correct |
0 ms |
348 KB |
Output is correct |
41 |
Correct |
0 ms |
348 KB |
Output is correct |
42 |
Correct |
0 ms |
348 KB |
Output is correct |
43 |
Correct |
0 ms |
348 KB |
Output is correct |
44 |
Correct |
0 ms |
344 KB |
Output is correct |
45 |
Incorrect |
1 ms |
348 KB |
too much calls on tryCombination() |
46 |
Halted |
0 ms |
0 KB |
- |