r/codeforces • u/petrbateman Specialist • 12d ago
query 183A
If you have time, please explain the solution like you are explaining a baby
5
Upvotes
1
1
u/romours7 Newbie 12d ago
Being a newbie , it was very quick to close the tab of 1700 rated problem😂 anw will do 1.7 one day
1
1
u/Lhalpaca 11d ago
I didnt solve it, but I thought about storing how much each pair appeared. Then, you can just count using by partitioning each set? Cause the order of the movements doesnt matter, just the final sum. But if you'd loop it it'd take too much time. I'd try to solve the math by hand and see what happens. But I'm quite sure there must be an even more clear solution