Submission #663626

# Submission time Handle Problem Language Result Execution time Memory
663626 2022-11-27T03:26:21 Z Nursik Password (RMI18_password) C++14
30 / 100
372 ms 208 KB
#include <stdio.h>
 
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>

using namespace std;

#define ll long long
#define pb push_back


int query(string str);
string guess(int n, int s){
    string ans = "";
    int cur = 0;
    for (int i = 1; i <= n; ++i){
        string q = ans;
        for (int j = 0; j <= (int)q.size(); ++j){
            string q2 = "";
            int ok = 0;
            for (int k = 0; k < s; ++k){
                q2 = "";
                char ch = 'a';
                ch += k;
                for (int nx = 0; nx < j; ++nx){
                    q2 += q[nx];
                }
                q2 += ch;
                for (int nx = j; nx < (int)q.size(); ++nx){
                    q2 += q[nx];
                }
                int kek = query(q2);
                if (kek > cur){
                    ans = q2;
                    ok = 1;
                    break;
                }
            }
            if (ok)
                break;
        }
        cur += 1;
    }
    return ans;
}
# Verdict Execution time Memory Grader output
1 Correct 16 ms 208 KB Guessed the password with 1440 queries.
2 Correct 50 ms 208 KB Guessed the password with 5244 queries.
# Verdict Execution time Memory Grader output
1 Correct 10 ms 208 KB Guessed the password with 922 queries.
2 Correct 19 ms 208 KB Guessed the password with 2328 queries.
3 Correct 8 ms 208 KB Guessed the password with 776 queries.
4 Correct 153 ms 208 KB Guessed the password with 16740 queries.
# Verdict Execution time Memory Grader output
1 Incorrect 372 ms 208 KB Could not guess the password with 50000 queries.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 16 ms 208 KB Guessed the password with 1440 queries.
2 Correct 50 ms 208 KB Guessed the password with 5244 queries.
3 Correct 10 ms 208 KB Guessed the password with 922 queries.
4 Correct 19 ms 208 KB Guessed the password with 2328 queries.
5 Correct 8 ms 208 KB Guessed the password with 776 queries.
6 Correct 153 ms 208 KB Guessed the password with 16740 queries.
7 Incorrect 372 ms 208 KB Could not guess the password with 50000 queries.
8 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 16 ms 208 KB Guessed the password with 1440 queries.
2 Correct 50 ms 208 KB Guessed the password with 5244 queries.
3 Correct 10 ms 208 KB Guessed the password with 922 queries.
4 Correct 19 ms 208 KB Guessed the password with 2328 queries.
5 Correct 8 ms 208 KB Guessed the password with 776 queries.
6 Correct 153 ms 208 KB Guessed the password with 16740 queries.
7 Incorrect 372 ms 208 KB Could not guess the password with 50000 queries.
8 Halted 0 ms 0 KB -