#include<bits/stdc++.h>
// #include"grader.cpp"
using namespace std;
typedef long long ll;
typedef long double ld;
#define vii vector<pair<int, int>>
#define vi vector<int>
#define vl vector<long long>
#define vll vector<pair<long long, long long>>
#define mp make_pair
#define pb push_back
#define rep(i, a, b) for(int i = a;i<=b;i++)
#define f first
#define s second
#define FIO ios_base::sync_with_stdio(0);cin.tie(0);
#define start int tt;cin>>tt;rep(testcase, 1, tt)
#define print(k) cout<<"Case #"<<testcase<<": "<<k<<"\n";
#define endl "\n"
int query(string s);
string guess(int n,int s){
string ans = "";
for(int i=0;i<n;i++){
bool check = false;
for(int c=0;c<s;c++){
char ch = 'a'+c;
int pref = query((ch+ans));
if(pref == i+1){
ans = ch+ans;
check = true;
break;
}
}
if(check)continue;
for(int j=0;j<i;j++){
for(int c=0;c<s;c++){
char ch = 'a'+c;
string tmp = ans.substr(0,j+1)+ch+ans.substr(j+1,n-j-1);
int pref = query((tmp));
if(pref == i+1){
ans = tmp;
check = true;
break;
}
}
if(check)break;
}
}
return ans;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
13 ms |
200 KB |
Guessed the password with 1440 queries. |
2 |
Correct |
64 ms |
200 KB |
Guessed the password with 5244 queries. |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
13 ms |
200 KB |
Guessed the password with 922 queries. |
2 |
Correct |
30 ms |
200 KB |
Guessed the password with 2328 queries. |
3 |
Correct |
8 ms |
200 KB |
Guessed the password with 776 queries. |
4 |
Correct |
194 ms |
276 KB |
Guessed the password with 16740 queries. |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
451 ms |
272 KB |
Could not guess the password with 50000 queries. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
13 ms |
200 KB |
Guessed the password with 1440 queries. |
2 |
Correct |
64 ms |
200 KB |
Guessed the password with 5244 queries. |
3 |
Correct |
13 ms |
200 KB |
Guessed the password with 922 queries. |
4 |
Correct |
30 ms |
200 KB |
Guessed the password with 2328 queries. |
5 |
Correct |
8 ms |
200 KB |
Guessed the password with 776 queries. |
6 |
Correct |
194 ms |
276 KB |
Guessed the password with 16740 queries. |
7 |
Incorrect |
451 ms |
272 KB |
Could not guess the password with 50000 queries. |
8 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
13 ms |
200 KB |
Guessed the password with 1440 queries. |
2 |
Correct |
64 ms |
200 KB |
Guessed the password with 5244 queries. |
3 |
Correct |
13 ms |
200 KB |
Guessed the password with 922 queries. |
4 |
Correct |
30 ms |
200 KB |
Guessed the password with 2328 queries. |
5 |
Correct |
8 ms |
200 KB |
Guessed the password with 776 queries. |
6 |
Correct |
194 ms |
276 KB |
Guessed the password with 16740 queries. |
7 |
Incorrect |
451 ms |
272 KB |
Could not guess the password with 50000 queries. |
8 |
Halted |
0 ms |
0 KB |
- |