# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
852997 | 2023-09-23T10:05:48 Z | allin27x | Password (RMI18_password) | C++17 | 173 ms | 1732 KB |
#include <bits/stdc++.h> using namespace std; int query(string str); string guess(int n, int s){ string res; vector<int> nc(s, 0); for (int i=0; i<s; i++) nc[i] = query(string(n,'a'+i)); while (res.size()<n){ string rev = res; reverse(rev.begin(), rev.end()); int mx = -1; for (int i=0; i<s; i++) if (nc[i]) {mx = i; break;} for (int i=mx+1; i<s; i++){ if (!nc[i]) continue; if (query(string(nc[i], 'a'+i) + string(1,'a'+mx) + rev) != nc[i] + 1 + res.size()) mx = i; } nc[mx] --; res += 'a' + mx; } reverse(res.begin(), res.end()); return res; } //aabcba
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 436 KB | Execution killed with signal 13 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 344 KB | Guessed the password with 47 queries. |
2 | Correct | 1 ms | 344 KB | Guessed the password with 137 queries. |
3 | Correct | 0 ms | 344 KB | Guessed the password with 17 queries. |
4 | Correct | 1 ms | 344 KB | Guessed the password with 294 queries. |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 52 ms | 1236 KB | Guessed the password with 9308 queries. |
2 | Correct | 80 ms | 720 KB | Guessed the password with 17734 queries. |
3 | Correct | 112 ms | 716 KB | Guessed the password with 20688 queries. |
4 | Correct | 173 ms | 1732 KB | Guessed the password with 37111 queries. |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 436 KB | Execution killed with signal 13 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 436 KB | Execution killed with signal 13 |
2 | Halted | 0 ms | 0 KB | - |