need help in Teza Round 1 (Codeforces Round 1015, Div. 1 + Div. 2) Problem C

Revision en1, by redsexx, 2025-07-12 11:06:44

Hello, I’m getting Wrong Answer on test 2 for problem 2084C and could really use your insight. In my solution I use a variable samesame to count how many positions i satisfy a[i] == b[i]. If n is odd and samesame != 1, I immediately print -1; if n is even and samesame != 0, I also print -1. Otherwise, I perform a brute‑force sequence of swaps to try to make a and b reverse of each other—but I still can’t even pass test 2. Any idea what I’m missing?

Problem link: https://mirror.codeforces.com/contest/2084/problem/C My submission: https://mirror.codeforces.com/contest/2084/submission/328626310

Thank you in advance

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English redsexx 2025-07-12 11:06:44 689 Initial revision (published)