Submission #1240586

#TimeUsernameProblemLanguageResultExecution timeMemory
1240586JerCave (IOI13_cave)C++20
0 / 100
31 ms580 KiB
#include "cave.h"
#include <bits/stdc++.h>

using namespace std;

void exploreCave(int n)
{
    int s[n], d[n], used[n];
    for (int i = 0; i < n; i++)
        s[i] = 0, d[i] = -1, used[i] = false;

    for (int i = 0; i < n; i++)
    {
        for (int j = 0; j < n; j++)
        {
            if (used[j])
                continue;

            int one = tryCombination(s);
            s[j] = 1;
            int two = tryCombination(s);

            cout << i << ' ' << j << ' ' << one << ' ' << two << '\n';

            if (one != two and (one == i or two == i))
            {
                used[j] = true;
                d[j] = i;
                s[j] = one == i ? 1 : 0;
                break;
            }
            s[j] = 0;
        }
    }

    answer(s, d);
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...