Submission #643105

#TimeUsernameProblemLanguageResultExecution timeMemory
643105TimDeePassword (RMI18_password)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; string guess(int n, int c) { int last=0; string s; while (last<n) { int l=0, r=c-1; while (l<r) { int mid=(l+r)>>1; string t=s; for (char i='a'; i<='a'+mid; ++i) t.push_back(i); int x=query(t); if (x>last) r=mid; else l=mid+1; } s+=('a'+r); last=s.length(); } return s; }

Compilation message (stderr)

password.cpp: In function 'std::string guess(int, int)':
password.cpp:13:13: error: 'query' was not declared in this scope
   13 |       int x=query(t);
      |             ^~~~~