# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
494372 | Itamar | Password (RMI18_password) | C++14 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
// password.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream>
using namespace std;
string rec(int n, int s, string x, int it) {
if (x.size() == n) {
return x;
}
for (int i = 0; i < s; i++) {
x[it] = 96 + i;
if (query(x) == x.size()) {
return rec(n, s, x, it + 1);
}
}
x[it] = x[it - 1];
it--;
return rec(n, s, x, it);
}
string guess(int n, int s) {
string x;
return rec(n, s, x, 0);
}