Submission #1117349

#TimeUsernameProblemLanguageResultExecution timeMemory
1117349CiprianPassword (RMI18_password)C++14
0 / 100
217 ms712 KiB
#include <bits/stdc++.h> using namespace std; int query(string s); string guess(int n, int s){ char a='a'; vector<char>c; map<char, int>cnt; for(int j=1; j<=s; j++){ if(query(string(1,a))==1){ c.push_back(a); cnt[a]=query(string(n, a)); } a++; } string w; for(int i=1; i<=n; i++){ char x=c[0]; for(int j=1; j<c.size(); j++){ if(query(w+c[j]+string(cnt[x], x))==w.size()+cnt[x]+1){ x=c[j]; } }w+=x; cnt[x]--; } return w; }

Compilation message (stderr)

password.cpp: In function 'std::string guess(int, int)':
password.cpp:20:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   20 |         for(int j=1; j<c.size(); j++){
      |                      ~^~~~~~~~~
password.cpp:21:47: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   21 |             if(query(w+c[j]+string(cnt[x], x))==w.size()+cnt[x]+1){
      |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
#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...