# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1199065 | wpdmd76 | Unscrambling a Messy Bug (IOI16_messy) | C++20 | Compilation error | 0 ms | 0 KiB |
#include <bits/stdc++.h>
using namespace std;
#include "messy.h"
vector<int> restore_permutation(int n, int w, int r) {
vector<int> ret(n);
string s(n, "0");
for(int i = n - 1; i >= 1; i--){
s[i] = "1";
add_element(s);
}
compile_set();
string res(n, "0");
int cnt = n - 1;
for(int j = 0; j < n; j++){
int ix = -1;
for(int i = 0; i < n; i++){
if(res[i] = "1") continue;
res[i] = "1";
if(check_element(res)){
ix = i;
ret[ix] = cnt;
cnt--;
}
res[i] = "0";
}
res[ix] = "1";
}
return ret;
}
Compilation message (stderr)
messy.cpp: In function 'std::vector<int> restore_permutation(int, int, int)': messy.cpp:7:20: error: no matching function for call to 'std::__cxx11::basic_string<char>::basic_string(int&, const char [2])' 7 | string s(n, "0"); | ^ In file included from /usr/include/c++/11/string:55, from /usr/include/c++/11/bits/locale_classes.h:40, from /usr/include/c++/11/bits/ios_base.h:41, from /usr/include/c++/11/ios:42, from /usr/include/c++/11/istream:38, from /usr/include/c++/11/sstream:38, from /usr/include/c++/11/complex:45, from /usr/include/c++/11/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:54, from messy.cpp:1: /usr/include/c++/11/bits/basic_string.h:664:9: note: candidate: 'template<class _Tp, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _Tp&, const _Alloc&) [with _Tp = _Tp; <template-parameter-2-2> = <template-parameter-1-2>; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 664 | basic_string(const _Tp& __t, const _Alloc& __a = _Alloc()) | ^~~~~~~~~~~~ /usr/include/c++/11/bits/basic_string.h:664:9: note: template argument deduction/substitution failed: In file included from /usr/include/c++/11/bits/move.h:57, from /usr/include/c++/11/bits/stl_pair.h:59, from /usr/include/c++/11/bits/stl_algobase.h:64, from /usr/include/c++/11/bits/specfun.h:45, from /usr/include/c++/11/cmath:1935, from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:41, from messy.cpp:1: /usr/include/c++/11/type_traits: In substitution of 'template<bool _Cond, class _Tp> using enable_if_t = typename std::enable_if::type [with bool _Cond = false; _Tp = void]': /usr/include/c++/11/bits/basic_string.h:125:8: required by substitution of 'template<class _CharT, class _Traits, class _Alloc> template<class _Tp, class _Res> using _If_sv = std::enable_if_t<std::__and_<std::is_convertible<const _Tp&, std::basic_string_view<_CharT, _Traits> >, std::__not_<std::is_convertible<const _Tp*, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>*> >, std::__not_<std::is_convertible<const _Tp&, const _CharT*> > >::value, _Res> [with _Tp = int; _Res = void; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' /usr/include/c++/11/bits/basic_string.h:662:30: required from here /usr/include/c++/11/type_traits:2579:11: error: no type named 'type' in 'struct std::enable_if<false, void>' 2579 | using enable_if_t = typename enable_if<_Cond, _Tp>::type; | ^~~~~~~~~~~ In file included from /usr/include/c++/11/string:55, from /usr/include/c++/11/bits/locale_classes.h:40, from /usr/include/c++/11/bits/ios_base.h:41, from /usr/include/c++/11/ios:42, from /usr/include/c++/11/istream:38, from /usr/include/c++/11/sstream:38, from /usr/include/c++/11/complex:45, from /usr/include/c++/11/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:54, from messy.cpp:1: /usr/include/c++/11/bits/basic_string.h:653:9: note: candidate: 'template<class _Tp, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _Tp&, std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type, std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type, const _Alloc&) [with _Tp = _Tp; <template-parameter-2-2> = <template-parameter-1-2>; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 653 | basic_string(const _Tp& __t, size_type __pos, size_type __n, | ^~~~~~~~~~~~ /usr/include/c++/11/bits/basic_string.h:653:9: note: template argument deduction/substitution failed: messy.cpp:7:20: note: candidate expects 4 arguments, 2 provided 7 | string s(n, "0"); | ^ In file included from /usr/include/c++/11/string:55, from /usr/include/c++/11/bits/locale_classes.h:40, from /usr/include/c++/11/bits/ios_base.h:41, from /usr/include/c++/11/ios:42, from /usr/include/c++/11/istream:38, from /usr/include/c++/11/sstream:38, from /usr/include/c++/11/complex:45, from /usr/include/c++/11/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:54, from messy.cpp:1: /usr/include/c++/11/bits/basic_string.h:638:9: note: candidate: 'template<class _InputIterator, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(_InputIterator, _InputIterator, const _Alloc&) [with _InputIterator = _InputIterator; <template-parameter-2-2> = <template-parameter-1-2>; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 638 | basic_string(_InputIterator __beg, _InputIterator __end, | ^~~~~~~~~~~~ /usr/include/c++/11/bits/basic_string.h:638:9: note: template argument deduction/substitution failed: messy.cpp:7:20: note: deduced conflicting types for parameter '_InputIterator' ('int' and 'const char*') 7 | string s(n, "0"); | ^ In file included from /usr/include/c++/11/string:55, from /usr/include/c++/11/bits/locale_classes.h:40, from /usr/include/c++/11/bits/ios_base.h:41, from /usr/include/c++/11/ios:42, from /usr/include/c++/11/istream:38, from /usr/include/c++/11/sstream:38, from /usr/include/c++/11/complex:45, from /usr/include/c++/11/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:54, from messy.cpp:1: /usr/include/c++/11/bits/basic_string.h:553:7: note: candidate: 'template<class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type, _CharT, const _Alloc&) [with <template-parameter-2-1> = <template-parameter-1-1>; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 553 | basic_string(size_type __n, _CharT __c, const _Alloc& __a = _Alloc()) | ^~~~~~~~~~~~ /usr/include/c++/11/bits/basic_string.h:553:7: note: template argument deduction/substitution failed: messy.cpp:7:17: note: cannot convert '"0"' (type 'const char [2]') to type 'char' 7 | string s(n, "0"); | ^~~ In file included from /usr/include/c++/11/string:55, from /usr/include/c++/11/bits/locale_classes.h:40, from /usr/include/c++/11/bits/ios_base.h:41, from /usr/include/c++/11/ios:42, from /usr/include/c++/11/istream:38, from /usr/include/c++/11/sstream:38, from /usr/include/c++/11/complex:45, from /usr/include/c++/11/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:54, from messy.cpp:1: /usr/include/c++/11/bits/basic_string.h:533:7: note: candidate: 'template<class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, const _Alloc&) [with <template-parameter-2-1> = <template-parameter-1-1>; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 533 | basic_string(const _CharT* __s, const _Alloc& __a = _Alloc()) | ^~~~~~~~~~~~ /usr/include/c++/11/bits/basic_string.h:533:7: note: template argument deduction/substitution failed: messy.cpp:7:14: note: cannot convert 'n' (type 'int') to type 'const char*' 7 | string s(n, "0"); | ^ In file included from /usr/include/c++/11/string:55, from /usr/include/c++/11/bits/locale_classes.h:40, from /usr/include/c++/11/bits/ios_base.h:41, from /usr/include/c++/11/ios:42, from /usr/include/c++/11/istream:38, from /usr/include/c++/11/sstream:38, from /usr/include/c++/11/complex:45, from /usr/include/c++/11/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:54, from messy.cpp:1: /usr/include/c++/11/bits/basic_string.h:600:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 600 | basic_string(basic_string&& __str, const _Alloc& __a) | ^~~~~~~~~~~~ /usr/include/c++/11/bits/basic_string.h:600:35: note: no known conversion for argument 1 from 'int' to 'std::__cxx11::basic_string<char>&&' 600 | basic_string(basic_string&& __str, const _Alloc& __a) | ~~~~~~~~~~~~~~~^~~~~ /usr/include/c++/11/bits/basic_string.h:596:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 596 | basic_string(const basic_string& __str, const _Alloc& __a) | ^~~~~~~~~~~~ /usr/include/c++/11/bits/basic_string.h:596:40: note: no known conversion for argument 1 from 'int' to 'const std::__cxx11::basic_string<char>&' 596 | basic_string(const basic_string& __str, const _Alloc& __a) | ~~~~~~~~~~~~~~~~~~~~^~~~~ /usr/include/c++/11/bits/basic_string.h:592:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::initializer_list<_Tp>, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 592 | basic_string(initializer_list<_CharT> __l, const _Alloc& __a = _Alloc()) | ^~~~~~~~~~~~ /usr/include/c++/11/bits/basic_string.h:592:45: note: no known conversion for argument 1 from 'int' to 'std::initializer_list<char>' 592 | basic_string(initializer_list<_CharT> __l, const _Alloc& __a = _Alloc()) | ~~~~~~~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/11/bits/basic_string.h:565:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 565 | basic_string(basic_string&& __str) noexcept | ^~~~~~~~~~~~ /usr/include/c++/11/bits/basic_string.h:565:7: note: candidate expects 1 argument, 2 provided /usr/include/c++/11/bits/basic_string.h:518:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type = long unsigned int]' (near match) 518 | basic_string(const _CharT* __s, size_type __n, | ^~~~~~~~~~~~ /usr/include/c++/11/bits/basic_string.h:518:7: note: conversion of argument 2 would be ill-formed: messy.cpp:7:17: error: invalid conversion from 'const char*' to 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-fpermissive] 7 | string s(n, "0"); | ^~~ | | | const char* In file included from /usr/include/c++/11/string:55, from /usr/include/c++/11/bits/locale_classes.h:40, from /usr/include/c++/11/bits/ios_base.h:41, from /usr/include/c++/11/ios:42, from /usr/include/c++/11/istream:38, from /usr/include/c++/11/sstream:38, from /usr/include/c++/11/complex:45, from /usr/include/c++/11/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:54, from messy.cpp:1: /usr/include/c++/11/bits/basic_string.h:500:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type, std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type = long unsigned int]' 500 | basic_string(const basic_string& __str, size_type __pos, | ^~~~~~~~~~~~ /usr/include/c++/11/bits/basic_string.h:500:7: note: candidate expects 4 arguments, 2 provided /usr/include/c++/11/bits/basic_string.h:484:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type, std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type = long unsigned int]' 484 | basic_string(const basic_string& __str, size_type __pos, | ^~~~~~~~~~~~ /usr/include/c++/11/bits/basic_string.h:484:7: note: candidate expects 3 arguments, 2 provided /usr/include/c++/11/bits/basic_string.h:469:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type = long unsigned int]' 469 | basic_string(const basic_string& __str, size_type __pos, | ^~~~~~~~~~~~ /usr/include/c++/11/bits/basic_string.h:469:40: note: no known conversion for argument 1 from 'int' to 'const std::__cxx11::basic_string<char>&' 469 | basic_string(const basic_string& __str, size_type __pos, | ~~~~~~~~~~~~~~~~~~~~^~~~~ /usr/include/c++/11/bits/basic_string.h:456:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 456 | basic_string(const basic_string& __str) | ^~~~~~~~~~~~ /usr/include/c++/11/bits/basic_string.h:456:7: note: candidate expects 1 argument, 2 provided /usr/include/c++/11/bits/basic_string.h:448:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 448 | basic_string(const _Alloc& __a) _GLIBCXX_NOEXCEPT | ^~~~~~~~~~~~ /usr/include/c++/11/bits/basic_string.h:448:7: note: candidate expects 1 argument, 2 provided /usr/include/c++/11/bits/basic_string.h:439:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string() [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 439 | basic_string() | ^~~~~~~~~~~~ /usr/include/c++/11/bits/basic_string.h:439:7: note: candidate expects 0 arguments, 2 provided /usr/include/c++/11/bits/basic_string.h:153:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::__sv_wrapper, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 153 | basic_string(__sv_wrapper __svw, const _Alloc& __a) | ^~~~~~~~~~~~ /usr/include/c++/11/bits/basic_string.h:153:33: note: no known conversion for argument 1 from 'int' to 'std::__cxx11::basic_string<char>::__sv_wrapper' 153 | basic_string(__sv_wrapper __svw, const _Alloc& __a) | ~~~~~~~~~~~~~^~~~~ messy.cpp:9:16: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive] 9 | s[i] = "1"; | ^~~ | | | const char* messy.cpp:13:22: error: no matching function for call to 'std::__cxx11::basic_string<char>::basic_string(int&, const char [2])' 13 | string res(n, "0"); | ^ In file included from /usr/include/c++/11/string:55, from /usr/include/c++/11/bits/locale_classes.h:40, from /usr/include/c++/11/bits/ios_base.h:41, from /usr/include/c++/11/ios:42, from /usr/include/c++/11/istream:38, from /usr/include/c++/11/sstream:38, from /usr/include/c++/11/complex:45, from /usr/include/c++/11/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:54, from messy.cpp:1: /usr/include/c++/11/bits/basic_string.h:664:9: note: candidate: 'template<class _Tp, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _Tp&, const _Alloc&) [with _Tp = _Tp; <template-parameter-2-2> = <template-parameter-1-2>; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 664 | basic_string(const _Tp& __t, const _Alloc& __a = _Alloc()) | ^~~~~~~~~~~~ /usr/include/c++/11/bits/basic_string.h:664:9: note: template argument deduction/substitution failed: /usr/include/c++/11/bits/basic_string.h:653:9: note: candidate: 'template<class _Tp, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _Tp&, std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type, std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type, const _Alloc&) [with _Tp = _Tp; <template-parameter-2-2> = <template-parameter-1-2>; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 653 | basic_string(const _Tp& __t, size_type __pos, size_type __n, | ^~~~~~~~~~~~ /usr/include/c++/11/bits/basic_string.h:653:9: note: template argument deduction/substitution failed: messy.cpp:13:22: note: candidate expects 4 arguments, 2 provided 13 | string res(n, "0"); | ^ In file included from /usr/include/c++/11/string:55, from /usr/include/c++/11/bits/locale_classes.h:40, from /usr/include/c++/11/bits/ios_base.h:41, from /usr/include/c++/11/ios:42, from /usr/include/c++/11/istream:38, from /usr/include/c++/11/sstream:38, from /usr/include/c++/11/complex:45, from /usr/include/c++/11/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:54, from messy.cpp:1: /usr/include/c++/11/bits/basic_string.h:638:9: note: candidate: 'template<class _InputIterator, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(_InputIterator, _InputIterator, const _Alloc&) [with _InputIterator = _InputIterator; <template-parameter-2-2> = <template-parameter-1-2>; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 638 | basic_string(_InputIterator __beg, _InputIterator __end, | ^~~~~~~~~~~~ /usr/include/c++/11/bits/basic_string.h:638:9: note: template argument deduction/substitution failed: messy.cpp:13:22: note: deduced conflicting types for parameter '_InputIterator' ('int' and 'const char*') 13 | string res(n, "0"); | ^ In file included from /usr/include/c++/11/string:55, from /usr/include/c++/11/bits/locale_classes.h:40, from /usr/include/c++/11/bits/ios_base.h:41, from /usr/include/c++/11/ios:42, from /usr/include/c++/11/istream:38, from /usr/include/c++/11/sstream:38, from /usr/include/c++/11/complex:45, from /usr/include/c++/11/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:54, from messy.cpp:1: /usr/include/c++/11/bits/basic_string.h:553:7: note: candidate: 'template<class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type, _CharT, const _Alloc&) [with <template-parameter-2-1> = <template-parameter-1-1>; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 553 | basic_string(size_type __n, _CharT __c, const _Alloc& __a = _Alloc()) | ^~~~~~~~~~~~ /usr/include/c++/11/bits/basic_string.h:553:7: note: template argument deduction/substitution failed: messy.cpp:13:19: note: cannot convert '"0"' (type 'const char [2]') to type 'char' 13 | string res(n, "0"); | ^~~ In file included from /usr/include/c++/11/string:55, from /usr/include/c++/11/bits/locale_classes.h:40, from /usr/include/c++/11/bits/ios_base.h:41, from /usr/include/c++/11/ios:42, from /usr/include/c++/11/istream:38, from /usr/include/c++/11/sstream:38, from /usr/include/c++/11/complex:45, from /usr/include/c++/11/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:54, from messy.cpp:1: /usr/include/c++/11/bits/basic_string.h:533:7: note: candidate: 'template<class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, const _Alloc&) [with <template-parameter-2-1> = <template-parameter-1-1>; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 533 | basic_string(const _CharT* __s, const _Alloc& __a = _Alloc()) | ^~~~~~~~~~~~ /usr/include/c++/11/bits/basic_string.h:533:7: note: template argument deduction/substitution failed: messy.cpp:13:16: note: cannot convert 'n' (type 'int') to type 'const char*' 13 | string res(n, "0"); | ^ In file included from /usr/include/c++/11/string:55, from /usr/include/c++/11/bits/locale_classes.h:40, from /usr/include/c++/11/bits/ios_base.h:41, from /usr/include/c++/11/ios:42, from /usr/include/c++/11/istream:38, from /usr/include/c++/11/sstream:38, from /usr/include/c++/11/complex:45, from /usr/include/c++/11/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:54, from messy.cpp:1: /usr/include/c++/11/bits/basic_string.h:600:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 600 | basic_string(basic_string&& __str, const _Alloc& __a) | ^~~~~~~~~~~~ /usr/include/c++/11/bits/basic_string.h:600:35: note: no known conversion for argument 1 from 'int' to 'std::__cxx11::basic_string<char>&&' 600 | basic_string(basic_string&& __str, const _Alloc& __a) | ~~~~~~~~~~~~~~~^~~~~ /usr/include/c++/11/bits/basic_string.h:596:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 596 | basic_string(const basic_string& __str, const _Alloc& __a) | ^~~~~~~~~~~~ /usr/include/c++/11/bits/basic_string.h:596:40: note: no known conversion for argument 1 from 'int' to 'const std::__cxx11::basic_string<char>&' 596 | basic_string(const basic_string& __str, const _Alloc& __a) | ~~~~~~~~~~~~~~~~~~~~^~~~~ /usr/include/c++/11/bits/basic_string.h:592:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::initializer_list<_Tp>, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 592 | basic_string(initializer_list<_CharT> __l, const _Alloc& __a = _Alloc()) | ^~~~~~~~~~~~ /usr/include/c++/11/bits/basic_string.h:592:45: note: no known conversion for argument 1 from 'int' to 'std::initializer_list<char>' 592 | basic_string(initializer_list<_CharT> __l, const _Alloc& __a = _Alloc()) | ~~~~~~~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/11/bits/basic_string.h:565:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 565 | basic_string(basic_string&& __str) noexcept | ^~~~~~~~~~~~ /usr/include/c++/11/bits/basic_string.h:565:7: note: candidate expects 1 argument, 2 provided /usr/include/c++/11/bits/basic_string.h:518:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type = long unsigned int]' (near match) 518 | basic_string(const _CharT* __s, size_type __n, | ^~~~~~~~~~~~ /usr/include/c++/11/bits/basic_string.h:518:7: note: conversion of argument 2 would be ill-formed: messy.cpp:13:19: error: invalid conversion from 'const char*' to 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-fpermissive] 13 | string res(n, "0"); | ^~~ | | | const char* In file included from /usr/include/c++/11/string:55, from /usr/include/c++/11/bits/locale_classes.h:40, from /usr/include/c++/11/bits/ios_base.h:41, from /usr/include/c++/11/ios:42, from /usr/include/c++/11/istream:38, from /usr/include/c++/11/sstream:38, from /usr/include/c++/11/complex:45, from /usr/include/c++/11/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:54, from messy.cpp:1: /usr/include/c++/11/bits/basic_string.h:500:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type, std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type = long unsigned int]' 500 | basic_string(const basic_string& __str, size_type __pos, | ^~~~~~~~~~~~ /usr/include/c++/11/bits/basic_string.h:500:7: note: candidate expects 4 arguments, 2 provided /usr/include/c++/11/bits/basic_string.h:484:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type, std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type = long unsigned int]' 484 | basic_string(const basic_string& __str, size_type __pos, | ^~~~~~~~~~~~ /usr/include/c++/11/bits/basic_string.h:484:7: note: candidate expects 3 arguments, 2 provided /usr/include/c++/11/bits/basic_string.h:469:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type = long unsigned int]' 469 | basic_string(const basic_string& __str, size_type __pos, | ^~~~~~~~~~~~ /usr/include/c++/11/bits/basic_string.h:469:40: note: no known conversion for argument 1 from 'int' to 'const std::__cxx11::basic_string<char>&' 469 | basic_string(const basic_string& __str, size_type __pos, | ~~~~~~~~~~~~~~~~~~~~^~~~~ /usr/include/c++/11/bits/basic_string.h:456:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 456 | basic_string(const basic_string& __str) | ^~~~~~~~~~~~ /usr/include/c++/11/bits/basic_string.h:456:7: note: candidate expects 1 argument, 2 provided /usr/include/c++/11/bits/basic_string.h:448:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 448 | basic_string(const _Alloc& __a) _GLIBCXX_NOEXCEPT | ^~~~~~~~~~~~ /usr/include/c++/11/bits/basic_string.h:448:7: note: candidate expects 1 argument, 2 provided /usr/include/c++/11/bits/basic_string.h:439:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string() [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 439 | basic_string() | ^~~~~~~~~~~~ /usr/include/c++/11/bits/basic_string.h:439:7: note: candidate expects 0 arguments, 2 provided /usr/include/c++/11/bits/basic_string.h:153:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::__sv_wrapper, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 153 | basic_string(__sv_wrapper __svw, const _Alloc& __a) | ^~~~~~~~~~~~ /usr/include/c++/11/bits/basic_string.h:153:33: note: no known conversion for argument 1 from 'int' to 'std::__cxx11::basic_string<char>::__sv_wrapper' 153 | basic_string(__sv_wrapper __svw, const _Alloc& __a) | ~~~~~~~~~~~~~^~~~~ messy.cpp:18:25: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive] 18 | if(res[i] = "1") continue; | ^~~ | | | const char* messy.cpp:19:22: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive] 19 | res[i] = "1"; | ^~~ | | | const char* messy.cpp:25:22: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive] 25 | res[i] = "0"; | ^~~ | | | const char* messy.cpp:27:19: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive] 27 | res[ix] = "1"; | ^~~ | | | const char* messy.h:1:9: warning: #pragma once in main file 1 | #pragma once | ^~~~ messy_c.h:1:9: warning: #pragma once in main file 1 | #pragma once | ^~~~