# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
918572 | Elvin_Fritl | Password (RMI18_password) | C++17 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
#include "grader.h"
#define ll long long
const int N=2e3+5, mod=1e9+7;
mt19937 rng(time(NULL));
string guess(int n, int s) {
vector<char> v(s);
for(int i=0;i<s;i++) {
v[i] = char('a' + i);
}
shuffle(v.begin() , v.end() , rng);
string res;
for(int i=0;i<n;i++) {
for(int j=0;j<s;j++) {
int tmp = query(to_string(res + v[j]));
if(tmp == i + 1) {
res += v[j];
break;
}
}
}
return res;
}