# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
634910 | danikoynov | Password (RMI18_password) | C++14 | 3 ms | 336 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
using namespace std;
const int maxs = 40;
int N, S, used[maxs];
int query(string s);
string guess(int n, int s)
{
N = n;
S = s;
string ans = "";
for (int i = 0; i < s; i ++)
{
string cur = "";
for (int j = 0; j < n; j ++)
cur = cur + (char)(i + 'a');
if (query(cur) == 1)
ans = ans + (char)(i + 'a'), used[i] = 1;
}
int len = query(ans);
for (int j = 0; j < s; j ++)
{
if (!used[j])
continue;
int id = 0;
string wt = "";
for (int i = 0; i < n; i ++)
{
if (ans[i] != (char)(j + 'a'))
wt = wt + ans[i];
}
for (int i = 0; i < n; i ++)
{
string cur = wt, new_cur = "";
for (int k = 0; k < n; k ++)
{
if (i == k)
new_cur = new_cur + (char)(j + 'a');
if (k != n - 1)
new_cur = new_cur + cur[k];
}
int sm = query(new_cur);
if (sm > len)
{
len = sm;
ans = new_cur;
}
}
}
return ans;
}
컴파일 시 표준 에러 (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... |