제출 #1359778

#제출 시각아이디문제언어결과실행 시간메모리
1359778thesenCave (IOI13_cave)C++20
0 / 100
145 ms516 KiB
#include "cave.h"
#include <bits/stdc++.h>
using namespace std;

#define ll int
#define vll vector<ll>
#define vbool vector<bool>
#define pairll pair<ll, ll>
#define pb push_back
#define fi first
#define sc second

void exploreCave(int n) {
    int res[n];
    int ans[n];
    for(ll i = 0; i < n; i++) res[i] = ans[i] = -1;
    int q[n];
    for(ll cur = 0; cur < n; cur++){
        ll res1 = 0, res2 = 0;
        for(ll pw = 0; pw < 10; pw++){
            for(ll i = 0; i < n; i++){
                q[i] = ((i & (1 << pw)) && true);
                if(ans[i] != -1)q[i] = ans[i];
            }

            ll k = tryCombination(q);
            if(k == -1)k = n;
            if(k > cur){
                res1 += (1 << pw);
            }else{
                res2 += (1 << pw);
            }
        }

        for(ll i = 0; i < n; i++){
            if(ans[i] != -1){q[i] = ans[i]; continue;}
            if(res1 == i)q[i] = 1;
            if(res2 == i)q[i] = 1;
        }
        ll k = tryCombination(q);
        if(k == -1)k = n;

        if(k > cur){
            ans[res2] = 1;
            res[res2] = cur;
        }else{
            ans[res1] = 0;
            res[res1] = cur;
        }
    }


    answer(ans, res);
}
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…