This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "cave.h"
int s[5010], d[5010], s1[5010];
void exploreCave(int N)
{
for(int i = 0; i < N; i++) d[i] = -1;
for(int i = 0; i < N; i++) s[i] = 0;
int x = tryCombination(s);
if(x == -1)
{
for(int i = 0; i < N; i++)
{
s[i] = 1;
x = tryCombination(s);
d[i] = x;
s[i] = 0;
}
answer(s, d);
}
if(N <= 100)
{
for(int i = 0; i < N; i++) s1[i] = 0;
int k = 0;
while(k < N)
{
for(int i = 0; i < N; i++)
{
s1[i] = 1;
int y = tryCombination(s1);
if(y < x)
{
if(d[i] == -1) k++;
s[i] = 0;
d[i] = y;
s1[i] = 0;
}
if(x < y)
{
if(d[i] == -1) k++;
s[i] = 1;
d[i] = x;
x = y;
}
}
}
answer(s, d);
}
for(int i = 0; i < N; i++)
if(tryCombination(s) == i) s[i] = 1;
/*
for(int i = x; i < N; i++)
{
s[i] = 1;
int y = tryCombination(s);
if(y == -1) break;
if(y == i) s[i] = 0;
i = y - 1;
}
/* int k = 0;
while(k < N)
{
if(x != -1)
{
s[x] = 1;
k = x + 1;
}
else break;
x = tryCombination(s);
}
*/
for(int i = 0; i < N; i++) d[i] = i;
answer(s, d);
}
Compilation message (stderr)
cave.cpp:85:2: warning: "/*" within comment [-Wcomment]
85 | /* int k = 0;
|
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |