File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -286,6 +286,32 @@ where
286
286
}
287
287
}
288
288
289
+ // TODO is it useful?
290
+ use std:: fmt:: { Debug , Error , Formatter , Write } ;
291
+ impl < F > Debug for LazySegtree < F >
292
+ where
293
+ F : MapMonoid ,
294
+ F :: F : Debug ,
295
+ <F :: M as Monoid >:: S : Debug ,
296
+ {
297
+ fn fmt ( & self , f : & mut Formatter < ' _ > ) -> Result < ( ) , Error > {
298
+ for i in 0 ..self . log {
299
+ for j in 0 ..1 << i {
300
+ f. write_fmt ( format_args ! (
301
+ "{:?}[{:?}]\t " ,
302
+ self . d[ ( 1 << i) + j] ,
303
+ self . lz[ ( 1 << i) + j]
304
+ ) ) ?;
305
+ }
306
+ f. write_char ( '\n' ) ?;
307
+ }
308
+ for i in 0 ..self . size {
309
+ f. write_fmt ( format_args ! ( "{:?}\t " , self . d[ self . size + i] ) ) ?;
310
+ }
311
+ Ok ( ( ) )
312
+ }
313
+ }
314
+
289
315
#[ cfg( test) ]
290
316
mod tests {
291
317
use crate :: { LazySegtree , MapMonoid , Max } ;
You can’t perform that action at this time.
0 commit comments