Submission #312133

# Submission time Handle Problem Language Result Execution time Memory
312133 2020-10-12T12:31:23 Z blue Combo (IOI18_combo) C++11
Compilation error
0 ms 0 KB
#include "combo.h"
#include <string>
using namespace std;

string guess_sequence(int N)
{
    for(string A:{"A", "B", "X", "Y"})
    {
        for(string B:{"A", "B", "X", "Y"})
        {
            if(A == B) continue;
            for(string C:"A", "B", "X", "Y")
            {
                if(A == C) continue;
                if(press(A+B+C) == 3) return A+B+C;
            }
        }
    }
}

Compilation message

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:12:26: warning: left operand of comma operator has no effect [-Wunused-value]
   12 |             for(string C:"A", "B", "X", "Y")
      |                          ^~~
combo.cpp:12:36: warning: right operand of comma operator has no effect [-Wunused-value]
   12 |             for(string C:"A", "B", "X", "Y")
      |                                    ^~~
combo.cpp:12:41: warning: right operand of comma operator has no effect [-Wunused-value]
   12 |             for(string C:"A", "B", "X", "Y")
      |                                         ^~~
combo.cpp:12:41: error: conversion from 'const char' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
combo.cpp:19:1: warning: control reaches end of non-void function [-Wreturn-type]
   19 | }
      | ^