the.wiz's blog

By the.wiz, history, 2 years ago, In English

Can you please give a counter-example to find the error in my approach??? (I guess there is an overflow -_-) Problem:- https://codeforces.me/problemset/problem/1594/C My approach:- https://codeforces.me/contest/1594/submission/170945137

  • Vote: I like it
  • +3
  • Vote: I do not like it

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

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

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

The correct approach is simpler. (My proof might scare you, though, because I made it rigorously.) Case 1 (you found this one): all characters are equal to c. Then no operations are needed. Case 2: Not all characters are equal to c. Then we have further subcases:

The subcases