Submission #92959

#TimeUsernameProblemLanguageResultExecution timeMemory
92959temoyanteladzeCombo (IOI18_combo)C++14
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> #include "combo.h" using namespace std; string guess_sequence(int n) { string s; if (n==1){ if (press('A')) s+='A'; if (press('B')) S+='B'; if (press('X')) s+='X'; if (press('Y')) S+='Y'; } return s; } return 0;}

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:9:19: error: could not convert ''A'' from 'char' to 'std::string' {aka 'std::__cxx11::basic_string<char>'}
    9 |         if (press('A'))
      |                   ^~~
      |                   |
      |                   char
combo.cpp:11:19: error: could not convert ''B'' from 'char' to 'std::string' {aka 'std::__cxx11::basic_string<char>'}
   11 |         if (press('B'))
      |                   ^~~
      |                   |
      |                   char
combo.cpp:12:13: error: 'S' was not declared in this scope
   12 |             S+='B';
      |             ^
combo.cpp:13:20: error: could not convert ''X'' from 'char' to 'std::string' {aka 'std::__cxx11::basic_string<char>'}
   13 |          if (press('X'))
      |                    ^~~
      |                    |
      |                    char
combo.cpp:15:19: error: could not convert ''Y'' from 'char' to 'std::string' {aka 'std::__cxx11::basic_string<char>'}
   15 |         if (press('Y'))
      |                   ^~~
      |                   |
      |                   char
combo.cpp:16:13: error: 'S' was not declared in this scope
   16 |             S+='Y';
      |             ^
combo.cpp: At global scope:
combo.cpp:21:1: error: expected unqualified-id before 'return'
   21 | return 0;}
      | ^~~~~~
combo.cpp:21:10: error: expected declaration before '}' token
   21 | return 0;}
      |          ^