#include<bits/stdc++.h>
using namespace std;
int query(string str);
string merge(const vector<string>& sol, int lo, int hi){
if(lo == hi) return sol[lo];
int mi = (lo + hi) / 2;
string s1 = merge(sol, lo, mi), s2 = merge(sol, mi + 1, hi), res = "";
int curr = 0, dex = 0;
while(curr < (int)s1.size() && dex < (int)s2.size()){
if(query(res + s2[dex] + s1.substr(curr)) == (int)res.size() + (int)s1.size() - curr + 1) res += s2[dex++];
else res += s1[curr++];
}
return res + s1.substr(curr) + s2.substr(dex);
}
string guess(int n, int s){
vector<string> sol(26, "");
for(int i = 0; i < s; i++){
string ss(5005, 'a' + i);
sol[i].assign(query(ss), 'a' + i);
}
return merge(sol, 0, s - 1);
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
0 ms |
364 KB |
Execution killed with signal 13 (could be triggered by violating memory limits) |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
0 ms |
364 KB |
Execution killed with signal 13 (could be triggered by violating memory limits) |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
0 ms |
364 KB |
Execution killed with signal 13 (could be triggered by violating memory limits) |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
0 ms |
364 KB |
Execution killed with signal 13 (could be triggered by violating memory limits) |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
0 ms |
364 KB |
Execution killed with signal 13 (could be triggered by violating memory limits) |
2 |
Halted |
0 ms |
0 KB |
- |