Submission #985244

#TimeUsernameProblemLanguageResultExecution timeMemory
985244bachhoangxuanPassword (RMI18_password)C++17
100 / 100
162 ms1812 KiB
#include<bits/stdc++.h> using namespace std; int query(string s); string guess(int n,int s){ function<string(int,int)> dnc = [&](int l,int r){ if(l==r) return string(query(string(n,'a'+l)),'a'+l); int mid=(l+r)>>1,i,j; string lt=dnc(l,mid),rt=dnc(mid+1,r),res; for(i=0,j=0;i<(int)lt.size() && j<(int)rt.size();){ string cur=res+lt[i]+rt.substr(j); if(query(cur)==(int)cur.size()) res+=lt[i++]; else res+=rt[j++]; } if(i==(int)lt.size()) res+=rt.substr(j); else res+=lt.substr(i); return res; }; return dnc(0,s-1); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...