179 - Code Breaking

All about problems in Volume 1. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

deadangelx
New poster
Posts: 32
Joined: Tue Feb 13, 2007 1:31 pm

Re: 179 - code breaking

Post by deadangelx » Sun Apr 05, 2009 1:10 am

I give 2 hints.

the first hint:
If n is not multiple of k
you can add any the same character after plaintext and cyphertext, like:
k = 5
"abcdabcd"
"bcdabcda"

after add '?'
"abcdabcd??"
"bcdabcda??"

then you can check k = 5

the second hint:
If one string is "abcdeee"
it has possible 3! permutation.
so "abcdeeefghiii"
it has possible 3! * 3! permutation.
when string having 80 characters, the factorial may be very big.
you can set a threshold to limit it (ex. 10000 permutation).
It needn't to check all possible string or u would get TLE.

metaphysis
Experienced poster
Posts: 138
Joined: Wed May 18, 2011 3:04 pm

Re: 179 - Code Breaking

Post by metaphysis » Sun Mar 27, 2016 4:17 am

Thanks for your hints, I got AC.

Post Reply

Return to “Volume 1 (100-199)”