# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
634900 | 2022-08-25T08:22:47 Z | danikoynov | Password (RMI18_password) | C++14 | 2 ms | 336 KB |
#include<bits/stdc++.h> using namespace std; const int maxs = 26; int N, S, used[maxs]; int query(string s); string guess(int n, int s) { N = n; S = s; string ans = ""; for (int i = 0; i < s; i ++) { string cur = ""; for (int j = 0; j < n; j ++) cur = cur + (char)(i + 'a'); if (query(cur) == 1) ans = ans + (char)(i + 'a'), used[i] = 1; } return ans; int len = query(ans); for (int j = 0; j < s; j ++) { if (!used[j]) continue; int id = 0; string wt = ""; for (int i = 0; i < n; i ++) { if (ans[i] != (char)(j + 'a')) wt = wt + ans[i]; } for (int i = 0; i < n; i ++) { string cur = wt, new_cur = ""; for (int k = 0; k < n; k ++) { if (i == k) new_cur = new_cur + (char)(j + 'a'); if (k != n - 1) new_cur = new_cur + cur[k]; } int sm = query(new_cur); if (sm > len) { len = sm; ans = new_cur; } } } return ans; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 208 KB | Returned early from guess() after 16 queries. |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 208 KB | Token "-1" doesn't correspond to pattern "[a-b]{1,50}" |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 336 KB | Returned early from guess() after 13 queries. |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 208 KB | Returned early from guess() after 16 queries. |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 208 KB | Returned early from guess() after 16 queries. |
2 | Halted | 0 ms | 0 KB | - |