# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
494372 | 2021-12-15T10:52:15 Z | Itamar | Password (RMI18_password) | C++14 | 0 ms | 0 KB |
// 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); }