Submission #199683

#TimeUsernameProblemLanguageResultExecution timeMemory
199683zoooma13Password (RMI18_password)C++14
50 / 100
611 ms460 KiB
#include <bits/stdc++.h> using namespace std; int query(string s); string guess(int n ,int s){ pair <int ,int> frq[s]; for(char c='a'; c<'a'+s; c++) frq[c-'a'] = {query(string(n ,c)) ,c}; int lst = 0; string ans; for(int j=0; j<s; j++){ char c = frq[j].second; for(int i=0; frq[j].first && ans.size()<n && i<=ans.size(); i++){ string ss = ans; ss.insert(ss.begin()+i ,c); int q = query(ss); if(q > lst){ ans = ss; lst = q; frq[j].first--; } } } return ans; }

Compilation message (stderr)

password.cpp: In function 'std::__cxx11::string guess(int, int)':
password.cpp:16:48: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         for(int i=0; frq[j].first && ans.size()<n && i<=ans.size(); i++){
                                      ~~~~~~~~~~^~
password.cpp:16:55: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         for(int i=0; frq[j].first && ans.size()<n && i<=ans.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...