Submission #709240

#TimeUsernameProblemLanguageResultExecution timeMemory
709240siewjhPassword (RMI18_password)C++17
50 / 100
356 ms420 KiB
#include <bits/stdc++.h> using namespace std; int query(string q); string guess(int n, int s){ string ans = ""; for (int i = 0; i < s; i++){ char ch = 'a' + i; string str = ""; for (int k = 0; k < n; k++) str += ch; int amt = query(str); for (int ind = 0, j = 0; j < amt; j++){ for (;;ind++){ str = ans; str.insert(str.begin() + ind, ch); if (query(str) == str.size()) { ans = str; ind++; break; } } } } return ans; }

Compilation message (stderr)

password.cpp: In function 'std::string guess(int, int)':
password.cpp:17:32: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   17 |                 if (query(str) == str.size()) {
      |                     ~~~~~~~~~~~^~~~~~~~~~~~~
#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...