Submission #1117319

#TimeUsernameProblemLanguageResultExecution timeMemory
1117319CiprianPassword (RMI18_password)C++14
10 / 100
9 ms424 KiB
#include <bits/stdc++.h> using namespace std; int query(string s); string guess(int n, int s){ char a='a'; vector<char>c; char b[30]; for(int j=1; j<=s; j++){ if(query(string(1,a))==1)c.push_back(a); a++; } for(int j=0; j<c.size(); j++){ int cnt=0; for(int i=0; i<c.size(); i++){ if(j!=i){ if(query(string(1,c[i])+c[j])==2)cnt++; } }b[cnt]=c[j]; }string w; for(int j=0; j<n; j++)w+=b[j]; return w; }

Compilation message (stderr)

password.cpp: In function 'std::string guess(int, int)':
password.cpp:13:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   13 |     for(int j=0; j<c.size(); j++){
      |                  ~^~~~~~~~~
password.cpp:15:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   15 |         for(int i=0; i<c.size(); i++){
      |                      ~^~~~~~~~~
#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...