이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |