如果你 Subtask1WA\mathcal{Subtask1 WA}Subtask1WA 可能是
cout << ans.b[1][n] << endl;
应该为
cout << ans.b[1][n == 2 ? 1 : 2] << endl;