# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
773209 | 2023-07-04T16:48:25 Z | TheSahib | Password (RMI18_password) | C++14 | 342 ms | 332 KB |
#include <bits/stdc++.h> #define ll long long #define pii pair<int, int> using namespace std; int cnt[30]; int query(string s); string guess(int n, int s){ for (int c = 'a'; c < 'a' + s; c++) { string a; for (int i = 0; i < n; i++) { a += c; } int b = query(a); cnt[c - 'a'] = b; } string ans = ""; char c = 'a'; for (; c < 'a' + s; c++) { if(cnt[c - 'a'] == 0) continue; while(cnt[c - 'a']--){ ans += c; } c += 1; break; } for(; c < 'a' + s; c++){ while(cnt[c - 'a']){ for(int i = 0; i <= ans.size() && cnt[c - 'a']; ++i){ string z = ans; z.insert(z.begin() + i, c); int b = query(z); if(b == z.size()){ ans = z; i += 1; cnt[c - 'a']--; } } } } return ans; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 208 KB | Guessed the password with 76 queries. |
2 | Correct | 1 ms | 256 KB | Guessed the password with 187 queries. |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 208 KB | Guessed the password with 80 queries. |
2 | Correct | 1 ms | 208 KB | Guessed the password with 161 queries. |
3 | Correct | 2 ms | 208 KB | Guessed the password with 175 queries. |
4 | Correct | 5 ms | 208 KB | Guessed the password with 394 queries. |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 101 ms | 312 KB | Guessed the password with 11857 queries. |
2 | Correct | 303 ms | 332 KB | Guessed the password with 37122 queries. |
3 | Correct | 149 ms | 316 KB | Guessed the password with 21280 queries. |
4 | Incorrect | 342 ms | 324 KB | Could not guess the password with 50000 queries. |
5 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 208 KB | Guessed the password with 76 queries. |
2 | Correct | 1 ms | 256 KB | Guessed the password with 187 queries. |
3 | Correct | 1 ms | 208 KB | Guessed the password with 80 queries. |
4 | Correct | 1 ms | 208 KB | Guessed the password with 161 queries. |
5 | Correct | 2 ms | 208 KB | Guessed the password with 175 queries. |
6 | Correct | 5 ms | 208 KB | Guessed the password with 394 queries. |
7 | Correct | 101 ms | 312 KB | Guessed the password with 11857 queries. |
8 | Correct | 303 ms | 332 KB | Guessed the password with 37122 queries. |
9 | Correct | 149 ms | 316 KB | Guessed the password with 21280 queries. |
10 | Incorrect | 342 ms | 324 KB | Could not guess the password with 50000 queries. |
11 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 208 KB | Guessed the password with 76 queries. |
2 | Correct | 1 ms | 256 KB | Guessed the password with 187 queries. |
3 | Correct | 1 ms | 208 KB | Guessed the password with 80 queries. |
4 | Correct | 1 ms | 208 KB | Guessed the password with 161 queries. |
5 | Correct | 2 ms | 208 KB | Guessed the password with 175 queries. |
6 | Correct | 5 ms | 208 KB | Guessed the password with 394 queries. |
7 | Correct | 101 ms | 312 KB | Guessed the password with 11857 queries. |
8 | Correct | 303 ms | 332 KB | Guessed the password with 37122 queries. |
9 | Correct | 149 ms | 316 KB | Guessed the password with 21280 queries. |
10 | Incorrect | 342 ms | 324 KB | Could not guess the password with 50000 queries. |
11 | Halted | 0 ms | 0 KB | - |