Submission #755871

#TimeUsernameProblemLanguageResultExecution timeMemory
755871vjudge1Password (RMI18_password)C++17
0 / 100
33 ms292 KiB
#include <bits/stdc++.h> using namespace std; #ifdef LOCAL #include "C:\GCC\debug.h" #else #define debug(...) void(42) #endif int query(string str); /* int query(string str) { cout << str << endl; int x; cin >> x; return x; } */ string guess(int n, int s) { string endChars; vector<int> freq(s); for (int i = 0; i < s; i++) { string str; for (int it = 0; it < n; it++) { str += (i + 'a'); } freq[i] = query(str); if (freq[i] == n) { return str; } } string res; for (int i = 0; i < s; i++) { for (int j = 0; j < freq[i]; j++) { res += (i + 'a'); } } auto Build = [&](char i, char j) { string str; str += i; str += j; return str; }; sort(res.begin(), res.end(), [&](char i, char j) { if (i == j) { return 0; } return query(Build(i, j)); }); return res; } /* int main() { guess(5, 5); } */
#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...