제출 #578840

#제출 시각아이디문제언어결과실행 시간메모리
578840enerelt14동굴 (IOI13_cave)C++14
컴파일 에러
0 ms0 KiB
#include "cave.h" #include<bits/stdc++.h> using namespace std; int n, s[5000], d[5000], re[5000], ans[5000]; bool is; void find(int x, int l, int r){ if (l==r){ d[l]=x; re[x]=l; if (tryCombination(s[])==x)ans[l]=1-s[l]; else ans[l]=s[l]; return; } int mid=(l+r)/2; for (int i=l;i<=mid;i++)s[i]=1-s[i]; for (int j=0;j<x;j++)s[re[j]]=ans[re[j]]; if (tryCombination(s[])==x){ if (is)find(x, mid+1, r); else{ is=1; find(x, l, mid); } } else{ if (is){ is=0; find(x, l, mid); } else find(x, mid+1, r); } } void exploreCave(int N) { n=N; for (int i=0;i<n;i++){ for (int j=0;j<n;j++)s[j]=0; for (int j=0;j<i;j++)s[re[j]]=ans[re[j]]; if (tryCombination(s[])==i)is=1; else is=0; find(i, 1, n); } answer(ans[], d[]); }

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

cave.cpp: In function 'void find(int, int, int)':
cave.cpp:10:30: error: expected primary-expression before ']' token
   10 |         if (tryCombination(s[])==x)ans[l]=1-s[l];
      |                              ^
cave.cpp:17:26: error: expected primary-expression before ']' token
   17 |     if (tryCombination(s[])==x){
      |                          ^
cave.cpp: In function 'void exploreCave(int)':
cave.cpp:37:30: error: expected primary-expression before ']' token
   37 |         if (tryCombination(s[])==i)is=1;
      |                              ^
cave.cpp:41:16: error: expected primary-expression before ']' token
   41 |     answer(ans[], d[]);
      |                ^
cave.cpp:41:21: error: expected primary-expression before ']' token
   41 |     answer(ans[], d[]);
      |                     ^