# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
773336 | aykhn | Password (RMI18_password) | C++14 | 1 ms | 208 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
// author: aykhn
using namespace std;
typedef long long ll;
#define pb push_back
#define ins insert
#define mpr make_pair
int cnt[30];
priority_queue<pair<int, string>, vector<pair<int, string>>, greater<pair<int, string>>> pq;
int query(string str);
void MERGE(string &a, string &b)
{
int prev = query(b);
int i = 0;
for (int j = 0; j < b.length(); j++)
{
string tmp = b;
b.ins(b.begin() + j, a[i]);
int x = query(b);
if (x <= prev) b = tmp;
else i++;
}
}
string guess(int n, int s)
{
string tmp = "";
for (int i = 0; i < n; i++)
{
tmp.pb('a');
}
int prev = 0;
for (int i = 0; i < s; i++)
{
cnt[i] = query(tmp);
pq.push(mpr(cnt[i], tmp.substr(0, cnt[i])));
for (int j = 0; j < n; j++) tmp[j]++;
}
while (pq.size() > 1)
{
string A = pq.top().second;
pq.pop();
string B = pq.top().second;
pq.pop();
MERGE(A, B);
pq.push(mpr(B.length(), B));
}
return pq.top().second;
}
컴파일 시 표준 에러 (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... |