Submission #560008

# Submission time Handle Problem Language Result Execution time Memory
560008 2022-05-11T02:57:29 Z ngpin04 Cave (IOI13_cave) C++14
0 / 100
2 ms 468 KB
#include <bits/stdc++.h>
#include "cave.h"
#define fi first
#define se second
#define mp make_pair
#define TASK ""
#define ALL(x) (x).begin(), (x).end() 
using namespace std;
template <typename T1, typename T2> bool mini(T1 &a, T2 b) {
    if (a > b) {a = b; return true;} return false;
}
template <typename T1, typename T2> bool maxi(T1 &a, T2 b) {
    if (a < b) {a = b; return true;} return false;
}
const int N = 1e5 + 5; 
const int oo = 1e9;
const long long ooo = 1e18;
const int mod = 1e9 + 7; // 998244353;
const long double pi = acos(-1);

#define ask tryCombination

int *d, *q, *s;

#define getbit(x, i) ((x >> i) & 1)
#define bit(x) (1LL << x);

void exploreCave(int n) {
    vector <bool> ok(n, 1);
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++)
            q[j] = (ok[j]) ? 0 : d[j];

        int val = (ask(q) == i) ^ 1;
        int res = 0;
        for (int b = 0; b < 14; b++) {
            for (int j = 0; j < n; j++) 
                q[j] = (ok[j]) ? (getbit(j, b) ^ val) : d[j];

            if (ask(q) == i)
                res |= bit(b);
        }

        s[res] = i;
        d[res] = val;
    }   

    answer(s, d);
}   

//#include "grader.c"
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 468 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 2 ms 468 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 340 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 340 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 468 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -