답안 #723239

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
723239 2023-04-13T12:19:40 Z tvladm2009 Password (RMI18_password) C++17
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>
#include "grader.h"

using namespace std;

typedef long long ll;

int N;

string solve(int l, int r) {
    int mid = (l + r) / 2;
    if (l == r) {
        string qry = "";
        for (int j = 1; j <= N; j++) {
            qry += char('a' + l);
        }
        int resp = query(qry);
        string answer = "";
        for (int j = 1; j <= resp; j++) {
            answer += char('a' + l);
        }
        return answer;
    }
    string a = solve(l, mid);
    string b = solve(mid + 1, r);
    string answer = "";
    int posA = 0, posB = 0;
    while (posA < (int) a.size()) {
        while (true) {
            string qry = answer;
            qry += a[posA];
            for (int j = posB; j < (int) b.size(); j++) {
                qry += b[j];
            }
            int resp = query(qry);
            if (resp == (int) b.size() + posA + 1) {
                answer += a[posA];
                break;
            }
            answer += b[posB];
            posB++;
        }
        posA++;
    }
    for (int i = posB; i < (int) b.size(); i++) {
        answer += b[i];
    }
    return answer;
}

string guess(int _N, int S) {
    N = _N;
    string answer = solve(0, S - 1);
    return answer;
}

Compilation message

password.cpp:2:10: fatal error: grader.h: No such file or directory
    2 | #include "grader.h"
      |          ^~~~~~~~~~
compilation terminated.