Submission #867700

# Submission time Handle Problem Language Result Execution time Memory
867700 2023-10-29T08:58:49 Z franfill Password (RMI18_password) C++17
0 / 100
1 ms 436 KB
#include<bits/stdc++.h>
using namespace std;

int query(string S);

string cur = "";
int N, S;

int solve(int i, char c)
{
	if ((size_t)(i) > cur.size())
		return 0;
	if (c > 'z' || ((int)cur.size()) == N)
		return 0;
	string tr = "";
	if (i != 0)
		tr += cur.substr(0, i);
	tr += c;
	if (i != (int)cur.size())
		tr += cur.substr(i, ((int)cur.size())-i);
	if (query(tr) == (int)tr.size())
	{
		int ans = 1;
		cur = tr;
		ans += solve(i, c);
		ans += solve(i+ans, c+1);
		return ans;
	}
	else
		return solve(i, c+1);
}

string guess(int N, int S)
{	
	::N = N;
	::S = S;
	cur = "";
	solve(0, 'a');
	return cur;
}
# Verdict Execution time Memory Grader output
1 Runtime error 0 ms 436 KB Execution killed with signal 13
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 0 ms 436 KB Execution killed with signal 13
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 432 KB Execution killed with signal 13
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 0 ms 436 KB Execution killed with signal 13
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 0 ms 436 KB Execution killed with signal 13
2 Halted 0 ms 0 KB -