Submission #261068

#TimeUsernameProblemLanguageResultExecution timeMemory
261068handlenamePassword (RMI18_password)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; #define pb push_back #define mp make_pair int num[26]; string guess(int n,int s){ set<pair<int,string> > process; for (int i=0;i<s;i++){ string cur; for (int j=0;j<n;j++) cur.pb('a'+i); num[i]=query(cur); cur.clear(); for (int j=0;j<num[i];j++){ cur.pb('a'+i); } process.insert(mp(num[i],cur)); } while (process.size()>1){ string one=(*(process.begin())).second; process.erase(process.begin()); string two=(*(process.begin())).second; process.erase(process.begin()); string res=two; int id=0; //idth guy not fixed for (int i=0;i<one.size();i++){ string cur=res; while (true){ string lol; for (int j=0;j<id;j++){ lol.pb(cur[j]); } lol.pb(one[i]); for (int j=id;j<cur.size();j++){ lol.pb(cur[j]); } if (query(lol)==lol.size()){ cur=lol; break; } id++; } id++; res=cur; } process.insert(mp(res.size(),res)); } return (*(process.begin())).second; }

Compilation message (stderr)

password.cpp: In function 'std::__cxx11::string guess(int, int)':
password.cpp:11:16: error: 'query' was not declared in this scope
         num[i]=query(cur);
                ^~~~~
password.cpp:25:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         for (int i=0;i<one.size();i++){
                      ~^~~~~~~~~~~
password.cpp:33:32: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
                 for (int j=id;j<cur.size();j++){
                               ~^~~~~~~~~~~
password.cpp:36:21: error: 'query' was not declared in this scope
                 if (query(lol)==lol.size()){
                     ^~~~~