Submission #709141

#TimeUsernameProblemLanguageResultExecution timeMemory
709141salmonPassword (RMI18_password)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; //int query(string str); string guess(int N, int S){ string aas = ""; for(int i = 1; i <= N - 30; i++){ int s = 'a'; int e = 'a' + S - 1; while(s != e){ int m = (s + e)/2; string temp = aas; for(int i = s; i <= m; i++){ temp.push_back(s); } if(query(temp) >= i){ e = m; } else{ s = m + 1; } } aas.push_back(s); } for(int i = max(1,N - 29); i <= N; i++){ int s = 'a'; int e = 'a' + S - 1; for(char j = s; j <= e; j++){ aas.push_back(j); if(query(aas) == i){ break; } else{ aas.pop_back(); } } } return aas; }

Compilation message (stderr)

password.cpp: In function 'std::string guess(int, int)':
password.cpp:22:16: error: 'query' was not declared in this scope
   22 |             if(query(temp) >= i){
      |                ^~~~~
password.cpp:40:16: error: 'query' was not declared in this scope
   40 |             if(query(aas) == i){
      |                ^~~~~