답안 #852841

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
852841 2023-09-22T22:19:30 Z LucaLucaM Password (RMI18_password) C++17
0 / 100
1 ms 436 KB
//#ifndef PASSWORD_H_INCLUDED
//#define PASSWORD_H_INCLUDED

#include <bits/stdc++.h>
#warning That's the baby, that's not my baby

typedef long long ll;

using namespace std;

int query (string str);

string guess (int n, int s) {
    string answer = "";
    while ((int) answer.size() < n) {
        int m = (int) answer.size();
        for (int i = 0; i < s; i++) {
            string q = answer + string(n - m, char(i + 'a'));
            int k = query(q);
            if (k != m) {
                for (int j = m; j < k; j++) {
                    answer += char(i + 'a');
                }
                break;
            }
        }
        assert((int) answer.size() != m);
    }
    return answer;
}

//#endif // PASSWORD_H_INCLUDED

Compilation message

password.cpp:5:2: warning: #warning That's the baby, that's not my baby [-Wcpp]
    5 | #warning That's the baby, that's not my baby
      |  ^~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 432 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 436 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 436 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 432 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 432 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -