Submission #755980

#TimeUsernameProblemLanguageResultExecution timeMemory
755980vjudge1Password (RMI18_password)C++17
0 / 100
33 ms320 KiB
///YOU WILL MAKE IT #include<bits/stdc++.h> using namespace std; int query(string s); string guess(int n,int s){ string ans=""; for(int j=0;j<s;j++){ bool f=1; char cur=(char)(j+'a'); for(int k=0;k<ans.size();k++){ string temp=ans; //cout<<ans<<" "<<" "<<k<<" "<<temp<<endl; temp.insert(temp.begin()+k,cur); if(query(temp)==temp.size()){ ans=temp; } } while(f){ f=0; string temp=ans; temp.push_back(cur); if(query(temp)==temp.size()){ ans=temp; f=1; } } } return ans; }

Compilation message (stderr)

password.cpp: In function 'std::string guess(int, int)':
password.cpp:10:26: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   10 |             for(int k=0;k<ans.size();k++){
      |                         ~^~~~~~~~~~~
password.cpp:14:31: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   14 |                 if(query(temp)==temp.size()){
      |                    ~~~~~~~~~~~^~~~~~~~~~~~~
password.cpp:22:31: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   22 |                 if(query(temp)==temp.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...