Submission #709189

#TimeUsernameProblemLanguageResultExecution timeMemory
709189ecxxPassword (RMI18_password)C++17
10 / 100
3 ms256 KiB
#include <bits/stdc++.h> using namespace std; #define ii pair<int, int> int query(string str); string guess(int n, int s) { // subtask one int exists[26] = { 0 }; vector<ii> gthan(s, {0, 0}); for (int i = 0; i < s; i++) gthan[i].second = i; char q[3] = "\0\0"; for (int i = 0 ; i < s; i++) { q[0] = i + 'a'; exists[i] = query(string(q)); } for (int i = 0 ; i < s; i++) for (int j = i+1; j < s; j++) { if ((!exists[i]) || (!exists[j])) continue; q[0] = i + 'a'; q[1] = j + 'a'; int result = query(string(q)); gthan[j].first += (result-1); gthan[i].first += (2-result); } sort(gthan.begin(), gthan.end()); string ans; for (auto q : gthan) { if (exists[q.second]) ans.push_back((char)(q.second + 'a')); } 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...