# |
제출 시각 |
아이디 |
문제 |
언어 |
결과 |
실행 시간 |
메모리 |
390859 |
2021-04-17T09:03:34 Z |
jampm |
동굴 (IOI13_cave) |
C++17 |
|
61 ms |
452 KB |
#include "cave.h"
// Main
// int tryCombination(int N, int S[])
// void answer(int N, int S[], int D[])
//Sub-Tarea 5 (?)
void exploreCave(int N) {
int S[N], D[N]; int last = 0; bool vis[N];
for (int i = 0; i < N; i++) {
S[i] = 0; vis[i] = false;
}
last = tryCombination(S);
while (last != -1) {
for (int i = 0; i < N; i++) {
if (vis[i]) continue;
S[i] = (S[i] - 1)*(S[i] - 1);
int aux = tryCombination(S);
if (aux > last || aux == -1) {
last = aux;
break;
}
if (aux < last) vis[i] = false;
S[i] = (S[i] - 1)*(S[i] - 1);
}
}
for (int i = 0; i < N; i++) {
S[i] = (S[i] - 1)*(S[i] - 1);
D[i] = tryCombination(S);
S[i] = (S[i] - 1)*(S[i] - 1);
}
answer(S, D);
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
61 ms |
452 KB |
too much calls on tryCombination() |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
14 ms |
412 KB |
Output is correct |
2 |
Correct |
1 ms |
204 KB |
Output is correct |
3 |
Correct |
14 ms |
332 KB |
Output is correct |
4 |
Correct |
1 ms |
284 KB |
Output is correct |
5 |
Correct |
1 ms |
204 KB |
Output is correct |
6 |
Correct |
14 ms |
408 KB |
Output is correct |
7 |
Correct |
14 ms |
396 KB |
Output is correct |
8 |
Correct |
20 ms |
400 KB |
Output is correct |
9 |
Correct |
17 ms |
412 KB |
Output is correct |
10 |
Correct |
17 ms |
404 KB |
Output is correct |
11 |
Correct |
16 ms |
404 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
216 KB |
Output is correct |
2 |
Correct |
0 ms |
208 KB |
Output is correct |
3 |
Correct |
1 ms |
204 KB |
Output is correct |
4 |
Correct |
1 ms |
208 KB |
Output is correct |
5 |
Correct |
1 ms |
216 KB |
Output is correct |
6 |
Correct |
1 ms |
216 KB |
Output is correct |
7 |
Correct |
1 ms |
220 KB |
Output is correct |
8 |
Correct |
1 ms |
216 KB |
Output is correct |
9 |
Correct |
1 ms |
216 KB |
Output is correct |
10 |
Correct |
1 ms |
216 KB |
Output is correct |
11 |
Correct |
1 ms |
216 KB |
Output is correct |
12 |
Correct |
1 ms |
216 KB |
Output is correct |
13 |
Correct |
1 ms |
216 KB |
Output is correct |
14 |
Correct |
1 ms |
296 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
216 KB |
Output is correct |
2 |
Correct |
0 ms |
208 KB |
Output is correct |
3 |
Correct |
1 ms |
204 KB |
Output is correct |
4 |
Correct |
1 ms |
208 KB |
Output is correct |
5 |
Correct |
1 ms |
216 KB |
Output is correct |
6 |
Correct |
1 ms |
216 KB |
Output is correct |
7 |
Correct |
1 ms |
220 KB |
Output is correct |
8 |
Correct |
1 ms |
216 KB |
Output is correct |
9 |
Correct |
1 ms |
216 KB |
Output is correct |
10 |
Correct |
1 ms |
216 KB |
Output is correct |
11 |
Correct |
1 ms |
216 KB |
Output is correct |
12 |
Correct |
1 ms |
216 KB |
Output is correct |
13 |
Correct |
1 ms |
216 KB |
Output is correct |
14 |
Correct |
1 ms |
296 KB |
Output is correct |
15 |
Correct |
1 ms |
216 KB |
Output is correct |
16 |
Correct |
1 ms |
216 KB |
Output is correct |
17 |
Correct |
1 ms |
216 KB |
Output is correct |
18 |
Correct |
1 ms |
216 KB |
Output is correct |
19 |
Correct |
1 ms |
216 KB |
Output is correct |
20 |
Incorrect |
3 ms |
316 KB |
too much calls on tryCombination() |
21 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
61 ms |
452 KB |
too much calls on tryCombination() |
2 |
Halted |
0 ms |
0 KB |
- |