Submission #1023305

#TimeUsernameProblemLanguageResultExecution timeMemory
1023305vaneaCombo (IOI18_combo)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include "combo.h" using namespace std; using ll = long long; string guess_sequence(int n) { vector<string> pos = {"A", "B", "X", "Y"}; string ans = ""; int last = 0; for(auto it : pos) { if(press(to_string(ans+it)) > last) { ans += it; ++last; continue; } } return ans; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:11:34: error: no matching function for call to 'to_string(std::__cxx11::basic_string<char>)'
   11 |         if(press(to_string(ans+it)) > last) {
      |                                  ^
In file included from /usr/include/c++/10/string:55,
                 from /usr/include/c++/10/bits/locale_classes.h:40,
                 from /usr/include/c++/10/bits/ios_base.h:41,
                 from /usr/include/c++/10/ios:42,
                 from /usr/include/c++/10/istream:38,
                 from /usr/include/c++/10/sstream:38,
                 from /usr/include/c++/10/complex:45,
                 from /usr/include/c++/10/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54,
                 from combo.cpp:1:
/usr/include/c++/10/bits/basic_string.h:6587:3: note: candidate: 'std::string std::__cxx11::to_string(int)'
 6587 |   to_string(int __val)
      |   ^~~~~~~~~
/usr/include/c++/10/bits/basic_string.h:6587:17: note:   no known conversion for argument 1 from 'std::__cxx11::basic_string<char>' to 'int'
 6587 |   to_string(int __val)
      |             ~~~~^~~~~
/usr/include/c++/10/bits/basic_string.h:6598:3: note: candidate: 'std::string std::__cxx11::to_string(unsigned int)'
 6598 |   to_string(unsigned __val)
      |   ^~~~~~~~~
/usr/include/c++/10/bits/basic_string.h:6598:22: note:   no known conversion for argument 1 from 'std::__cxx11::basic_string<char>' to 'unsigned int'
 6598 |   to_string(unsigned __val)
      |             ~~~~~~~~~^~~~~
/usr/include/c++/10/bits/basic_string.h:6606:3: note: candidate: 'std::string std::__cxx11::to_string(long int)'
 6606 |   to_string(long __val)
      |   ^~~~~~~~~
/usr/include/c++/10/bits/basic_string.h:6606:18: note:   no known conversion for argument 1 from 'std::__cxx11::basic_string<char>' to 'long int'
 6606 |   to_string(long __val)
      |             ~~~~~^~~~~
/usr/include/c++/10/bits/basic_string.h:6617:3: note: candidate: 'std::string std::__cxx11::to_string(long unsigned int)'
 6617 |   to_string(unsigned long __val)
      |   ^~~~~~~~~
/usr/include/c++/10/bits/basic_string.h:6617:27: note:   no known conversion for argument 1 from 'std::__cxx11::basic_string<char>' to 'long unsigned int'
 6617 |   to_string(unsigned long __val)
      |             ~~~~~~~~~~~~~~^~~~~
/usr/include/c++/10/bits/basic_string.h:6625:3: note: candidate: 'std::string std::__cxx11::to_string(long long int)'
 6625 |   to_string(long long __val)
      |   ^~~~~~~~~
/usr/include/c++/10/bits/basic_string.h:6625:23: note:   no known conversion for argument 1 from 'std::__cxx11::basic_string<char>' to 'long long int'
 6625 |   to_string(long long __val)
      |             ~~~~~~~~~~^~~~~
/usr/include/c++/10/bits/basic_string.h:6637:3: note: candidate: 'std::string std::__cxx11::to_string(long long unsigned int)'
 6637 |   to_string(unsigned long long __val)
      |   ^~~~~~~~~
/usr/include/c++/10/bits/basic_string.h:6637:32: note:   no known conversion for argument 1 from 'std::__cxx11::basic_string<char>' to 'long long unsigned int'
 6637 |   to_string(unsigned long long __val)
      |             ~~~~~~~~~~~~~~~~~~~^~~~~
/usr/include/c++/10/bits/basic_string.h:6648:3: note: candidate: 'std::string std::__cxx11::to_string(float)'
 6648 |   to_string(float __val)
      |   ^~~~~~~~~
/usr/include/c++/10/bits/basic_string.h:6648:19: note:   no known conversion for argument 1 from 'std::__cxx11::basic_string<char>' to 'float'
 6648 |   to_string(float __val)
      |             ~~~~~~^~~~~
/usr/include/c++/10/bits/basic_string.h:6657:3: note: candidate: 'std::string std::__cxx11::to_string(double)'
 6657 |   to_string(double __val)
      |   ^~~~~~~~~
/usr/include/c++/10/bits/basic_string.h:6657:20: note:   no known conversion for argument 1 from 'std::__cxx11::basic_string<char>' to 'double'
 6657 |   to_string(double __val)
      |             ~~~~~~~^~~~~
/usr/include/c++/10/bits/basic_string.h:6666:3: note: candidate: 'std::string std::__cxx11::to_string(long double)'
 6666 |   to_string(long double __val)
      |   ^~~~~~~~~
/usr/include/c++/10/bits/basic_string.h:6666:25: note:   no known conversion for argument 1 from 'std::__cxx11::basic_string<char>' to 'long double'
 6666 |   to_string(long double __val)
      |             ~~~~~~~~~~~~^~~~~