I have been trying out this question and was getting WA. Initially, i thought my segment tree was wrong so i took it from gfg to test. Also the code is showing undefined behavior if i convert all int to ll(long long). But for second subtask we have to take long long ,Right?
Can someone please help me with the test cases where it fails. I would be really thankful.
Question link :- https://www.codechef.com/problems/TYTACTIC
My Code :- https://www.codechef.com/viewsolution/16151710
Thanks in advance.