Submission #331976

#TimeUsernameProblemLanguageResultExecution timeMemory
331976a_playerPassword (RMI18_password)C++14
0 / 100
172 ms516 KiB
#include <bits/stdc++.h> #ifdef ALE #include "grader.cpp" #endif using namespace std; int query(string str); int v[50]; string solve(string ss,int n, int s){ int q=ss.size(); for(int k=0;k<s;k++)v[k]=0; char possibile='a'; v[0]=1; while(true){ string t=ss; for(int i=0;i<n-q;i++)t+=possibile; int l=query(t); bool prec=false; for(int i=0;i<s;i++){ if(v[i])continue; v[i]=1; assert(t.size()==n); t[q]='a'+i; if(query(t)>l){ possibile='a'+i; prec=true; i=s; } } if(!prec){ return ss+possibile; } } } string guess(int n, int s){ string sol=""; for(int q=0;q<n;q++){ sol=solve(sol,n,s); } return sol; }

Compilation message (stderr)

In file included from /usr/include/c++/9/cassert:44,
                 from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:33,
                 from password.cpp:1:
password.cpp: In function 'std::string solve(std::string, int, int)':
password.cpp:24:22: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   24 |       assert(t.size()==n);
      |              ~~~~~~~~^~~
#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...