답안 #501717

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
501717 2022-01-04T11:16:24 Z dnaux 동굴 (IOI13_cave) C++17
0 / 100
476 ms 432 KB
#include <bits/stdc++.h>
#include "cave.h"
#define endline "\n"
#define pb push_back
#define mp make_pair
#define st first
#define nd second
#define lsb(i) i&(-i)
#define sz(i) (int)i.size()
 
typedef long long ll;
using namespace std;
const ll INF = 1e18L;
constexpr int mod = int(1e9) + 7;
 
ll t=1, n, k, cases = 0; 

void exploreCave(int n){
    int check[n],door[n];
    for(int i = 0; i < n; i++)check[i] = -1;
    for(int i = 0; i < n; i++){

        int comb[n] = {};
        for(int i = 0; i < n; i++){
            if(check[i] != -1)comb[i] = check[i];
        }

        int cur;
        if(tryCombination(comb) > i)cur = 0;
        else cur = 1;

        int l = 1, r = n + 1;
        while(r - l > 1){
            int m = (r + l) / 2;

            for(int i = 0; i < n; i++){
                if(check[i] != -1)comb[i] = check[i];
                else if(i >= l and i <= m)comb[i] = cur;
                else comb[i] = cur ^ 1;
            }

            if(tryCombination(comb) > i)r = m;
            else l = m;
        }
        check[l] = cur;
        door[l] = i;
    }
    answer(check, door);
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 196 ms 332 KB Answer is wrong
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 476 ms 432 KB Answer is wrong
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 204 KB Answer is wrong
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 204 KB Answer is wrong
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 196 ms 332 KB Answer is wrong
2 Halted 0 ms 0 KB -