Submission #1151942

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
11519422025-02-17 12:14:53Noproblem29Cake 3 (JOI19_cake3)C++20
Compilation error
0 ms0 KiB
#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")
#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/rope>
using namespace std;
using namespace __gnu_pbds;
using namespace __gnu_cxx;
typedef long long ll;
typedef long double ld;
typedef complex<ld> cd;
typedef pair<int, int> pi;
typedef pair<ll,ll> pl;
typedef pair<ld,ld> pd;
typedef vector<int> vi;
typedef vector<ld> vd;
typedef vector<ll> vl;
typedef vector<pi> vpi;
typedef vector<pl> vpl;
typedef vector<cd> vcd;
template <class T> using Tree = tree<T, null_type, less<T>, rb_tree_tag,tree_order_statistics_node_update>;
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

In file included from /usr/include/c++/11/filesystem:45,
                 from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:129,
                 from cake3.cpp:4:
/usr/include/c++/11/bits/fs_path.h: In instantiation of 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::filesystem::__cxx11::path::generic_string(const _Allocator&) const [with _CharT = char; _Traits = std::char_traits<char>; _Allocator = std::allocator<char>]':
/usr/include/c++/11/bits/fs_path.h:1163:32:   required from here
/usr/include/c++/11/bits/fs_path.h:1150:21: error: ambiguous overload for 'operator+=' (operand types are 'std::__cxx11::basic_string<char>' and 'std::__cxx11::basic_string<char>::__sv_type' {aka 'std::basic_string_view<char>'})
 1150 |               __str += basic_string_view<value_type>(__elem._M_pathname);
      |               ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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 cake3.cpp:4:
/usr/include/c++/11/bits/basic_string.h:1203:9: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_If_sv<_Tp, std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator+=(const _Tp&) [with _Tp = std::basic_string_view<char>; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_If_sv<_Tp, std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&> = std::__cxx11::basic_string<char>&]'
 1203 |         operator+=(const _Tp& __svt)
      |         ^~~~~~~~
cake3.cpp:57:30: note: candidate: 'A operator+=(A&, const B&) [with A = std::__cxx11::basic_string<char>; B = std::basic_string_view<char>]'
   57 | template<class A, class B> A operator+=(A& l, const B& r) { return l = l+r; }
      |                              ^~~~~~~~
In file included from /usr/include/c++/11/filesystem:45,
                 from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:129,
                 from cake3.cpp:4:
/usr/include/c++/11/bits/fs_path.h: In instantiation of 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::filesystem::__cxx11::path::generic_string(const _Allocator&) const [with _CharT = wchar_t; _Traits = std::char_traits<wchar_t>; _Allocator = std::allocator<wchar_t>]':
/usr/include/c++/11/bits/fs_path.h:1168:35:   required from here
/usr/include/c++/11/bits/fs_path.h:1150:21: error: ambiguous overload for 'operator+=' (operand types are 'std::__cxx11::basic_string<char>' and 'std::__cxx11::basic_string<char>::__sv_type' {aka 'std::basic_string_view<char>'})
 1150 |               __str += basic_string_view<value_type>(__elem._M_pathname);
      |               ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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 cake3.cpp:4:
/usr/include/c++/11/bits/basic_string.h:1203:9: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_If_sv<_Tp, std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator+=(const _Tp&) [with _Tp = std::basic_string_view<char>; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_If_sv<_Tp, std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&> = std::__cxx11::basic_string<char>&]'
 1203 |         operator+=(const _Tp& __svt)
      |         ^~~~~~~~
cake3.cpp:57:30: note: candidate: 'A operator+=(A&, const B&) [with A = std::__cxx11::basic_string<char>; B = std::basic_string_view<char>]'
   57 | template<class A, class B> A operator+=(A& l, const B& r) { return l = l+r; }
      |                              ^~~~~~~~
In file included from /usr/include/c++/11/filesystem:45,
                 from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:129,
                 from cake3.cpp:4:
/usr/include/c++/11/bits/fs_path.h: In instantiation of 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::filesystem::__cxx11::path::generic_string(const _Allocator&) const [with _CharT = char8_t; _Traits = std::char_traits<char8_t>; _Allocator = std::allocator<char8_t>]':
/usr/include/c++/11/bits/fs_path.h:1174:35:   required from here
/usr/include/c++/11/bits/fs_path.h:1150:21: error: ambiguous overload for 'operator+=' (operand types are 'std::__cxx11::basic_string<char>' and 'std::__cxx11::basic_string<char>::__sv_type' {aka 'std::basic_string_view<char>'})
 1150 |               __str += basic_string_view<value_type>(__elem._M_pathname);
      |               ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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 cake3.cpp:4:
