SRM 609, D2, 250-Pointer (MagicalStringDiv2)

James S. Plank

Tue Oct 15 11:48:12 EDT 2019

In case Topcoder's servers are down

(Please use the workflow in the problem Cryptography).

Here is a summary of the problem:


The examples

Example S Answer
0 ">><<><" 2
1 ">>>><<<<" 0
2 "<<>>" 4
3 "<><<<>>>>><<>>>>><>><<<>><><><><<><<<<<><<>>><><><" 20


Testing yourself

I have a shell script tests.sh, that you can use to test your program. When you run tests.sh, your answer should be identical to answers.txt. The shell script should take well under a second.

Hints

At 1199 submissions, a 97% success rate, and an average score of 227.77, this has to be one of the easiest Topcoder problems in history. I would hope that you get it in under five minutes. If you want help, keep reading, but I urge you to figure this one out on your own.

















































When do you change a character? Run through S and add those up.