Submission #487103

# Submission time Handle Problem Language Result Execution time Memory
487103 2021-11-14T10:13:10 Z Karuk Password (RMI18_password) C++17
Compilation error
0 ms 0 KB
#include<bits/stdc++.h>
using namespace std;
string guess(int n , int k)
{
    string s;
    for(int i=0;i<n;i++)
    {
        s+='a';
    }
    while(1)
    {
        for(int i=0;i<n;i++)
        {
            if(s[i]==k+'a'-1)s[i]='a';
            else {s[i]++;i=n+1;}
        }
        int x=query(s);
        if(x==n)return s;
    }
}

Compilation message

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