Submission #411112

# Submission time Handle Problem Language Result Execution time Memory
411112 2021-05-24T11:39:06 Z jjj Cave (IOI13_cave) C++14
13 / 100
15 ms 404 KB
#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 = x; i < N; i++)
    {
        s[i] = 1;

        int y = tryCombination(s);

        if(y == -1) break;

        if(y == i) s[i] = 0;

        i = y;
    }


 /*   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);
}
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 332 KB too much calls on tryCombination()
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 11 ms 288 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 14 ms 404 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 11 ms 292 KB Output is correct
7 Correct 11 ms 332 KB Output is correct
8 Correct 15 ms 332 KB Output is correct
9 Correct 15 ms 332 KB Output is correct
10 Correct 15 ms 360 KB Output is correct
11 Correct 11 ms 332 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Incorrect 1 ms 204 KB Answer is wrong
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Incorrect 1 ms 204 KB Answer is wrong
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 332 KB too much calls on tryCombination()
2 Halted 0 ms 0 KB -