Submission #709069

#TimeUsernameProblemLanguageResultExecution timeMemory
709069jamezzzPassword (RMI18_password)C++17
50 / 100
490 ms480 KiB
#include <bits/stdc++.h> using namespace std; int query(string str); string guess(int n,int s){ string ans=""; int pv=0; for(int i=0;i<s;++i){ char c='a'+i; for(int j=0;j<ans.length()+1;++j){ string tmp=ans; tmp.insert(j,1,c); int res=query(tmp); if(res>pv){ pv=res; swap(tmp,ans); if(pv==n)return ans; continue; } } } return ans; }

Compilation message (stderr)

password.cpp: In function 'std::string guess(int, int)':
password.cpp:11:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   11 |   for(int j=0;j<ans.length()+1;++j){
      |               ~^~~~~~~~~~~~~~~
#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...