# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
855661 | 2023-10-01T16:09:03 Z | uomoproteina | Password (RMI18_password) | C++14 | 237 ms | 1212 KB |
#include <bits/stdc++.h> using namespace std; string str = ""; string ans = ""; int query(string s); bool add(string s) { int ret = query(s); return ret == str.size() + ans.size() + 1; } void solve(int N, int S) { if (ans.size() + str.size() == N) return; bool found = false; for (int i = 0; i < S && !found; i++) { if (add(str + char(i + (int)('a')) + ans)) { str += char(i + (int)('a')); found = true; } } if (!found && str.size()) { reverse(ans.begin(), ans.end()); ans += str.back(); reverse(ans.begin(), ans.end()); str.pop_back(); } } string guess(int n, int s) { while (ans.size() + str.size() < n) { solve(n, s); } return str + ans; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 596 KB | Guessed the password with 330 queries. |
2 | Runtime error | 4 ms | 432 KB | Execution killed with signal 13 |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 344 KB | Guessed the password with 166 queries. |
2 | Correct | 1 ms | 344 KB | Guessed the password with 306 queries. |
3 | Correct | 1 ms | 344 KB | Guessed the password with 284 queries. |
4 | Correct | 3 ms | 344 KB | Guessed the password with 668 queries. |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 116 ms | 1212 KB | Guessed the password with 20171 queries. |
2 | Correct | 148 ms | 1204 KB | Guessed the password with 29527 queries. |
3 | Correct | 199 ms | 1196 KB | Guessed the password with 44816 queries. |
4 | Incorrect | 237 ms | 1208 KB | Could not guess the password with 50000 queries. |
5 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 596 KB | Guessed the password with 330 queries. |
2 | Runtime error | 4 ms | 432 KB | Execution killed with signal 13 |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 596 KB | Guessed the password with 330 queries. |
2 | Runtime error | 4 ms | 432 KB | Execution killed with signal 13 |
3 | Halted | 0 ms | 0 KB | - |