Submission #692234

#TimeUsernameProblemLanguageResultExecution timeMemory
692234maks007Combo (IOI18_combo)C++14
5 / 100
1 ms296 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 < alph.size(); i ++) {
		str += alph[i];
		if(press(str) == 1) break;
		str.pop_back();
	}
	for(int i = 0; i < alph.size(); i ++) {
		str += alph[i];
		if(press(str) == 2) break;
		str.pop_back();
	}
	for(int i = 0; i < alph.size(); i ++) {
		str += alph[i];
		if(press(str) == 3) break;
		str.pop_back();
	}
//	cout << str << " ";
	return str;
}

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:10:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   10 |  for(int i = 0; i < alph.size(); i ++) {
      |                 ~~^~~~~~~~~~~~~
combo.cpp:15:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   15 |  for(int i = 0; i < alph.size(); i ++) {
      |                 ~~^~~~~~~~~~~~~
combo.cpp:20:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   20 |  for(int i = 0; i < alph.size(); i ++) {
      |                 ~~^~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...