pr_iy_an_sh_ut_iw_ar_i's blog

By pr_iy_an_sh_ut_iw_ar_i, history, 2 weeks ago, In English

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.

 
 
 
 
  • Vote: I like it
  • -26
  • Vote: I do not like it

»
2 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

Are you sure it is right? Have you checked the editorial?

  • »
    »
    2 weeks ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    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, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Have you tried any other testcases?

»
2 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

You should put:

cout << "L " << 2 << endl;

in the last line

»
2 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by pr_iy_an_sh_ut_iw_ar_i (previous revision, new revision, compare).