제출 #1125550

#제출 시각아이디문제언어결과실행 시간메모리
1125550Lemser동굴 (IOI13_cave)C++20
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> // #include "cave.h" using namespace std; using ll = long long; using ull = unsigned long long; using lld = long double; using pii = pair<int,int>; using pll = pair<ll, ll>; using vi = vector<int>; using vll = vector<ll>; using vpii = vector<pii>; using vpll = vector<pll>; using vlld = vector<lld>; // #define endl '\n' #define all(x) x.begin(),x.end() #define lsb(x) x&(-x) #define gcd(a,b) __gcd(a,b) #define sz(x) (int)x.size() #define mp make_pair #define pb push_back #define fi first #define se second #define fls cout.flush() #define fore(i,l,r) for(auto i=l;i<r;i++) #define fo(i,n) fore(i,0,n) #define forex(i,r,l) for(auto i=r; i>=l;i--) #define ffo(i,n) forex(i,n-1,0) bool cmin(ll &a, ll b) { if(b<a){a=b;return 1;}return 0; } bool cmax(ll &a, ll b) { if(b>a){a=b;return 1;}return 0; } void valid(ll in) { cout<<((in)?"YES\n":"NO\n"); } ll lcm(ll a, ll b) { return (a/gcd(a,b))*b; } ll gauss(ll n) { return (n*(n+1))/2; } void exploreCave(int n) { int s[n], d[n], tos[n], qs[n], nqs[n]; fo (i, n) s[i] = d[i] = tos[i] = qs[i] = 0; fo (i, n) { set<ll> st; fo (j, n) qs[j] = 0l, st.insert(j); fo (j, i) qs[tos[j]] = s[tos[j]], st.erase(tos[j]); ll idx = tryCombination(qs), w = 0; if (idx == i) w = 1; ll l = 0, r = sz(st)-1; while (l <= r) { ll m = (l+r)/2; fo (j, n) nqs[j] = qs[j]; ll j = 0; for (ll swt: st) { if (j > m) nqs[swt] = w^1; else nqs[swt] = w; j++; } idx = tryCombination(nqs); if (idx > i) r = m-1; else l = m+1; } ll whswt = 0, j = 0; for (ll swt: st) { if (j == l) { whst = swt; break; } j++; } tos[i] = whswt; s[tos[i]] = w; } fo (i, n) d[tos[i]] = i; answer(s, d); } // void test_case () { // } // int main() { // cin.tie(0)->sync_with_stdio(0); // int tt = 1; // cin >> tt; // while (tt--) test_case(); // }

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

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:46:26: error: 'tryCombination' was not declared in this scope
   46 |                 ll idx = tryCombination(qs), w = 0;
      |                          ^~~~~~~~~~~~~~
cave.cpp:47:31: error: 'w' was not declared in this scope
   47 |                 if (idx == i) w = 1;
      |                               ^
cave.cpp:54:55: error: 'w' was not declared in this scope
   54 |                                 if (j > m) nqs[swt] = w^1;
      |                                                       ^
cave.cpp:55:49: error: 'w' was not declared in this scope
   55 |                                 else nqs[swt] = w;
      |                                                 ^
cave.cpp:64:39: error: 'whst' was not declared in this scope; did you mean 'whswt'?
   64 |                         if (j == l) { whst = swt; break; }
      |                                       ^~~~
      |                                       whswt
cave.cpp:68:29: error: 'w' was not declared in this scope
   68 |                 s[tos[i]] = w;
      |                             ^
cave.cpp:71:9: error: 'answer' was not declared in this scope
   71 |         answer(s, d);
      |         ^~~~~~