# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1087904 | ASN49K | Password (RMI18_password) | C++14 | 187 ms | 1204 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
int query(string str);
//kind of a merge sort algorithm
//log2(26)*2*n+26 operations but it's much better in practice if the test are random or we randomize
string divide(int n,int l,int r)
{
if(l==r)
{
//number of apperances of a char
return string(query(string(n,char('a'+l))) , char('a'+l));
}
int m=(l+r)/2;
string a=divide(n,l,m),b=divide(n,m+1,r),rez;
while(a.size() && b.size())
{
//the next postion of a char for the result is either from a or from b
//we verify if position(a[0])<position(b[0])
if(query(rez+a[0]+b)==rez.size()+1+b.size())
{
rez.push_back(a[0]);
a.erase(a.begin());
}
else
{
rez.push_back(b[0]);
b.erase(b.begin());
}
}
//we add the remainings
rez+=a;
rez+=b;
return rez;
}
string guess(int n, int s)
{
return divide(n,0,s-1);
}
컴파일 시 표준 에러 (stderr) 메시지
# | 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... |