Submission #760749

#TimeUsernameProblemLanguageResultExecution timeMemory
760749NonozeCombo (IOI18_combo)C++17
5 / 100
1 ms256 KiB
#include "combo.h"
#include <bits/stdc++.h>

using namespace std;

int n;

string bruteforce(string act) {
	if (act.size()==n)
	{
		if (press(act)==n) return act;
		return "*";
	}
	string a=bruteforce(act+"A");
	if (a!="*") return a;
	string b=bruteforce(act+"B");
	if (b!="*") return b;
	string x=bruteforce(act+"X");
	if (x!="*") return x;
	string y=bruteforce(act+"Y");
	if (y!="*") return y;
	return "*";
}

string guess_sequence(int temp) {
	n=temp;
	return bruteforce("");
}

Compilation message (stderr)

combo.cpp: In function 'std::string bruteforce(std::string)':
combo.cpp:9:16: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
    9 |  if (act.size()==n)
      |      ~~~~~~~~~~^~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...