Submission #867699

#TimeUsernameProblemLanguageResultExecution timeMemory
867699franfillPassword (RMI18_password)C++17
0 / 100
1 ms436 KiB
#include<bits/stdc++.h> using namespace std; int query(string S); string cur = ""; int N, S; int solve(int i, char c) { if (c > 'z' || cur.size() == N) return 0; string tr = ""; if (i != 0) tr += cur.substr(0, i); tr += c; if (i != cur.size()) tr += cur.substr(i, ((int)cur.size())-i); if (query(tr) == tr.size()) { int ans = 1; cur = tr; ans += solve(i, c); ans += solve(i+ans, c+1); return ans; } else return solve(i, c+1); } string guess(int N, int S) { ::N = N; ::S = S; cur = ""; solve(0, 'a'); return cur; }

Compilation message (stderr)

password.cpp: In function 'int solve(int, char)':
password.cpp:11:28: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   11 |  if (c > 'z' || cur.size() == N)
      |                 ~~~~~~~~~~~^~~~
password.cpp:17:8: 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 (i != cur.size())
      |      ~~^~~~~~~~~~~~~
password.cpp:19:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   19 |  if (query(tr) == tr.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...