Submission #729527

#TimeUsernameProblemLanguageResultExecution timeMemory
729527Jean7Cave (IOI13_cave)C++14
46 / 100
12 ms400 KiB
#include "cave.h" #include <bits/stdc++.h> using namespace std ; int n , s[5000] , d[5000] ; void solve2 () { for ( int i = 0 ; i < n ; i++ ) { s[i] = 0 ; } for ( int i = 0 ; i < n ; i++ ) { s[i] = 1 ; d[i] = tryCombination(s) ; s[i] = 0 ; } answer(s,d) ; } void solve1 () { for ( int i = 0 ; i < n ; i++ ) { d[i] = i ; s[i] = 0 ; } for ( int i = 0 ; i < n ; i++ ) { int x = tryCombination(s) ; if ( x == -1 ) { break ; } s[x] = 1 ; } answer(s,d) ; } void solve () { for ( int i = 0 ; i < n ; i++ ) { s[i] = 0 ; } if ( tryCombination(s) != -1 ) { solve1 () ; } else { solve2 () ; } } void exploreCave ( int N ) { n = N ; if ( n > 100 ) { solve () ; } for ( int j = 0 ; j < n ; j++ ) { for ( int i = 0 ; i < n ; i++ ) { s[i] = 1 ; int x = tryCombination(s) ; s[i] = 0 ; int y = tryCombination(s) ; if ( x == -1 ) { x = 1e9 ; } if ( y == -1 ) { y = 1e9 ; } if ( x == y ) { continue ; } if ( x < y ) { s[i] = 0 ; d[i] = x ; } else { s[i] = 1 ; d[i] = y ; } } } answer(s,d) ; }
#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...