# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
709141 | 2023-03-13T06:41:03 Z | salmon | Password (RMI18_password) | C++14 | 0 ms | 0 KB |
#include <bits/stdc++.h> using namespace std; //int query(string str); string guess(int N, int S){ string aas = ""; for(int i = 1; i <= N - 30; i++){ int s = 'a'; int e = 'a' + S - 1; while(s != e){ int m = (s + e)/2; string temp = aas; for(int i = s; i <= m; i++){ temp.push_back(s); } if(query(temp) >= i){ e = m; } else{ s = m + 1; } } aas.push_back(s); } for(int i = max(1,N - 29); i <= N; i++){ int s = 'a'; int e = 'a' + S - 1; for(char j = s; j <= e; j++){ aas.push_back(j); if(query(aas) == i){ break; } else{ aas.pop_back(); } } } return aas; }