Submission #433911

# Submission time Handle Problem Language Result Execution time Memory
433911 2021-06-20T12:09:48 Z AmineTrabelsi Password (RMI18_password) C++14
30 / 100
470 ms 276 KB
#include "bits/stdc++.h"
using namespace std;
// Hi 
int query(string s);

string guess(int n,int s){
    string res = "";
    for(int i=0;i<n;i++){
        bool found = 0;
        for(int c=0;c<s;c++){
            char ch = 'a'+c;
            //cout << i<<" first "<<ch+res<<'\n';
            int pref = query((ch+res));
            if(pref == i+1){
                res = ch+res;
                found = 1;
                break;
            }
        }
        if(found)continue;
        for(int ind=0;ind<i;ind++){
            for(int c=0;c<s;c++){
                char ch = 'a'+c;
                string temp = res.substr(0,ind+1)+ch+res.substr(ind+1,n-ind-1);
                //cout << i<<" "<<ind<<" "<<temp <<'\n';
                int pref = query((temp));
                if(pref == i+1){
                    res = temp;
                    found = 1;
                    break;
                }
            }
            if(found)break;
        }
    }
    return res;
}
# Verdict Execution time Memory Grader output
1 Correct 20 ms 200 KB Guessed the password with 1440 queries.
2 Correct 61 ms 200 KB Guessed the password with 5244 queries.
# Verdict Execution time Memory Grader output
1 Correct 11 ms 200 KB Guessed the password with 922 queries.
2 Correct 28 ms 200 KB Guessed the password with 2328 queries.
3 Correct 9 ms 200 KB Guessed the password with 776 queries.
4 Correct 144 ms 268 KB Guessed the password with 16740 queries.
# Verdict Execution time Memory Grader output
1 Incorrect 470 ms 276 KB Could not guess the password with 50000 queries.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 20 ms 200 KB Guessed the password with 1440 queries.
2 Correct 61 ms 200 KB Guessed the password with 5244 queries.
3 Correct 11 ms 200 KB Guessed the password with 922 queries.
4 Correct 28 ms 200 KB Guessed the password with 2328 queries.
5 Correct 9 ms 200 KB Guessed the password with 776 queries.
6 Correct 144 ms 268 KB Guessed the password with 16740 queries.
7 Incorrect 470 ms 276 KB Could not guess the password with 50000 queries.
8 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 20 ms 200 KB Guessed the password with 1440 queries.
2 Correct 61 ms 200 KB Guessed the password with 5244 queries.
3 Correct 11 ms 200 KB Guessed the password with 922 queries.
4 Correct 28 ms 200 KB Guessed the password with 2328 queries.
5 Correct 9 ms 200 KB Guessed the password with 776 queries.
6 Correct 144 ms 268 KB Guessed the password with 16740 queries.
7 Incorrect 470 ms 276 KB Could not guess the password with 50000 queries.
8 Halted 0 ms 0 KB -