제출 #261597

#제출 시각아이디문제언어결과실행 시간메모리
261597oscarsierra12동굴 (IOI13_cave)C++14
0 / 100
472 ms384 KiB
#include "cave.h" #include <vector> #include <list> #include <map> #include <set> #include <deque> #include <stack> #include <bitset> #include <algorithm> #include <functional> #include <numeric> #include <utility> #include <sstream> #include <iostream> #include <iomanip> #include <cstdio> #include <cmath> #include <cstdlib> #include <ctime> #include <memory.h> using namespace std ; void exploreCave(int N) { int ans[N], pos[N], val[N] ; int cur[N] ; memset ( ans, -1, sizeof ans ) ; for ( int i = 0 ; i < N ; ++i ) { int good = 0 ; for ( int j = 0 ; j < N ; ++j ) cur[j] = (ans[j] == -1?1:ans[j]) ; int x = tryCombination(cur) ; if ( x == -1 ) x = N+5 ; if ( x > i+1 ) good = 1 ; int lw = 0, hg = N-1 ; while ( lw < hg ) { int mid = (lw + hg) >> 1 ; for ( int j = 0 ; j < N ; ++j ) cur[j] = (ans[j] == -1?j <= mid?good:1-good:ans[j]) ; x = tryCombination(cur) ; if ( x==-1 ) x = N+5 ; if ( x > i+1 ) hg = mid; else lw = mid+1 ; } ans[lw] = good ; pos[i] = lw ; } answer (ans, pos) ; }

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

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:25:25: warning: unused variable 'val' [-Wunused-variable]
     int ans[N], pos[N], val[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...