Submission #692247

#TimeUsernameProblemLanguageResultExecution timeMemory
692247maks007Combo (IOI18_combo)C++14
10 / 100
66 ms552 KiB
#include "combo.h"
#include "bits/stdc++.h"

using namespace std;

string alph = "ABXY";

std::string guess_sequence(int N) {
	string str;
	for(int i = 0; i < 4; i ++) {
		str += alph[i];
		if(press(str) == 1) break;
		str.pop_back();
	}
	while(str.size() != N) {
		for(int i = 0; i < 4; i ++) {
			if(alph[i] == str[0]) continue;
			str += alph[i];
			if(press(str) == str.size()) break;
			str.pop_back();		
		}
	}
	return str;
}

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:15:19: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   15 |  while(str.size() != N) {
      |        ~~~~~~~~~~~^~~~
combo.cpp:19:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   19 |    if(press(str) == str.size()) break;
      |       ~~~~~~~~~~~^~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...