Submission #154304

#TimeUsernameProblemLanguageResultExecution timeMemory
154304andreiomdCombo (IOI18_combo)C++17
Compilation error
0 ms0 KiB
#include "combo.h"
#include <bits/stdc++.h>

using namespace std;

char V[5] = {'A', 'B', 'X', 'Y'};

string guess_sequence (int N)
{
    if(N == 3)
    {
        for(int i = 0; i < 4; ++i)
            for(int j = 0; j < 4; ++j)
                for(int k = 0; k < 4; ++k)
                {
                    string ans;

                    ans.push_back(V[i]);
                    ans.push_back(V[j]);
                    ans.push_back(V[k]);

                    if(press(ans) == N)
                        return ans;
                }
    }
    else
    {
        while(1)
        {
            ++V[0];
        }
    }

    return 'A';
}

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:34:12: error: could not convert ''A'' from 'char' to 'std::string' {aka 'std::__cxx11::basic_string<char>'}
   34 |     return 'A';
      |            ^~~
      |            |
      |            char