제출 #1327275

#제출 시각아이디문제언어결과실행 시간메모리
1327275dashkaPassword (RMI18_password)C++20
0 / 100
13 ms404 KiB
#include <bits/stdc++.h>
using namespace std;

int query(string str);

string guess(int n, int s) {
    string pw = "";
    vector<bool> used(s, false);
    
    for (int i = 0; i < n; i++) {
        for (int c = 0; c < s; c++) {
            if (used[c]) continue;
            char ch = 'a' + c;
            // pw + ch query хийхэд i+1 буцаавал ch нь i-р тэмдэгт
            string t = pw + ch;
            if ((int)query(t) >= i + 1) {
                pw += ch;
                used[c] = true;
                break;
            }
        }
    }
    
    return pw;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...