제출 #154683

#제출 시각아이디문제언어결과실행 시간메모리
154683mhy908동굴 (IOI13_cave)C++14
컴파일 에러
0 ms0 KiB
#include "cave.h" #include <bits/stdc++.h> using namespace std; int point[5010]; bool ch[5010]; int p[5010], n; int binopen(int st, int fin, int num){ if(st==fin)return st; int mid=(st+fin)/2; for(int i=st; i<=mid; i++) if(!ch[i])=(p[i]+1)%2; int t=tryCombination(p); if(t==-1)t=n; for(int i=st; i<=mid; i++) if(!ch[i])=(p[i]+1)%2; if(t==num)return binopen(st, mid, num); return binopen(mid+1, fin, num); } int binclose(int st, int fin, int num){ if(st==fin)return st; int mid=(st+fin)/2; for(int i=st; i<=mid; i++) if(!ch[i])p[i]=(p[i]+1)%2; int t=tryCombination(p); for(int i=st; i<=mid; i++) if(!ch[i])p[i]=(p[i]+1)%2; if(t>num)return binclose(st, mid, num); return binclose(mid+1, fin, num); } void exploreCave(int N){ n=N; for(int i=0; i<n; i++){ int temp=tryCombination(p); if(temp==i){ int num=binclose(0, n-1, i); point[num]=i; ch[num]=true; p[i]=(p[i]+1)%2; } else{ int num=binopen(0, n-1, i); point[num]=i; ch[num]=true; } } answer(point, p); }

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

cave.cpp: In function 'int binopen(int, int, int)':
cave.cpp:11:19: error: expected primary-expression before '=' token
         if(!ch[i])=(p[i]+1)%2;
                   ^
cave.cpp:15:19: error: expected primary-expression before '=' token
         if(!ch[i])=(p[i]+1)%2;
                   ^