Submission #555358

# Submission time Handle Problem Language Result Execution time Memory
555358 2022-04-30T15:32:12 Z Tien_Noob Cave (IOI13_cave) C++17
0 / 100
190 ms 372 KB
//Make CSP great again
//Vengeance
#include <bits/stdc++.h>
#include<cave.h>
#define TASK "TESTCODE"
#define Log2(x) 31 - __builtin_clz(x)
using namespace std;
const int N = 5e3;
int state[N + 1], door[N + 1];
void exploreCave(int n)
{
    memset(door, -1, sizeof(door));
    for (int i = 0; i < n; ++ i)
    {
        int low = 0, high = n - 1;
        bool need = (tryCombination(state) == i);
        while(low < high)
        {
            int mid = (low + high)/2;
            for (int j = low; j <= mid; ++ j)
            {
                if (door[j] == -1)
                {
                    state[j] = 1;
                }
            }
            bool t = (tryCombination(state) == i);
            for (int j = low; j <= mid; ++ j)
            {
                if (door[j] == -1)
                {
                    state[j] = 0;
                }
            }
            if (t == need)
            {
                low = mid + 1;
            }
            else
            {
                high = mid - 1;
            }
        }
        door[low] = i;
        state[low] = need;
    }
    answer(state, door);
}
/*void read()
{

}
void solve()
{

}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    if (fopen(TASK".INP", "r"))
    {
        freopen(TASK".INP", "r", stdin);
        //freopen(TASK".OUT", "w", stdout);
    }
    int t = 1;
    bool typetest = false;
    if (typetest)
    {
        cin >> t;
    }
    for (int __ = 1; __ <= t; ++ __)
    {
        //cout << "Case " << __ << ": ";
        read();
        solve();
    }
}*/
# Verdict Execution time Memory Grader output
1 Incorrect 19 ms 340 KB Answer is wrong
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 190 ms 372 KB Answer is wrong
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 340 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Incorrect 0 ms 212 KB Answer is wrong
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 340 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Incorrect 0 ms 212 KB Answer is wrong
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 19 ms 340 KB Answer is wrong
2 Halted 0 ms 0 KB -