제출 #553035

#제출 시각아이디문제언어결과실행 시간메모리
553035fcmalkcin동굴 (IOI13_cave)C++17
컴파일 에러
0 ms0 KiB
#include "cave.h"

#include<bits/stdc++.h>
using namespace std;

#define ll int
#define pll pair<ll,ll>
#define ff first
#define ss second
//#define endl "\n"
#define pb push_back
#define F(i,a,b) for(ll i=a;i<=b;i++)

const ll maxn=5e3+100;
const ll base=2e9;
const ll mod= 1e9+7 ;

mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());

ll a[maxn];
ll b[maxn];
ll c[maxn];
ll msk[maxn];
ll col[maxn];
ll res[maxn];

void exploreCave(ll n)
{
    memset(col,0,sizeof(col));
    ll p=-1;
    for (int t=0; t<14; t++)
    {
        if ((1ll<<t)<n)
        {
            p=t;
        }
    }
    p++;
    for (int i=0; i<n; i++)
    {
        ll msknxt=0;
        vector<ll> vt;
        for (int i=0; i<n; i++)
        {
            if (col[i])
            {
                vt.pb(col[i]-1);
            }
            else
            {
                vt.pb(0);
            }
        }
        ll h=tryCombination(vt);
        if (h==-1)
            h=n;
        ll t=1;
        if (h<=i)
            t=0;
   //     cout <<t<<" "<<i<<" "<<h<<" chk2"<<endl;
        for (int j=0; j<p; j++)
        {
            vector<ll> vt;
            for (int i=0; i<n; i++)
            {
                if (col[i])
                {
                    vt.pb(col[i]-1);
                }
                else
                {
                    if (i&(1ll<<j))
                    {
                        vt.pb(1^t);
                    }
                    else
                    {
                        vt.pb(0^t);
                    }
                }
            }
            ll h=tryCombination(vt);
            /*if (i==0)
            {
                cout <<h<<" "<<j<<" wtf"<<endl;
                for (auto p:vt) cout <<p<<" ";
                cout <<endl;
            }*/
            if (h==-1)
                h=n;
            if (h>i)
            {
                msknxt+=(1ll<<j);
            }
        }
      //  cout <<msknxt<<" chk3"<<endl;
        col[msknxt]=(1-t)+1;
        res[msknxt]=i;
    }
    vector<ll> vt;
    vector<ll> vt1;
    for (int i=0; i<n; i++)
        vt.pb(col[i]-1),vt1.pb(res[i]);
    answer(vt,vt1);
}

컴파일 시 표준 에러 (stderr) 메시지

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:54:29: error: cannot convert 'std::vector<int>' to 'int*'
   54 |         ll h=tryCombination(vt);
      |                             ^~
      |                             |
      |                             std::vector<int>
In file included from cave.cpp:1:
cave.h:8:24: note:   initializing argument 1 of 'int tryCombination(int*)'
    8 | int tryCombination(int S[]);
      |                    ~~~~^~~
cave.cpp:82:33: error: cannot convert 'std::vector<int>' to 'int*'
   82 |             ll h=tryCombination(vt);
      |                                 ^~
      |                                 |
      |                                 std::vector<int>
In file included from cave.cpp:1:
cave.h:8:24: note:   initializing argument 1 of 'int tryCombination(int*)'
    8 | int tryCombination(int S[]);
      |                    ~~~~^~~
cave.cpp:104:12: error: cannot convert 'std::vector<int>' to 'int*'
  104 |     answer(vt,vt1);
      |            ^~
      |            |
      |            std::vector<int>
In file included from cave.cpp:1:
cave.h:9:17: note:   initializing argument 1 of 'void answer(int*, int*)'
    9 | void answer(int S[], int D[]);
      |             ~~~~^~~