Submission #918595

# Submission time Handle Problem Language Result Execution time Memory
918595 2024-01-30T07:18:45 Z Elvin_Fritl Password (RMI18_password) C++17
0 / 100
40 ms 436 KB
#include <bits/stdc++.h>
using namespace std;

#define ll long long
 
const int N=2e3+5, mod=1e9+7;

int query(string str);

mt19937 rng(time(NULL));
 
string guess(int n, int s) {
    vector<char> v;
    for(int i=0;i<s - 1;i++) {
        v.push_back(char('a' + i + 1));
    }
    shuffle(v.begin() , v.end() , rng);
    string res;
    for(int i=0;i<n;i++) {
        res = res + 'a';
    }
    int tr = query(res);
    for(int i=0;i<n;i++) {
        for(int j=0;j<s - 1;j++) {
            res[i] = v[j];
            int tmp = query(res);
            if(tmp == tr + 1) {
                tr++;
                break;
            }
            else if(j == s - 2) {
                res[i] = 'a';
                break;
            }
        }
    }
    return res;
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Returned early from guess() after 165 queries.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 436 KB Execution killed with signal 13
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 40 ms 344 KB Returned early from guess() after 9852 queries.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Returned early from guess() after 165 queries.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Returned early from guess() after 165 queries.
2 Halted 0 ms 0 KB -