# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1117386 | somefolk | Password (RMI18_password) | C++14 | 1047 ms | 964 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 <iostream>
#include <cmath>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <unordered_map>
#include <queue>
#include <set>
#include <unordered_set>
#include <complex>
#include <list>
#include <chrono>
#include <random>
#include <stack>
#include <iomanip>
#include <fstream>
using namespace std;
#define endl "\n"
// #define int long long
const int INF = 2 * 1e5 + 5;
const int MOD = 1e9 + 7;
int query(string s);
string guess(int n, int s){
map<char, int> a;
for(char i = 0; i < s; i++){
string s1 = string(n, i+'a');
a[i+'a'] = query(s1);
}
string sol = "";
for(int i = 0; i < n; i++){
char prev;
for(auto &j : a){
if(j.second != 0){
prev = j.first;
break;
}
}
for(auto &j : a){
if(prev == j.first || j.second == 0) continue;
if(query(sol + j.first + string(a[prev], prev)) == sol.size() + a[prev] + 1){
prev = j.first;
}
}
a[prev]--;
sol+=prev;
}
return sol;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |