#include <bits/stdc++.h>
using namespace std;
int query(string str);
vector<int> a;
bool comp(pair<int,int> x,pair<int,int> y){
if(x.first==y.first){
return x.second<y.second;
}
string s2="";
for(int i=0;i<x.second;i++){
s2+=char('a'+x.first);
}
for(int i=0;i<a[y.first]-y.second+1;i++){
s2+=char('a'+y.first);
}
return (query(s2)==(int)s2.size());
}
string guess(int n,int s){
a.resize(s);
string s1="";
for(int i=0;i<s;i++){
s1="";
for(int j=0;j<n;j++){
s1+=char('a'+i);
}
a[i]=query(s1);
}
vector<pair<int,int>> b;
for(int i=0;i<s;i++){
for(int j=0;j<a[i];j++){
b.push_back(make_pair(i,j+1));
}
}
sort(b.begin(),b.end(),comp);
s1="";
cout << b.size() << endl;
for(int i=0;i<n;i++){
s1+=char('a'+b[i].first);
}
return s1;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
344 KB |
Token "-123" doesn't correspond to pattern "[a-o]{1,15}" |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
344 KB |
Token "-123" doesn't correspond to pattern "[a-b]{1,50}" |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
65 ms |
440 KB |
Token "-123" doesn't correspond to pattern "[a-l]{1,1000}" |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
344 KB |
Token "-123" doesn't correspond to pattern "[a-o]{1,15}" |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
344 KB |
Token "-123" doesn't correspond to pattern "[a-o]{1,15}" |
2 |
Halted |
0 ms |
0 KB |
- |