#include <iostream>
using namespace std;
string ans, q;
int query( string p );
char guess_kth( int k, int left, int right ) {
char ch;
int mid;
if ( left == right )
return left;
mid = (left + right) / 2;
q = "";
for ( ch = left + 'a'; ch <= mid + 'a'; ch++ )
q += ch;
if ( query( ans + q ) > k )
return mid;
return mid + 1;
}
string guess( int n, int s ) {
char ch;
int i;
ans = "";
//for ( i = 0; i < n - s; i++ )
//ans += guess_kth( i, 0, s - 1 ) + 'a';
for ( i = 0; i < n; i++ ) {
ch = 'a';
while ( ch < 'a' + s - 1 && query( ans + ch ) <= i )
ch++;
ans += ch;
}
return ans;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
200 KB |
Returned early from guess() after 175 queries. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
200 KB |
Returned early from guess() after 51 queries. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
105 ms |
308 KB |
Returned early from guess() after 10574 queries. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
200 KB |
Returned early from guess() after 175 queries. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
200 KB |
Returned early from guess() after 175 queries. |
2 |
Halted |
0 ms |
0 KB |
- |