Submission #199684

#TimeUsernameProblemLanguageResultExecution timeMemory
199684Osama_AlkhodairyPassword (RMI18_password)C++17
80 / 100
620 ms632 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; for(int j = 0 ; j < f[i - 'a'] ; j++){ int l = 0, r = ans.size(); 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...