Submission #755959

#TimeUsernameProblemLanguageResultExecution timeMemory
755959vjudge1Password (RMI18_password)C++17
10 / 100
420 ms376 KiB
#include <bits/stdc++.h> using namespace std; #ifdef LOCAL #include "C:\GCC\debug.h" #else #define debug(...) void(42) #endif int cnt = 0; int query(string str); 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); } for (int pos = n - 1; pos >= 0; pos--) { for (int i = 0; i < s; i++) { if (freq[i] > 0) { string build = ""; for (int it = 0; it < freq[i]; it++) { build += (i + 'a'); } bool work = true; if ((int) build.size() + 1 + (int) endChars.size() <= n) { for (int j = 0; j < s; j++) { string tmp = ""; tmp += build; tmp += (j + 'a'); tmp += endChars; if (query(tmp) == (int) tmp.length()) { work = false; break; } } } if (work) { freq[i] -= 1; string nEnd = ""; nEnd += (i + 'a'); nEnd += endChars; swap(nEnd, endChars); break; } } } } return endChars; }
#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...