Submission #476068

# Submission time Handle Problem Language Result Execution time Memory
476068 2021-09-24T17:17:15 Z stefantaga Password (RMI18_password) C++14
0 / 100
541 ms 200 KB
#include <bits/stdc++.h>

using namespace std;

int query(string str);
string sol,acum;
int n,s;
void back1(int k)
{
    if (sol.size()!=0)
    {
        return;
    }
    if (k>n)
    {
        sol=acum;
        return;
    }
    else
    {
        for (int i=1;i<=s;i++)
        {
            char litera=(char)(i+96);
            acum.push_back(litera);
            if (query(acum)==k)
            {
                back1(k+1);
            }
            acum.pop_back();
        }
    }
}
string guess (int N,int S)
{
    n=N;s=S;
    back1(1);
    return sol;
}
# Verdict Execution time Memory Grader output
1 Incorrect 541 ms 200 KB Could not guess the password with 50000 queries.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 427 ms 200 KB Could not guess the password with 50000 queries.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 279 ms 200 KB Could not guess the password with 50000 queries.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 541 ms 200 KB Could not guess the password with 50000 queries.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 541 ms 200 KB Could not guess the password with 50000 queries.
2 Halted 0 ms 0 KB -