UVa 458

From Algorithmist
Jump to navigation Jump to search


458 - The Decoder[edit]

Summary[edit]

"Decode" an "encrypted" message using "simple arithmetic."

Explanation[edit]

Think ROT13 only 7.

Gotcha's[edit]

Be careful with newlines and integer wraparound.

Input[edit]

1JKJ'pz'{ol'{yhklthyr'vm'{ol'Jvu{yvs'Kh{h'Jvywvyh{pvu5
1PIT'pz'h'{yhklthyr'vm'{ol'Pu{lyuh{pvuhs'I|zpulzz'Thjopul'Jvywvyh{pvu5
1KLJ'pz'{ol'{yhklthyr'vm'{ol'Kpnp{hs'Lx|pwtlu{'Jvywvyh{pvu5

Output[edit]

*CDC is the trademark of the Control Data Corporation.
*IBM is a trademark of the International Business Machine Corporation.
*DEC is the trademark of the Digital Equipment Corporation.

Solution[edit]

C++ : http://acm-solution.blogspot.com/2011/09/acm-uva-458-decoder.html