Submission #1164717

#TimeUsernameProblemLanguageResultExecution timeMemory
1164717tsengangCave (IOI13_cave)C++20
Compilation error
0 ms0 KiB
#include<bits/stdc++.h>
#include "cave.h"
using namespace std;
#define ll long long
#define ff first
#define ss second
#define all(x) (x).begin(), (x).end()
#define pb push_back
#define ertunt return
#define vodka void
void exploreCave(int n){
    int v[n] = {0};
    int d[n] = {0};
    bool vis[n] = {0};
    for(int i = 0; i < n; i++){
        vector<ll>s;
        for(int j = 0 ; j < n; j++){
            if(vis[j] == 0)s.pb(j);
        }
        for(int j = 0; j < s.size(); j++){
            d[j] = 0;
        }
        int l = 0,r = s.size()-1;
        int x = tryCombination(d);
        ll q = 0,p = 1;
        if(x == i)swap(q,p);
        while(l < r){
            int mid = (l+r)/2;
            for(ll j = 0 ; j < v.size(); j++){
                if(j <= mid)d[s[j]] = q;
                else d[s[j]] = p;
            }
            int x = try_combination(d);
            if(x == -1 or x > i){
                r = mid;
            }
            else l = mid+1;
        }
        v[s[l]] = i;
        d[s[l]] = q;
        vis[s[l]] = true;
    }
    answer(d,v);
}

Compilation message (stderr)

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:29:34: error: request for member 'size' in 'v', which is of non-class type 'int [n]'
   29 |             for(ll j = 0 ; j < v.size(); j++){
      |                                  ^~~~
cave.cpp:33:21: error: 'try_combination' was not declared in this scope; did you mean 'tryCombination'?
   33 |             int x = try_combination(d);
      |                     ^~~~~~~~~~~~~~~
      |                     tryCombination