#include <bits/stdc++.h>
#ifdef ALE
#include "grader.cpp"
#endif
using namespace std;
int query(string q);
int v[50];
string ss(vector<char> a){
string r="";
for(char x:a)r+=x;
return r;
}
string guess(int a, int b){
vector<char> t,sol;
for(int q=0;q<a;q++){
for(int k=0;k<b;k++)v[k]=0;
bool found=false;
char possible='a';
v[0]=1;
while(!found){
t.clear();
for(char x:sol)t.push_back(x);
for(int i=0;i<a-q;i++)t.push_back(possible);
int l=query(ss(t));
bool prev=false;
for(int i=0;i<b;i++){
if(v[i])continue;
v[i]=1;
t[sol.size()]='a'+i;
if(query(ss(t))>l){
possible='a'+i;
prev=true;
i=b;
}
}
if(!prev){
sol.push_back(possible);
found=true;
}
}
}
return ss(sol);
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
4 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 |
2 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 |
282 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 |
4 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 |
4 ms |
364 KB |
Execution killed with signal 13 (could be triggered by violating memory limits) |
2 |
Halted |
0 ms |
0 KB |
- |