Submission #494380

#TimeUsernameProblemLanguageResultExecution timeMemory
494380ItamarPassword (RMI18_password)C++14
0 / 100
0 ms200 KiB
#include <iostream> using namespace std; int query(string str); string rec(int n, int s, string x, int it, int siz) { if (siz == n) { return x; } for (int i = 0; i < s; i++) { x[it] = 97 + i; if (query(x) == x.size()) { return rec(n, s, x, it + 1,siz+1); } } x[it] = x[it - 1]; it--; return rec(n, s, x, it,siz); } string guess(int n, int s) { string x; x.resize(n); return rec(n, s, x, 0,0); }

Compilation message (stderr)

password.cpp: In function 'std::string rec(int, int, std::string, int, int)':
password.cpp:12:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   12 |   if (query(x) == x.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...