Submission #199693

#TimeUsernameProblemLanguageResultExecution timeMemory
199693Osama_AlkhodairyPassword (RMI18_password)C++17
100 / 100
384 ms580 KiB
#include <bits/stdc++.h> //~ #include "grader.cpp" using namespace std; int query(string s); string guess(int n, int c){ vector <int> f(c); for(char i = 'a' ; i < 'a' + c ; i++){ f[i - 'a'] = query(string(n, i)); } string ans; for(char i = 'a' ; i < 'a' + c ; i++){ string cur = ans; int e = ans.size(); for(int j = 0 ; j < f[i - 'a'] ; j++){ while(e >= 15 && query(ans.substr(0, e - 15) + string(j + 1, i)) != e - 15 + j + 1){ e -= 16; } int l = max(0, e - 15), r = e; while(l <= r){ int mid = (l + r) / 2; if(query(ans.substr(0, mid) + string(j + 1, i)) == mid + j + 1) l = mid + 1; else r = mid - 1; } cur.insert(cur.begin() + r, i); } ans = cur; } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...