제출 #1310712

#제출 시각아이디문제언어결과실행 시간메모리
1310712dimitri.shengelia동굴 (IOI13_cave)C++20
46 / 100
13 ms504 KiB
#include <bits/stdc++.h> #include "cave.h" using namespace std; int tryCombination ( int S[] ); void answer( int S[], int D[] ); void exploreCave( int n ) { int a[n], b[n]; fill ( a, a + n, 0 ); fill ( b, b + n, -1 ); if ( n <= 100 ) { int k, k1; while ( true ) { k = tryCombination( a ); for ( int i = 0; i < n; i++ ) { a[i] = 1 - a[i]; k1 = tryCombination( a ); if ( k1 != -1 and ( k1 < k or k == -1 ) ) { b[i] = k1; } a[i] = 1 - a[i]; } if ( k == -1 ) { answer( a, b ); } for ( int i = 0; i < n; i++ ) { if ( b[i] != -1 ) { continue; } a[i] = 0; k1 = tryCombination( a ); if ( k1 > k or k1 == -1 ) { break; } a[i] = 1; k1 = tryCombination( a ); if ( k1 > k or k1 == -1 ) { break; } } } } if ( tryCombination ( a ) != -1 ) { for ( int i = 0; i < n; i++ ) { a[i] = 0; b[i] = i; if ( tryCombination ( a ) == i ) { a[i] = 1; } } answer( a, b ); } else { for ( int i = 0; i < n; i++ ) { a[i] = 1; b[i] = tryCombination ( a ); a[i] = 0; } answer( a, b ); } return; }
#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...