/usr/include/c++/11/bits/basic_string.h:1203:9: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_If_sv<_Tp, std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator+=(const _Tp&) [with _Tp = std::basic_string_view<char>; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_If_sv<_Tp, std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&> = std::__cxx11::basic_string<char>&]'
 1203 |         operator+=(const _Tp& __svt)
      |         ^~~~~~~~
cake3.cpp:57:30: note: candidate: 'A operator+=(A&, const B&) [with A = std::__cxx11::basic_string<char>; B = std::basic_string_view<char>]'
   57 | template<class A, class B> A operator+=(A& l, const B& r) { return l = l+r; }
      |                              ^~~~~~~~
In file included from /usr/include/c++/11/filesystem:45,
                 from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:129,
                 from cake3.cpp:4:
/usr/include/c++/11/bits/fs_path.h: In instantiation of 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::filesystem::__cxx11::path::generic_string(const _Allocator&) const [with _CharT = char16_t; _Traits = std::char_traits<char16_t>; _Allocator = std::allocator<char16_t>]':
/usr/include/c++/11/bits/fs_path.h:1183:36:   required from here
/usr/include/c++/11/bits/fs_path.h:1150:21: error: ambiguous overload for 'operator+=' (operand types are 'std::__cxx11::basic_string<char>' and 'std::__cxx11::basic_string<char>::__sv_type' {aka 'std::basic_string_view<char>'})
 1150 |               __str += basic_string_view<value_type>(__elem._M_pathname);
      |               ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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 cake3.cpp:4:
/usr/include/c++/11/bits/basic_string.h:1203:9: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_If_sv<_Tp, std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator+=(const _Tp&) [with _Tp = std::basic_string_view<char>; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_If_sv<_Tp, std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&> = std::__cxx11::basic_string<char>&]'
 1203 |         operator+=(const _Tp& __svt)
      |         ^~~~~~~~
cake3.cpp:57:30: note: candidate: 'A operator+=(A&, const B&) [with A = std::__cxx11::basic_string<char>; B = std::basic_string_view<char>]'
   57 | template<class A, class B> A operator+=(A& l, const B& r) { return l = l+r; }
      |                              ^~~~~~~~
In file included from /usr/include/c++/11/filesystem:45,
                 from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:129,
                 from cake3.cpp:4:
/usr/include/c++/11/bits/fs_path.h: In instantiation of 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::filesystem::__cxx11::path::generic_string(const _Allocator&) const [with _CharT = char32_t; _Traits = std::char_traits<char32_t>; _Allocator = std::allocator<char32_t>]':
/usr/include/c++/11/bits/fs_path.h:1187:36:   required from here
/usr/include/c++/11/bits/fs_path.h:1150:21: error: ambiguous overload for 'operator+=' (operand types are 'std::__cxx11::basic_string<char>' and 'std::__cxx11::basic_string<char>::__sv_type' {aka 'std::basic_string_view<char>'})
 1150 |               __str += basic_string_view<value_type>(__elem._M_pathname);
      |               ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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 cake3.cpp:4:
/usr/include/c++/11/bits/basic_string.h:1203:9: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_If_sv<_Tp, std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator+=(const _Tp&) [with _Tp = std::basic_string_view<char>; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_If_sv<_Tp, std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&> = std::__cxx11::basic_string<char>&]'
 1203 |         operator+=(const _Tp& __svt)
      |         ^~~~~~~~
cake3.cpp:57:30: note: candidate: 'A operator+=(A&, const B&) [with A = std::__cxx11::basic_string<char>; B = std::basic_string_view<char>]'
   57 | template<class A, class B> A operator+=(A& l, const B& r) { return l = l+r; }
      |                              ^~~~~~~~
cake3.cpp: In function 'void io::setIn(std::string)':
cake3.cpp:117:35: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
  117 |     void setIn(string s) { freopen(s.c_str(),"r",stdin); }
      |                            ~~~~~~~^~~~~~~~~~~~~~~~~~~~~
cake3.cpp: In function 'void io::setOut(std::string)':
cake3.cpp:118:36: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
  118 |     void setOut(string s) { freopen(s.c_str(),"w",stdout); }
      |                             ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~