Submission #312133

#TimeUsernameProblemLanguageResultExecution timeMemory
312133blue콤보 (IOI18_combo)C++11
Compilation error
0 ms0 KiB
#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 (stderr)

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 | }
      | ^