Submission #1215116

#TimeUsernameProblemLanguageResultExecution timeMemory
1215116nataliaaCombo (IOI18_combo)C++20
Compilation error
0 ms0 KiB
#include "combo.h"
using namespace std;
string guess_sequence(int N) {
	string p = "";
	string c[4] = {"A", "B", "X", "Y"};
	for(int j = 0; j < 3; j++) {
		for(int i = 0; i < 4; i++) {
			int ok = press(c[i][0]);
			if(ok) {
				p+=c[i];
				break;
			}
		}
	}
	

	return p;
}

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:8:39: error: could not convert 'c[i].std::__cxx11::basic_string<char>::operator[](0)' from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'std::string' {aka 'std::__cxx11::basic_string<char>'}
    8 |                         int ok = press(c[i][0]);
      |                                  ~~~~~^~~~~~~~~
      |                                       |
      |                                       __gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type {aka char}