# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
248800 | tqbfjotld | Password (RMI18_password) | C++14 | 416 ms | 616 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
int query(string str);
bool cmp(string s1, string s2){
return s1.size()>s2.size();
}
priority_queue<string,vector<string>,function<bool(string,string)> > pq(cmp);
string repeat(char c, int n){
string ret = "";
for (int x = 0; x<n; x++){
ret+=c;
}
return ret;
}
string guess(int n, int s){
for (int x = 0; x<s; x++){
string qu = repeat('a'+x,n);
int t = query(qu);
if (t!=0)pq.push(repeat('a'+x,t));
}
while (pq.size()>1){
string s1 = pq.top(); pq.pop();
string s2 = pq.top(); pq.pop();
string nw = "";
nw+=s2[0];
int c1 = 0;
int c2 = 1;
while (nw.size()<s1.size()+s2.size()){
string qu = nw+s1.substr(c1,s1.size());
int t = query(qu);
if (t==qu.size()){
if (c2==s2.size()){
nw += s1.substr(c1,s1.size());
}
else{
nw += s2[c2];
c2++;
}
}
else{
nw.pop_back();
c2--;
nw += s1[c1];
c1++;
}
}
pq.push(nw);
}
return pq.top();
}
컴파일 시 표준 에러 (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... |