제출 #1123146

#제출 시각아이디문제언어결과실행 시간메모리
1123146SulAPassword (RMI18_password)C++20
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
//#include "gondola.h"
//#pragma GCC target("popcnt")
using namespace __gnu_pbds;
using namespace std;
using ordered_set = tree<int, null_type, less_equal<>, rb_tree_tag, tree_order_statistics_node_update>;
#define popcount __builtin_popcountll
#define all(a) (a).begin(), (a).end()

string guess(int n, int s) {
    string ans;
    for (int i = 0; i < n; i++) {
        ans += 'a';
        for (char j = 'b'; j < 'a' + s; j++) {
            string t = ans;
            ans.pop_back();
            ans += j;
            if (query(t) > query(ans))
                swap(ans, t);
        }
    }
    return ans;
}

//signed main() {
//    ios::sync_with_stdio(false);
//    cin.tie(nullptr);
//    cout.tie(nullptr);
//
//    guess(4, 4);
//}

컴파일 시 표준 에러 (stderr) 메시지

password.cpp: In function 'std::string guess(int, int)':
password.cpp:21:17: error: 'query' was not declared in this scope
   21 |             if (query(t) > query(ans))
      |                 ^~~~~