# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
385837 | ismoilov | 콤보 (IOI18_combo) | C++14 | 컴파일 에러 | 0 ms | 0 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "combo.h"
#include<bits/stdc++.h>
using namespace std;
string guess_sequence(int n) {
string s, c = "ABXY", f, x;
f = press("AB");
if(f > 0)
{
x = press("A");
if(x > 0)
s = "A";
else
s = "B";
}
else
{
x = press("X");
if(x > 0)
s = "X";
else
s = "Y";
}
f = 1;
c.erase(c.find(s), 1)
for(int i = 1; i < n-1; i ++)
{
//cout << f << " " << s << " // ";
string v = s + c[1] + s + c[0] + c[0] + s + c[0] + c[1] + s + c[0] + c[2];
x = press(v);
if(x == f)
{
s += c[2];
f = x + 1;
continue;
}
if(x - f == 1)
{
s += c[1];
f = x;
continue;
}
s += c[0];
f = x-1;
}
x = press(s + c[0]);
if(x == n)
return s+c[0];
x = press(s + c[1]);
if(x == n)
return s+c[1];
return s+c[2];
}
컴파일 시 표준 에러 (stderr) 메시지
combo.cpp: In function 'std::string guess_sequence(int)': combo.cpp:8:7: error: no match for 'operator>' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int') 8 | if(f > 0) | ~ ^ ~ | | | | | int | std::string {aka std::__cxx11::basic_string<char>} In file included from /usr/include/c++/10/regex:62, from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:110, from combo.cpp:2: /usr/include/c++/10/bits/regex.h:1108:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator>(const std::__cxx11::sub_match<_BiIter>&, const std::__cxx11::sub_match<_BiIter>&)' 1108 | operator>(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs) | ^~~~~~~~ /usr/include/c++/10/bits/regex.h:1108:5: note: template argument deduction/substitution failed: combo.cpp:8:9: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 8 | if(f > 0) | ^ In file included from /usr/include/c++/10/regex:62, from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:110, from combo.cpp:2: /usr/include/c++/10/bits/regex.h:1168:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator>(std::__cxx11::__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&, const std::__cxx11::sub_match<_BiIter>&)' 1168 | operator>(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/10/bits/regex.h:1168:5: note: template argument deduction/substitution failed: combo.cpp:8:9: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int' 8 | if(f > 0) | ^ In file included from /usr/include/c++/10/regex:62, from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:110, from combo.cpp:2: /usr/include/c++/10/bits/regex.h:1261:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator>(const std::__cxx11::sub_match<_BiIter>&, std::__cxx11::__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&)' 1261 | operator>(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/10/bits/regex.h:1261:5: note: template argument deduction/substitution failed: combo.cpp:8:9: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 8 | if(f > 0) | ^ In file included from /usr/include/c++/10/regex:62, from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:110, from combo.cpp:2: /usr/include/c++/10/bits/regex.h:1335:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator>(const typename std::iterator_traits<_Iter>::value_type*, const std::__cxx11::sub_match<_BiIter>&)' 1335 | operator>(typename iterator_traits<_Bi_iter>::value_type const* __lhs, | ^~~~~~~~ /usr/include/c++/10/bits/regex.h:1335:5: note: template argument deduction/substitution failed: combo.cpp:8:9: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int' 8 | if(f > 0) | ^ In file included from /usr/include/c++/10/regex:62, from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:110, from combo.cpp:2: /usr/include/c++/10/bits/regex.h:1429:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator>(const std::__cxx11::sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)' 1429 | operator>(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/10/bits/regex.h:1429:5: note: template argument deduction/substitution failed: combo.cpp:8:9: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 8 | if(f > 0) | ^ In file included from /usr/include/c++/10/regex:62, from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:110, from combo.cpp:2: /usr/include/c++/10/bits/regex.h:1505:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator>(const typename std::iterator_traits<_Iter>::value_type&, const std::__cxx11::sub_match<_BiIter>&)' 1505 | operator>(typename iterator_traits<_Bi_iter>::value_type const& __lhs, | ^~~~~~~~ /usr/include/c++/10/bits/regex.h:1505:5: note: template argument deduction/substitution failed: combo.cpp:8:9: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int' 8 | if(f > 0) | ^ In file included from /usr/include/c++/10/regex:62, from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:110, from combo.cpp:2: /usr/include/c++/10/bits/regex.h:1605:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator>(const std::__cxx11::sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)' 1605 | operator>(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/10/bits/regex.h:1605:5: note: template argument deduction/substitution failed: combo.cpp:8:9: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 8 | if(f > 0) | ^ In file included from /usr/include/c++/10/bits/stl_algobase.h:64, from /usr/include/c++/10/bits/char_traits.h:39, from /usr/include/c++/10/string:40, from combo.h:3, from combo.cpp:1: /usr/include/c++/10/bits/stl_pair.h:502:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator>(const std::pair<_T1, _T2>&, const std::pair<_T1, _T2>&)' 502 | operator>(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/10/bits/stl_pair.h:502:5: note: template argument deduction/substitution failed: combo.cpp:8:9: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::pair<_T1, _T2>' 8 | if(f > 0) | ^ In file included from /usr/include/c++/10/bits/stl_algobase.h:67, from /usr/include/c++/10/bits/char_traits.h:39, from /usr/include/c++/10/string:40, from combo.h:3, from combo.cpp:1: /usr/include/c++/10/bits/stl_iterator.h:378:5: note: candidate: 'template<class _Iterator> bool std::operator>(const std::reverse_iterator<_Iterator>&, const std::reverse_iterator<_Iterator>&)' 378 | operator>(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/10/bits/stl_iterator.h:378:5: note: template argument deduction/substitution failed: combo.cpp:8:9: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 8 | if(f > 0) | ^ In file included from /usr/include/c++/10/bits/stl_algobase.h:67, from /usr/include/c++/10/bits/char_traits.h:39, from /usr/include/c++/10/string:40, from combo.h:3, from combo.cpp:1: /usr/include/c++/10/bits/stl_iterator.h:416:5: note: candidate: 'template<class _IteratorL, class _IteratorR> bool std::operator>(const std::reverse_iterator<_Iterator>&, const std::reverse_iterator<_IteratorR>&)' 416 | operator>(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/10/bits/stl_iterator.h:416:5: note: template argument deduction/substitution failed: combo.cpp:8:9: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 8 | if(f > 0) | ^ In file included from /usr/include/c++/10/bits/stl_algobase.h:67, from /usr/include/c++/10/bits/char_traits.h:39, from /usr/include/c++/10/string:40, from combo.h:3, from combo.cpp:1: /usr/include/c++/10/bits/stl_iterator.h:1469:5: note: candidate: 'template<class _IteratorL, class _IteratorR> bool std::operator>(const std::move_iterator<_IteratorL>&, const std::move_iterator<_IteratorR>&)' 1469 | operator>(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/10/bits/stl_iterator.h:1469:5: note: template argument deduction/substitution failed: combo.cpp:8:9: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 8 | if(f > 0) | ^ In file included from /usr/include/c++/10/bits/stl_algobase.h:67, from /usr/include/c++/10/bits/char_traits.h:39, from /usr/include/c++/10/string:40, from combo.h:3, from combo.cpp:1: /usr/include/c++/10/bits/stl_iterator.h:1519:5: note: candidate: 'template<class _Iterator> bool std::operator>(const std::move_iterator<_IteratorL>&, const std::move_iterator<_IteratorL>&)' 1519 | operator>(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/10/bits/stl_iterator.h:1519:5: note: template argument deduction/substitution failed: combo.cpp:8:9: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 8 | if(f > 0) | ^ In file included from /usr/include/c++/10/string:55, from combo.h:3, from combo.cpp:1: /usr/include/c++/10/bits/basic_string.h:6305:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator>(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&)' 6305 | operator>(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/10/bits/basic_string.h:6305:5: note: template argument deduction/substitution failed: combo.cpp:8:9: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>' and 'int' 8 | if(f > 0) | ^ In file included from /usr/include/c++/10/string:55, from combo.h:3, from combo.cpp:1: /usr/include/c++/10/bits/basic_string.h:6318:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator>(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, const _CharT*)' 6318 | operator>(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/10/bits/basic_string.h:6318:5: note: template argument deduction/substitution failed: combo.cpp:8:9: note: mismatched types 'const _CharT*' and 'int' 8 | if(f > 0) | ^ In file included from /usr/include/c++/10/string:55, from combo.h:3, from combo.cpp:1: /usr/include/c++/10/bits/basic_string.h:6330:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator>(const _CharT*, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&)' 6330 | operator>(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/10/bits/basic_string.h:6330:5: note: template argument deduction/substitution failed: combo.cpp:8:9: note: mismatched types 'const _CharT*' and 'std::__cxx11::basic_string<char>' 8 | if(f > 0) | ^ In file included from /usr/include/c++/10/deque:67, from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:68, from combo.cpp:2: /usr/include/c++/10/bits/stl_deque.h:2292:5: note: candidate: 'template<class _Tp, class _Alloc> bool std::operator>(const std::deque<_Tp, _Alloc>&, const std::deque<_Tp, _Alloc>&)' 2292 | operator>(const deque<_Tp, _Alloc>& __x, const deque<_Tp, _Alloc>& __y) | ^~~~~~~~ /usr/include/c++/10/bits/stl_deque.h:2292:5: note: template argument deduction/substitution failed: combo.cpp:8:9: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::deque<_Tp, _Alloc>' 8 | if(f > 0) | ^ In file included from /usr/include/c++/10/tuple:39, from /usr/include/c++/10/functional:54, from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:71, from combo.cpp:2: /usr/include/c++/10/array:293:5: note: candidate: 'template<class _Tp, long unsigned int _Nm> bool std::operator>(const std::array<_Tp, _Nm>&, const std::array<_Tp, _Nm>&)' 293 | operator>(const array<_Tp, _Nm>& __one, const array<_Tp, _Nm>& __two) | ^~~~~~~~ /usr/include/c++/10/array:293:5: note: template argument deduction/substitution failed: combo.cpp:8:9: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::array<_Tp, _Nm>' 8 | if(f > 0) | ^ In file included from /usr/include/c++/10/functional:54, from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:71, from combo.cpp:2: /usr/include/c++/10/tuple:1454:5: note: candidate: 'template<class ... _TElements, class ... _UElements> constexpr bool std::operator>(const std::tuple<_Tps ...>&, const std::tuple<_Elements ...>&)' 1454 | operator>(const tuple<_TElements...>& __t, | ^~~~~~~~ /usr/include/c++/10/tuple:1454:5: note: template argument deduction/substitution failed: combo.cpp:8:9: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::tuple<_Tps ...>' 8 | if(f > 0) | ^ In file included from /usr/include/c++/10/bits/locale_conv.h:41, from /usr/include/c++/10/locale:43, from /usr/include/c++/10/iomanip:43, from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:72, from combo.cpp:2: /usr/include/c++/10/bits/unique_ptr.h:846:5: note: candidate: 'template<class _Tp, class _Dp, class _Up, class _Ep> bool std::operator>(const std::unique_ptr<_Tp, _Dp>&, const std::unique_ptr<_Up, _Ep>&)' 846 | operator>(const unique_ptr<_Tp, _Dp>& __x, | ^~~~~~~~ /usr/include/c++/10/bits/unique_ptr.h:846:5: note: template argument deduction/substitution failed: combo.cpp:8:9: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::unique_ptr<_Tp, _Dp>' 8 | if(f > 0) | ^ In file included from /usr/include/c++/10/bits/locale_conv.h:41, from /usr/include/c++/10/locale:43, from /usr/include/c++/10/iomanip:43, from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:72, from combo.cpp:2: /usr/include/c++/10/bits/unique_ptr.h:853:5: note: candidate: 'template<class _Tp, class _Dp> bool std::operator>(const std::unique_ptr<_Tp, _Dp>&, std::nullptr_t)' 853 | operator>(const unique_ptr<_Tp, _Dp>& __x, nullptr_t) | ^~~~~~~~ /usr/include/c++/10/bits/unique_ptr.h:853:5: note: template argument deduction/substitution failed: combo.cpp:8:9: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::unique_ptr<_Tp, _Dp>' 8 | if(f > 0) | ^ In file included from /usr/include/c++/10/bits/locale_conv.h:41, from /usr/include/c++/10/locale:43, from /usr/include/c++/10/iomanip:43, from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:72, from combo.cpp:2: /usr/include/c++/10/bits/unique_ptr.h:862:5: note: candidate: 'template<class _Tp, class _Dp> bool std::operator>(std::nullptr_t, const std::unique_ptr<_Tp, _Dp>&)' 862 | operator>(nullptr_t, const unique_ptr<_Tp, _Dp>& __x) | ^~~~~~~~ /usr/include/c++/10/bits/unique_ptr.h:862:5: note: template argument deduction/substitution failed: combo.cpp:8:9: note: mismatched types 'const std::unique_ptr<_Tp, _Dp>' and 'int' 8 | if(f > 0) | ^ In file included from /usr/include/c++/10/list:63, from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:79, from combo.cpp:2: /usr/include/c++/10/bits/stl_list.h:2063:5: note: candidate: 'template<class _Tp, class _Alloc> bool std::operator>(const std::__cxx11::list<_Tp, _Alloc>&, const std::__cxx11::list<_Tp, _Alloc>&)' 2063 | operator>(const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y) | ^~~~~~~~ /usr/include/c++/10/bits/stl_list.h:2063:5: note: template argument deduction/substitution failed: combo.cpp:8:9: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::list<_Tp, _Alloc>' 8 | if(f > 0) | ^ In file included from /usr/include/c++/10/map:61, from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:81, from combo.cpp:2: /usr/include/c++/10/bits/stl_map.h:1515:5: note: candidate: 'template<class _Key, class _Tp, class _Compare, class _Alloc> bool std::operator>(const std::map<_Key, _Tp, _Compare, _Alloc>&, const std::map<_Key, _Tp, _Compare, _Alloc>&)' 1515 | operator>(const map<_Key, _Tp, _Compare, _Alloc>& __x, | ^~~~~~~~ /usr/include/c++/10/bits/stl_map.h:1515:5: note: template argument deduction/substitution failed: combo.cpp:8:9: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::map<_Key, _Tp, _Compare, _Alloc>' 8 | if(f > 0) | ^ In file included from /usr/include/c++/10/map:62, from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:81, from combo.cpp:2: /usr/include/c++/10/bits/stl_multimap.h:1180:5: note: candidate: 'template<class _Key, class _Tp, class _Compare, class _Alloc> bool std::operator>(const std::multimap<_Key, _Tp, _Compare, _Alloc>&, const std::multimap<_Key, _Tp, _Compare, _Alloc>&)' 1180 | operator>(const multimap<_Key, _Tp, _Compare, _Alloc>& __x, | ^~~~~~~~ /usr/include/c++/10/bits/stl_multimap.h:1180:5: note: template argument deduction/substitution failed: /var/loc