Submission #902524

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
9025242024-01-10 14:50:19fanwenDynamic Diameter (CEOI19_diameter)C++17
100 / 100
730 ms49216 KiB
#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define ll long long
#define file(name) \
if(fopen(name".inp", "r")) \
freopen(name".inp", "r", stdin), freopen(name".out", "w", stdout);
template <class T> T max(T a, T b, T c) { return max(a, max(b, c)); }
template <class T, class U> struct lazy_segment_tree {
int n, size, log;
vector<T> d;
vector<U> lazy;
function <T(T, T)> TT;
function <T(U, T)> UT;
function <U(U, U)> UU;
T T_id; U U_id;
lazy_segment_tree(){}
lazy_segment_tree(const vector<T>& v, auto TT, auto UU, auto UT, T T_id, U U_id) : TT(TT), UU(UU), UT(UT), T_id(T_id), U_id(U_id) { init(v); }
lazy_segment_tree(int n, auto TT, auto UU, auto UT, T T_id, U U_id) : TT(TT), UU(UU), UT(UT), T_id(T_id), U_id(U_id) { init(n, T_id); }
lazy_segment_tree(int n, T x, auto TT, auto UU, auto UT, T T_id, U U_id) : TT(TT), UU(UU), UT(UT), T_id(T_id), U_id(U_id) { init(n, x); }
void init(int n, T x) {
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

diameter.cpp:26:43: warning: use of 'auto' in parameter declaration only available with '-fconcepts-ts'
   26 |     lazy_segment_tree(const vector<T>& v, auto TT, auto UU, auto UT, T T_id, U U_id) : TT(TT), UU(UU), UT(UT), T_id(T_id), U_id(U_id) { init(v); }
      |                                           ^~~~
diameter.cpp:26:52: warning: use of 'auto' in parameter declaration only available with '-fconcepts-ts'
   26 |     lazy_segment_tree(const vector<T>& v, auto TT, auto UU, auto UT, T T_id, U U_id) : TT(TT), UU(UU), UT(UT), T_id(T_id), U_id(U_id) { init(v); }
      |                                                    ^~~~
diameter.cpp:26:61: warning: use of 'auto' in parameter declaration only available with '-fconcepts-ts'
   26 |     lazy_segment_tree(const vector<T>& v, auto TT, auto UU, auto UT, T T_id, U U_id) : TT(TT), UU(UU), UT(UT), T_id(T_id), U_id(U_id) { init(v); }
      |                                                             ^~~~
diameter.cpp:27:30: warning: use of 'auto' in parameter declaration only available with '-fconcepts-ts'
   27 |     lazy_segment_tree(int n, auto TT, auto UU, auto UT, T T_id, U U_id) : TT(TT), UU(UU), UT(UT), T_id(T_id), U_id(U_id) { init(n, T_id); }
      |                              ^~~~
diameter.cpp:27:39: warning: use of 'auto' in parameter declaration only available with '-fconcepts-ts'
   27 |     lazy_segment_tree(int n, auto TT, auto UU, auto UT, T T_id, U U_id) : TT(TT), UU(UU), UT(UT), T_id(T_id), U_id(U_id) { init(n, T_id); }
      |                                       ^~~~
diameter.cpp:27:48: warning: use of 'auto' in parameter declaration only available with '-fconcepts-ts'
   27 |     lazy_segment_tree(int n, auto TT, auto UU, auto UT, T T_id, U U_id) : TT(TT), UU(UU), UT(UT), T_id(T_id), U_id(U_id) { init(n, T_id); }
      |                                                ^~~~
diameter.cpp:28:35: warning: use of 'auto' in parameter declaration only available with '-fconcepts-ts'
   28 |     lazy_segment_tree(int n, T x, auto TT, auto UU, auto UT, T T_id, U U_id) : TT(TT), UU(UU), UT(UT), T_id(T_id), U_id(U_id) { init(n, x); }
      |                                   ^~~~
diameter.cpp:28:44: warning: use of 'auto' in parameter declaration only available with '-fconcepts-ts'
   28 |     lazy_segment_tree(int n, T x, auto TT, auto UU, auto UT, T T_id, U U_id) : TT(TT), UU(UU), UT(UT), T_id(T_id), U_id(U_id) { init(n, x); }
      |                                            ^~~~
diameter.cpp:28:53: warning: use of 'auto' in parameter declaration only available with '-fconcepts-ts'
   28 |     lazy_segment_tree(int n, T x, auto TT, auto UU, auto UT, T T_id, U U_id) : TT(TT), UU(UU), UT(UT), T_id(T_id), U_id(U_id) { init(n, x); }
      |                                                     ^~~~
diameter.cpp: In instantiation of 'lazy_segment_tree<T, U>::lazy_segment_tree(int, auto:26, auto:27, auto:28, T, U) [with auto:26 = T (*)(const T&, const T&); auto:27 = <lambda(long long int, long long int)>; auto:28 = <lambda(const long long int&, const T&)>; T = T; U = long long int]':
diameter.cpp:281:69:   required from here
diameter.cpp:22:24: warning: 'lazy_segment_tree<T, long long int>::UU' will be initialized after [-Wreorder]
   22 |     function <U(U, U)> UU;
      |                        ^~
diameter.cpp:21:24: warning:   'std::function<T(long long int, T)> lazy_segment_tree<T, long long int>::UT' [-Wreorder]
   21 |     function <T(U, T)> UT;
      |                        ^~
diameter.cpp:27:5: warning:   when initialized here [-Wreorder]
   27 |     lazy_segment_tree(int n, auto TT, auto UU, auto UT, T T_id, U U_id) : TT(TT), UU(UU), UT(UT), T_id(T_id), U_id(U_id) { init(n, T_id); }
      |     ^~~~~~~~~~~~~~~~~
diameter.cpp: In function 'int main()':
diameter.cpp:10:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   10 |         freopen(name".inp", "r", stdin), freopen(name".out", "w", stdout);
      |         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
diameter.cpp:303:5: note: in expansion of macro 'file'
  303 |     file("diameter");
      |     ^~~~
diameter.cpp:10:49: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   10 |         freopen(name".inp", "r", stdin), freopen(name".out", "w", stdout);
      |                                          ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
diameter.cpp:303:5: note: in expansion of macro 'file'
  303 |     file("diameter");
      |     ^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...