Submission #663606

# Submission time Handle Problem Language Result Execution time Memory
663606 2022-11-27T03:11:23 Z Nursik Password (RMI18_password) C++14
Compilation error
0 ms 0 KB
#include <stdio.h>
 
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>

using namespace std;

#define ll long long
#define pb push_back


string guess(int n, int s){
    string ans = "";
    int cur = 0;
    string pref = "";
    for (int i = 0; i < n; ++i){
        string npref = pref;
        for (int j = 0; j < s; ++j){
            char ch = 'a';
            ch += j;
            npref = pref;
            for (int k = 1; k <= n - i; ++k){
                npref += ch;
            }
            int kek = query(npref);
            if (kek > cur){
                pref += ch;
                break;
            }
        }
        cur += 1;
    }
    return pref;
}

Compilation message

password.cpp: In function 'std::string guess(int, int)':
password.cpp:49:23: error: 'query' was not declared in this scope
   49 |             int kek = query(npref);
      |                       ^~~~~