Submission #944595

#TimeUsernameProblemLanguageResultExecution timeMemory
944595irmuunCave (IOI13_cave)C++17
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> #include "cave.h" using namespace std; #define ll long long #define pb push_bacK #define ff first #define ss second #define all(s) s.begin(),s.end() #define rall(s) s.rbegin(),s.rend() void exploreCave(int n){ int s[n],d[n]; vector<bool>used(n,0); for(int i=0;i<n;i++){ vector<int>v; for(int j=0;j<n;j++){ if(!used[j]){ v.pb(j); } } int sz,v.size(),l=1,r=v.size(); int last=0; for(int j=i;j<n;j++){ s[j]=0; } int x=tryCombination(s); int q=1,p=0; if(x==-1||x>i){ swap(q,p); } while(l<r){ int mid=(l+r)/2; for(int j=0;j<sz;j++){ if(j<mid){ s[v[j]]=q; } else{ s[v[j]]=p; } } int x=tryCombination(s); if(x==-1||x>i){ r=mid; } else{ l=mid+1; } } d[v[l-1]]=i; s[i-1]=q; } answer(s,d); }

Compilation message (stderr)

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:7:12: error: 'class std::vector<int>' has no member named 'push_bacK'; did you mean 'push_back'?
    7 | #define pb push_bacK
      |            ^~~~~~~~~
cave.cpp:20:19: note: in expansion of macro 'pb'
   20 |                 v.pb(j);
      |                   ^~
cave.cpp:23:17: error: expected initializer before '.' token
   23 |         int sz,v.size(),l=1,r=v.size();
      |                 ^
cave.cpp:33:15: error: 'l' was not declared in this scope
   33 |         while(l<r){
      |               ^
cave.cpp:33:17: error: 'r' was not declared in this scope
   33 |         while(l<r){
      |                 ^
cave.cpp:51:13: error: 'l' was not declared in this scope
   51 |         d[v[l-1]]=i;
      |             ^
cave.cpp:24:13: warning: unused variable 'last' [-Wunused-variable]
   24 |         int last=0;
      |             ^~~~