Need help with a question

Revision en1, by woofwoof321, 2019-07-26 13:37:00

I asked this from the best coder of my college and he was totally clueless and so am I. This is the question: https://codeforces.me/problemset/problem/4/A. My approach is to use a segment tree of balanced binary search trees and then apply heavy-light decomposition and binary lifting but it gives wrong answer on test 1.

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English woofwoof321 2019-07-26 13:37:00 349 Initial revision (published)