### pr_iy_an_sh_ut_iw_ar_i's blog

By pr_iy_an_sh_ut_iw_ar_i, history, 2 weeks ago,

In this problem(DIV2.C) I printed the right answer but the code forces judge is showing it wrong, Why? Can anyone point out my mistake? My code is

void task() {
str s; cin >> s; int n = s.size();
cout << 3 << endl;
cout << "R " << n - 1 << endl;
cout << "L " << n << endl;
cout << "L " << n - 1 << endl;
}


In the first test case, abac my output is(which is always the same)->

3
R 5
L 6
L 5


which I think is right.

UPD — Why all are downvoting? if there is any mistakes or error than please let me know.

• -26

 » 2 weeks ago, # |   0 Are you sure it is right? Have you checked the editorial?
•  » » 2 weeks ago, # ^ |   0 Yes I checked. Though it was clear from the editorial to print always only 4 lines but You can see that with my output in 1st test case you can actually build a palindrome string .
•  » » » 2 weeks ago, # ^ |   0 Have you tried any other testcases?
 » 2 weeks ago, # |   0 You should put:cout << "L " << 2 << endl;in the last line
•  » » 2 weeks ago, # ^ |   0 But putting L 5 in end also giving palindrome string.
•  » » » 2 weeks ago, # ^ |   0 But for this case and a bunch of more cases only not on all. I can give counter example
•  » » » » 2 weeks ago, # ^ |   0 So you are saying that just print those 3 lines written in editorial. But can you tell what's wrong in my code?
•  » » » » » 2 weeks ago, # ^ |   0 Take string as "abcd".Then final string will be: " abcdcbabcdc"
 » 2 weeks ago, # |   0 Auto comment: topic has been updated by pr_iy_an_sh_ut_iw_ar_i (previous revision, new revision, compare).