제출 #670692

#제출 시각아이디문제언어결과실행 시간메모리
670692kojac동굴 (IOI13_cave)C++17
0 / 100
36 ms340 KiB
#include<bits/stdc++.h> #include"cave.h" using namespace std; #define MAXN (int)(5e3+10) using pii = pair<long long,long long>; using ll = long long; void exploreCave(int N){ int s[N], ans[N], mark[N]; int v[N]; for(int i = 0; i < N; i++){ s[i] = 0; ans[i] = 0; mark[i] = false; v[i] = 0; } for(int i = 0; i < N; i++){ int l = 0, r = N-1; bool aux = false; int x = tryCombination(ans); if(x > i || x == -1){ aux = true; } while(l <= r){ int mid = (l+r)/2; if(l == r){ mark[mid] = true; ans[mid] = i; if(aux) s[mid] = 0; else s[mid] = 1; break; } for(int j = l; j <= r; j++){ if(mark[j])continue; if(j <= mid) s[j] = 1; else s[j] = 0; } x = tryCombination(s); if(aux){ if(x > i || x == -1){ l = mid+1; }else r = mid; }else{ if(x > i || x == -1){ r = mid; }else l = mid+1; } } } answer(s, ans); }

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

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:15:9: warning: variable 'v' set but not used [-Wunused-but-set-variable]
   15 |     int v[N];
      |         ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...