Submission #634889

# Submission time Handle Problem Language Result Execution time Memory
634889 2022-08-25T08:12:44 Z danikoynov Password (RMI18_password) C++14
Compilation error
0 ms 0 KB
#include<bits/stdc++.h>
#include "password.h"
using namespace std;

const int maxs = 26;
int N, S, used[maxs];

string guess(int n, int s)
{
    N = n;
    S = s;
    string ans = "";
    for (int i = 0; i < s; i ++)
    {
        string cur = "";
        for (int j = 0; j < n; j ++)
            cur = cur + (char)(i + 'a');

        if (query(cur) == 1)
            ans = ans + (char)(i + 'a'), used[i] = 1;
    }

    int len = query(ans);
    for (int j = 0; j < s; j ++)
    {
        if (!used[j])
            continue;
        int id = 0;
        string wt = "";
        for (int i = 0; i < n; i ++)
        {
            if (ans[i] != (char)(j + 'a'))
                wt = wt + ans[i];
        }

        for (int i = 0; i < n; i ++)
        {
            string cur = wt;
            cur.insert(cur.begin() + i, (char)(j + 'a'));
            int sm = query(cur);
            if (sm > len)
            {
                len = sm;
                ans = cur;
            }
        }

    }
    return ans;

}

Compilation message

password.cpp:2:10: fatal error: password.h: No such file or directory
    2 | #include "password.h"
      |          ^~~~~~~~~~~~
compilation terminated.