제출 #1211347

#제출 시각아이디문제언어결과실행 시간메모리
1211347LIA동굴 (IOI13_cave)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h>
using namespace std;
typedef int ll;
typedef tuple<ll, ll, ll> plll;
typedef vector<plll> vplll;
typedef pair<ll, ll> pll;
typedef vector<ll> vll;
typedef vector<pll> vpll;
typedef vector<vector<pll>> vvpll;
typedef vector<vector<ll>> vvll;
typedef vector<bool> vb;
typedef vector<vector<bool>> vvb;
#define loop(i, s, e) for (ll i = (s); i < (e); ++i)
#define loopr(i, e, s) for (ll i = (e)-1; i >= (s); --i)
#define all(a) a.begin(), a.end()
const ll inf = 1e9 + 7;
#include "cave.h"
void bl(ll i) {
  ll l = 0, r =n-1;
  ll last = tryCombination(s);
  ll t = tryCombination(s);

  while (l<=r) {
    if(l==r) {
      if (last == i) {
        update(l,l);
      }
      ass[l] = 1;
      pos[l] = i;
      return;
    }
    ll mid = (r+l)/2;
    update(l,mid);
    ll t1 = tryCombination(s);
    if (t1==-1) t1 =n;
    if (t==-1) t =n;
    if ((t1==i && t>i) || (t==i && t1>i)) {
      r = mid;
    }
    else l = mid+1;
    t = t1;
    last = t1;
  }

  if (last == i) {
    update(l,l);
  }
    ass[l] = 1;
    pos[l] = i;

}
void exploreCave(int N) {
  n= N;
  pos.resize(n);
  ass.resize(n);
  memset(s, 0, sizeof(s));
  loop(i,0,n) {
  bl(i);
  }
  ll posi[n];
  loop(i,0,n) posi[i] = pos[i];
  answer(s, posi);
}

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

cave.cpp: In function 'void bl(ll)':
cave.cpp:19:16: error: 'n' was not declared in this scope
   19 |   ll l = 0, r =n-1;
      |                ^
cave.cpp:20:28: error: 's' was not declared in this scope
   20 |   ll last = tryCombination(s);
      |                            ^
cave.cpp:26:9: error: 'update' was not declared in this scope
   26 |         update(l,l);
      |         ^~~~~~
cave.cpp:28:7: error: 'ass' was not declared in this scope; did you mean 'abs'?
   28 |       ass[l] = 1;
      |       ^~~
      |       abs
cave.cpp:29:7: error: 'pos' was not declared in this scope; did you mean 'pow'?
   29 |       pos[l] = i;
      |       ^~~
      |       pow
cave.cpp:33:5: error: 'update' was not declared in this scope
   33 |     update(l,mid);
      |     ^~~~~~
cave.cpp:46:5: error: 'update' was not declared in this scope
   46 |     update(l,l);
      |     ^~~~~~
cave.cpp:48:5: error: 'ass' was not declared in this scope; did you mean 'abs'?
   48 |     ass[l] = 1;
      |     ^~~
      |     abs
cave.cpp:49:5: error: 'pos' was not declared in this scope; did you mean 'pow'?
   49 |     pos[l] = i;
      |     ^~~
      |     pow
cave.cpp: In function 'void exploreCave(int)':
cave.cpp:53:3: error: 'n' was not declared in this scope
   53 |   n= N;
      |   ^
cave.cpp:54:3: error: 'pos' was not declared in this scope; did you mean 'pow'?
   54 |   pos.resize(n);
      |   ^~~
      |   pow
cave.cpp:55:3: error: 'ass' was not declared in this scope; did you mean 'abs'?
   55 |   ass.resize(n);
      |   ^~~
      |   abs
cave.cpp:56:10: error: 's' was not declared in this scope
   56 |   memset(s, 0, sizeof(s));
      |          ^
cave.cpp:61:15: error: 'posi' was not declared in this scope
   61 |   loop(i,0,n) posi[i] = pos[i];
      |               ^~~~
cave.cpp:62:13: error: 'posi' was not declared in this scope
   62 |   answer(s, posi);
      |             ^~~~