# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
773140 | 2023-07-04T15:43:16 Z | TheSahib | Password (RMI18_password) | C++14 | 99 ms | 316 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; } break; } for(; c < 'a' + s; c++){ while(cnt[c - 'a']--){ int l = 0, r = ans.size() - 1; int a = 0; while(l <= r){ int mid = (l + r) / 2; string slice; for(int i = 0; i <= mid; i++){ slice += ans[i]; } slice += c; int b = query(slice); if(b == slice.size()){ l = mid + 1; a = mid; } else{ r = mid - 1; } } ans.insert(ans.begin() + a, c); } } return ans; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 208 KB | Execution killed with signal 13 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 5 ms | 208 KB | Execution killed with signal 13 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 99 ms | 316 KB | Execution killed with signal 13 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 208 KB | Execution killed with signal 13 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 208 KB | Execution killed with signal 13 |
2 | Halted | 0 ms | 0 KB | - |