| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 10 초 (추가 시간 없음) | 2048 MB | 230 | 171 | 155 | 72.770% |
You are trying to learn for an exam, but you notice that you do not have enough time to learn everything, completely in panic you decide to cheat on the test. You went into the office of your professor and took the exam. But once you got it in your hands, you notice you cannot read it easily. Your initial guess it that it is encoded with a Ceasar cipher. That is a cipher that shifts every letter a certain amount to the right, starting again at 'A' once you go past 'Z'.
For example: A ceasar cipher of 10 will shift every letter 10 alphabetic places to the right:
'ABCDEFGHIJKLMNOPQRSTUVWXYZ' will yield:
'LMNOPQRSTUVWXYZABCDEFGHIJK'
If you encode 'LOREM IPSUM DOLOR' with a Ceasar cipher of 10, you will end up with 'VYBOW SZCEW NYVYB'.
So if you decode "VYBOW SZCEW NYVYB" with Ceasar cipher 10, you go back 10 places to the left. resulting back in 'LOREM IPSUM DOLOR'.
However, as you are not sure how many places your professor shifted the alphabet, you want to write a program that takes as input the encoded string, and gives as output all 26 possible Ceasar decoded strings in order. So you can then manually determine which may be the actual solution.
One line containing a single string (which may have spaces) which is the question and the answer. You may assume the string only contains uppercase A-Z. The length of this string is at most 1000.
26 lines with on each line one decoded string. In order, starting with 0, up to a shift of 25.
VGZSHRSGDRLZKKDRSOQHLDSVN
VGZSHRSGDRLZKKDRSOQHLDSVN UFYRGQRFCQKYJJCQRNPGKCRUM TEXQFPQEBPJXIIBPQMOFJBQTL SDWPEOPDAOIWHHAOPLNEIAPSK RCVODNOCZNHVGGZNOKMDHZORJ QBUNCMNBYMGUFFYMNJLCGYNQI PATMBLMAXLFTEEXLMIKBFXMPH OZSLAKLZWKESDDWKLHJAEWLOG NYRKZJKYVJDRCCVJKGIZDVKNF MXQJYIJXUICQBBUIJFHYCUJME LWPIXHIWTHBPAATHIEGXBTILD KVOHWGHVSGAOZZSGHDFWASHKC JUNGVFGURFZNYYRFGCEVZRGJB ITMFUEFTQEYMXXQEFBDUYQFIA HSLETDESPDXLWWPDEACTXPEHZ GRKDSCDROCWKVVOCDZBSWODGY FQJCRBCQNBVJUUNBCYARVNCFX EPIBQABPMAUITTMABXZQUMBEW DOHAPZAOLZTHSSLZAWYPTLADV CNGZOYZNKYSGRRKYZVXOSKZCU BMFYNXYMJXRFQQJXYUWNRJYBT ALEXMWXLIWQEPPIWXTVMQIXAS ZKDWLVWKHVPDOOHVWSULPHWZR YJCVKUVJGUOCNNGUVRTKOGVYQ XIBUJTUIFTNBMMFTUQSJNFUXP WHATISTHESMALLESTPRIMETWO
In sample 1 you will see that the text has been encoded with a shift of 25. So a shift of 25 to the left (the bottom line) is the correctly decoded string. Do note that you do not have to find the correct decoding. Just give all 26 of them, ordered from 0 to 25.
ALEXMWXLIPSRKIWXVMZIVSRIEVXLEQEDSR
ALEXMWXLIPSRKIWXVMZIVSRIEVXLEQEDSR ZKDWLVWKHORQJHVWULYHURQHDUWKDPDCRQ YJCVKUVJGNQPIGUVTKXGTQPGCTVJCOCBQP XIBUJTUIFMPOHFTUSJWFSPOFBSUIBNBAPO WHATISTHELONGESTRIVERONEARTHAMAZON VGZSHRSGDKNMFDRSQHUDQNMDZQSGZLZYNM UFYRGQRFCJMLECQRPGTCPMLCYPRFYKYXML TEXQFPQEBILKDBPQOFSBOLKBXOQEXJXWLK SDWPEOPDAHKJCAOPNERANKJAWNPDWIWVKJ RCVODNOCZGJIBZNOMDQZMJIZVMOCVHVUJI QBUNCMNBYFIHAYMNLCPYLIHYULNBUGUTIH PATMBLMAXEHGZXLMKBOXKHGXTKMATFTSHG OZSLAKLZWDGFYWKLJANWJGFWSJLZSESRGF NYRKZJKYVCFEXVJKIZMVIFEVRIKYRDRQFE MXQJYIJXUBEDWUIJHYLUHEDUQHJXQCQPED LWPIXHIWTADCVTHIGXKTGDCTPGIWPBPODC KVOHWGHVSZCBUSGHFWJSFCBSOFHVOAONCB JUNGVFGURYBATRFGEVIREBARNEGUNZNMBA ITMFUEFTQXAZSQEFDUHQDAZQMDFTMYMLAZ HSLETDESPWZYRPDECTGPCZYPLCESLXLKZY GRKDSCDROVYXQOCDBSFOBYXOKBDRKWKJYX FQJCRBCQNUXWPNBCARENAXWNJACQJVJIXW EPIBQABPMTWVOMABZQDMZWVMIZBPIUIHWV DOHAPZAOLSVUNLZAYPCLYVULHYAOHTHGVU CNGZOYZNKRUTMKYZXOBKXUTKGXZNGSGFUT BMFYNXYMJQTSLJXYWNAJWTSJFWYMFRFETS
In sample 2 you will see that the text has been encoded with a shift of 4. So the 5th line will yield the correctly decoded string.
AAA
AAA ZZZ YYY XXX WWW VVV UUU TTT SSS RRR QQQ PPP OOO NNN MMM LLL KKK JJJ III HHH GGG FFF EEE DDD CCC BBB