QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#497309 | #8654. DRM Messages | bambam | AC ✓ | 1ms | 3808kb | C++17 | 595b | 2024-07-28 22:30:48 | 2024-07-28 22:30:49 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
cin.tie(nullptr)->sync_with_stdio(false);
string s;
cin >> s;
int n = s.size();
string a(s.begin(), s.begin() + n / 2), b(s.begin() + n / 2, s.end());
for (int c = 0; c < 2; ++c, swap(a, b)) {
int sum = 0;
for (auto x : a) sum += x - 'A';
sum %= 26;
for (auto& x : a) x = char((x - 'A' + sum) % 26 + 'A');
}
for (int i = 0; i < a.size(); ++i) {
a[i] = char((a[i] - 'A' + b[i] - 'A') % 26 + 'A');
}
cout << a;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3508kb
input:
EWPGAJRB
output:
ABCD
result:
ok single line: 'ABCD'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3524kb
input:
UEQBJPJCBUDGBNKCAHXCVERXUCVK
output:
ACMECNACONTEST
result:
ok single line: 'ACMECNACONTEST'
Test #3:
score: 0
Accepted
time: 0ms
memory: 3540kb
input:
TPQJDRJWSQXGRRIPXFMINTELHBJA
output:
FIRSTDATAFILEV
result:
ok single line: 'FIRSTDATAFILEV'
Test #4:
score: 0
Accepted
time: 0ms
memory: 3808kb
input:
ZSRSJIYNXOVEDGVDJJBEZBKJUFEROTIVRSMJMN
output:
THISISTHESECONDFILE
result:
ok single line: 'THISISTHESECONDFILE'
Test #5:
score: 0
Accepted
time: 0ms
memory: 3604kb
input:
BDNSBVIGHFOQXREDETCRMVXTCSNVENAWPETCAR
output:
DATAFILENUMBERTHREE
result:
ok single line: 'DATAFILENUMBERTHREE'
Test #6:
score: 0
Accepted
time: 0ms
memory: 3524kb
input:
ORONXMHNNSUJCCGMDDLSUTTDTJIXIZTWPDQTDREPNYZXEAHJMEUUHYTEBHCOPQUBMWNZKEXBGACVKQ
output:
NOWWEAREGOINGTOPROCESSTHEFOURTHDATAFILE
result:
ok single line: 'NOWWEAREGOINGTOPROCESSTHEFOURTHDATAFILE'
Test #7:
score: 0
Accepted
time: 0ms
memory: 3528kb
input:
OXUUYTRGCFWLFFEOAXGYIXTSFMQWNHBVGOIMIMAWZDHXOAVCDIXLVRGANTMAWDEMRVIMNNWJYRSETNBIRLMADBDSDQLCUZGTQICLUICZQHYHIFUNVOOA
output:
DATAFILENUMBERFIVECOMINGUPWATCHOUTFORITHEREITCOMESITSHEREW
result:
ok single line: 'DATAFILENUMBERFIVECOMINGUPWATCHOUTFORITHEREITCOMESITSHEREW'
Test #8:
score: 0
Accepted
time: 0ms
memory: 3516kb
input:
LDIDCWRCLKMSYCPMXGISYZKOIHMXJVFXTISGCPMOUAKNVZNTPLARHNQETHQGQEMDZWYVXFCRVSVGTXAEHLXJCDPGCPZBQK
output:
THISISTHESIXTHINPUTFILEFORTHEDRMMESSAGESPROBLEM
result:
ok single line: 'THISISTHESIXTHINPUTFILEFORTHEDRMMESSAGESPROBLEM'
Test #9:
score: 0
Accepted
time: 0ms
memory: 3776kb
input:
IIOVOSLLXUPCMVJNTLIYCNCPFXRBWPAZFOPVNSHXPVTLVEHLZKOBHKCNEDSFGGHXPIUVXOQQSHSOASLFKPQQIVEURVOFYBWIBIDBRNKKOLOAAXETVHEKUWZJQQQPLSWPBZIZ
output:
NOWUPTODATAFILENUMBERSEVENANDIMSTARTINGTOGETKINDOFTIREDOFDOINGTHIS
result:
ok single line: 'NOWUPTODATAFILENUMBERSEVENANDI...TINGTOGETKINDOFTIREDOFDOINGTHIS'
Test #10:
score: 0
Accepted
time: 0ms
memory: 3528kb
input:
OQEZTKUXBMEPICNWKKDPCFMAEFFHSFJPGMPNNPDEALMEGISYQNZTIERJTSDHJOZHSEXYZRGNPJZMOIQBCAMLPEDL
output:
EIGHTHDATAFILEANDIMGETTINGVERYSLEEPYZZZZZZZZ
result:
ok single line: 'EIGHTHDATAFILEANDIMGETTINGVERYSLEEPYZZZZZZZZ'
Test #11:
score: 0
Accepted
time: 0ms
memory: 3536kb
input:
QRYSCYVTNGJNZBQXGZVSAIYYYIXRLMFKYCOAJIGXNYFUPGYRHOCSRZXDZKYPKNMSECRG
output:
ANDWERENOWUPTOTHENINTHTESTDATAFILE
result:
ok single line: 'ANDWERENOWUPTOTHENINTHTESTDATAFILE'
Test #12:
score: 0
Accepted
time: 0ms
memory: 3520kb
input:
BTNJCR
output:
TEN
result:
ok single line: 'TEN'
Test #13:
score: 0
Accepted
time: 0ms
memory: 3520kb
input:
PEZMNZAOAJWQQORPDFUUCVAMTLADPHSPXZHYECXMAOBXHCWMJZOGEIQNHDZFURVPVEIVJWPSHGYSDICDPUGAYPJARYZNCVGNXVJA
output:
ELEVENISAPRIMENUMBERSOITSEEMSLIKEAGOODPLACETOQUITA
result:
ok single line: 'ELEVENISAPRIMENUMBERSOITSEEMSLIKEAGOODPLACETOQUITA'
Test #14:
score: 0
Accepted
time: 0ms
memory: 3736kb
input:
IEKKKAHDZMKXIZCBILVIXCLYVVNA
output:
TOBEORNOTTOBEI
result:
ok single line: 'TOBEORNOTTOBEI'
Test #15:
score: 0
Accepted
time: 0ms
memory: 3596kb
input:
GOYLHTXJYFUXORNFWIKSSQXLSLOBGQSQWLDHRPVUSWUBIJCPHQHA
output:
TODAYISTALKLIKEAPIRATEDAYK
result:
ok single line: 'TODAYISTALKLIKEAPIRATEDAYK'
Test #16:
score: 0
Accepted
time: 0ms
memory: 3800kb
input:
ZKHJKPURXTGIIGAGEJPOBXHJAZOEIHHDZDYDRQRUBWZVQSGLCBLN
output:
ABCDEFGHIJKLMNOPQRSTUVWXYZ
result:
ok single line: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
Test #17:
score: 0
Accepted
time: 0ms
memory: 3800kb
input:
AREIPAGBICDAICPA
output:
TESTINGM
result:
ok single line: 'TESTINGM'
Test #18:
score: 0
Accepted
time: 1ms
memory: 3588kb
input:
ZTTYGHJILVRPTKLRVGGNEOYMPTGASMUUFXRVNQWVEMQZEQMXVZZO
output:
IWONDERIFTHISISGOINGTOWORK
result:
ok single line: 'IWONDERIFTHISISGOINGTOWORK'
Test #19:
score: 0
Accepted
time: 0ms
memory: 3800kb
input:
QBRNIGACFQEKNDKZNBAIFKTSRTOWLBICGCIFSFSJEEUNOEZEHAOMUQQHVTZRONXYZWISITNWFRLHCAOILJBXNEQEECDKWFGBDUEHZFEITJAMVFTMLORUZVJAVAOHIIEJMFEHAGHHOASPDKKBLVGQJHZVTDCHDYUESCOCFLORROVXJFIRNKNAZURTUMCEHQCXUZTIGTVRUEDVPZWQKWIODBHQYLEZHENRDSZU
output:
DRMENCRYPTIONISANEWKINDOFENCRYPTIONINWHICHTHEENCRYPTEDDRMMESSAGEISDIVIDEDROTATEDANDMERGEDTOFORMTHEDECRYPTEDMESSAGE
result:
ok single line: 'DRMENCRYPTIONISANEWKINDOFENCRY...MERGEDTOFORMTHEDECRYPTEDMESSAGE'
Test #20:
score: 0
Accepted
time: 0ms
memory: 3596kb
input:
PCEXFOHRBGEXULHRZEPIKQYCRVKZWLACMNMDSUHVPUMYHBOKRSGAJDIRVSRKXXVQ
output:
THISPAGEISINTENTIONALLYLEFTBLANK
result:
ok single line: 'THISPAGEISINTENTIONALLYLEFTBLANK'
Test #21:
score: 0
Accepted
time: 0ms
memory: 3520kb
input:
JFQIKONTZYCHXCYAURFLNEDSXNXTQHAHMKQPCJADPBGRXDXGPUFIYTYVPXUJAJZZMXBIPGJQSQOYBFVGYNUTBRYGENOSAFHQCADUXUIDYP
output:
NOWISTHETIMEFORALLGOODMENTOCOMETOTHEAIDOFTHEIRCOUNTRY
result:
ok single line: 'NOWISTHETIMEFORALLGOODMENTOCOMETOTHEAIDOFTHEIRCOUNTRY'
Test #22:
score: 0
Accepted
time: 0ms
memory: 3528kb
input:
OAGDYLDDEWOGCCKQINSRENTEFGKSUZMPULBUFEXZMJFIWOKOXKSWZZKCUIMLXQBKHMZZGBXDPDMXGDEPMQGUICIZPEEVSJIBXFKHTZMA
output:
MYPERSONALOPINIONNOTSPEAKINGFORIBMISTHATDRMISSTUPIDV
result:
ok single line: 'MYPERSONALOPINIONNOTSPEAKINGFORIBMISTHATDRMISSTUPIDV'
Test #23:
score: 0
Accepted
time: 0ms
memory: 3476kb
input:
QUBZIGTBDTINQGFVTVPEJRUKOLFUURWBLHTBJEYGAYWYPNSWSMNCWBLIWPOZOKAKCEJJUUHFNQCXCXTMAUMQJCRAZNYNSTFWIPAIZYWIKJIGYQEILWEGFMYYHZPUCRWYZGJCGNCNGJQKADXYIPITLTPOYQZMCUGANGEDMJRXCLMLOUJDNHJNHJJEXQUGGGDTCECGUDWEMEVXPECAQDXQIGHBWOQYIZIIKQNFRPDOHGAREEYLENGMNOWWPFHCVSMPHZTPYQQHQVYXAITCZJRGVQUEZLTNZBFWFMJTUQCIZESL...
output:
CRYPTOGRAPHYISTHESCIENCEANDSTUDYOFSECRETWRITINGACIPHERISASECRETMETHODOFWRITINGWHEREBYPLAINTEXTORCLEARTEXTISTRANSFORMEDINTOCIPHERTEXTSOMETIMESCALLEDACRYPTOGRAMTHEPROCESSOFTRANSFORMINGPLAINTEXTINTOCIPHERTEXTISCALLEDENCIPHERMENTORENCRYPTIONTHEREVERSEPROCESSOFTRANSFORMINGCIPHERTEXTINTOPLAINTEXTISCALLEDD...
result:
ok single line: 'CRYPTOGRAPHYISTHESCIENCEANDSTU...RANGEBITSORCHARACTERSINTHEDATAA'
Test #24:
score: 0
Accepted
time: 0ms
memory: 3588kb
input:
IOITLIWYVGZFHDONESAAJGJDMXJZZMUOTVVUICYQCUEKPNSIOTGHMUVJAGVOIJFESZYGNSNSUDQLDEPPRIWMCIVJGQICALPUPKWUSNMPOSCWCBNVYGZQWECSDSCGUIQMGSPGYUGMGBDIILCIXQTYNOTTKTHSSEQWODMZHXOPUJVOIGFGIANWGPZZJTRVIHJVOSYFSCCSRBZIPOHYAZDSQOBDIPHFXYCNTETBDXPPJYQPXRGHMXANJTEGMMXBHBLCFGMYEHOYKVSBTTNRTGZCKZXZSYORVIYUROEJQIIMZEBZ...
output:
ACONCURRENTPROGRAMCONSISTSOFSEQUENTIALPROCESSESTHATARECARRIEDOUTSIMULTANEOUSLYTHEPROCESSESCOOPERATEONCOMMONTASKSBYEXCHANGINGDATATHROUGHSHAREDVARIABLESTHEPROBLEMISTHATUNRESTRICTEDACCESSTOTHESHAREDVARIABLESCANMAKETHERESULTOFACONCURRENTPROGRAMDEPENDANTONTHERELATIVESPEEDSOFITSPROCESSESTHISISOBVIOUSIFYOU...
result:
ok single line: 'ACONCURRENTPROGRAMCONSISTSOFSE...NDEVENTHENYOUCANNOTBESUREITWILL'
Test #25:
score: 0
Accepted
time: 0ms
memory: 3620kb
input:
XHFWQYWMSVAJJHMCYXDRLURHDXESHQADVDRCKEPHIYLBYNKIDSOAQRQGQLCCWSNQJKEKICJLXHGBUFUMILWNQXKDYLXRNKRLPJPXCYGCQXZIGUKPCEGQENSUOWPUUIHBLVCHMLWKJRLTCWRDGNOQUUGUAYQYJTUGPOJWFMDLNISLGZUYWXSBRQZXGEGLBIHTFUIUITWHQWZWMKSKRMNOUKUEXNYVZOXULCHBLNOTXYMZQQNBYAICYCYTZGMDQRDYBLJLLSYLJBWGFVLIGDNMUMDYPWVKCRFRQAAMKSAWPKRB...
output:
LOREMIPSUMDOLORSITAMETCONSECTETURADIPISCINGELITVIVAMUSSEDEFFICITURNEQUENULLADAPIBUSEGESTASDIAMVESTIBULUMINBIBENDUMFELISNULLAQUISVENENATISDUIETIAMINFACILISISSAPIENMAURISJUSTOPURUSSEMPERINBLANDITUTMALESUADASEDRISUSETIAMRUTRUMEXSEMVITAEINTERDUMLOREMCONDIMENTUMNECDUISVARIUSNIBHELITFERMENTUMCONSECTETURLA...
result:
ok single line: 'LOREMIPSUMDOLORSITAMETCONSECTE...INGELITQUISQUEMALESUADATURPISID'
Test #26:
score: 0
Accepted
time: 0ms
memory: 3772kb
input:
UCFAAQIAKGNWPUQKDATJROEQLRXCMSCIYWAOVPEOVEVKLBSIQBZPFRDSLICMSROUVYQIBMGTRXZWFEUIZWSIVJEVDBNFXAHYZMKIYWKLSNNYEDEDPISLJWAXTWGXCBYIVZTVGSXNXQHVJEKMUKLDFHKXEJTFEZOZHPLEGDDORVDEQIUZTJBPEJKNYTSYUGXAYTDPNHKNYGMBYUJNKOYSOGZXEDPUSFHXXERYWFGQKMAANVUXGWHZELOUSGFONMFDWMOWTMDLZYRNMMJYWSPSDEVIKFEYRWARXXZUVEMIHRMI...
output:
THETECHMODELRAILROADCLUBJUSTWHYPETERSAMSONWASWANDERINGAROUNDINBUILDINGINTHEMIDDLEOFTHENIGHTISAMATTERTHATHEWOULDFINDDIFFICULTTOEXPLAINSOMETHINGSARENOTSPOKENIFYOUWERELIKETHEPEOPLEWHOMPETERSAMSONWASCOMINGTOKNOWANDBEFRIENDINTHISHISFRESHMANYEARATTHEMASSACHUSETTSINSTITUTEOFTECHNOLOGYINTHEWINTEROFNOEXPLANA...
result:
ok single line: 'THETECHMODELRAILROADCLUBJUSTWH...THETECHMODELRAILROADCLUBORTMRCY'
Test #27:
score: 0
Accepted
time: 0ms
memory: 3732kb
input:
MB
output:
A
result:
ok single line: 'A'
Test #28:
score: 0
Accepted
time: 0ms
memory: 3476kb
input:
BD
output:
I
result:
ok single line: 'I'
Test #29:
score: 0
Accepted
time: 0ms
memory: 3564kb
input:
BB
output:
E
result:
ok single line: 'E'
Test #30:
score: 0
Accepted
time: 0ms
memory: 3592kb
input:
HH
output:
C
result:
ok single line: 'C'
Test #31:
score: 0
Accepted
time: 0ms
memory: 3560kb
input:
LCKFQGUZXRPOVOYHRRIHXEFZLAEJPVMTYBTPPPUAGPLYKBFDLCBEHOXYJIEOIKPPERJXCUGYADICFXVNSHYBLRDBKIBCRJVRPPSBYISLPWGQKBSZHNVFMWIWKJFWCRUUCFTYIETJQOWHJPAVQAMJGLQTLXPPSRTIMQDFOOXBKAYKAEOUIRXWKJRLFSXXCEYMYALAFBYFJMLQKIUJUPZXQCMNCZDJJNFUPOGWXPVYEJJULWAMHLZUPTLOOZONDMZTYPSHUUYACQZSMUZXLSMDUHIGWUQNAMANFTBZOQFEMTWD...
output:
WELLPRINCESOGENOAANDLUCCAARENOWJUSTFAMILYESTATESOFTHEBUONAPARTESBUTIWARNYOUIFYOUDONTTELLMETHATTHISMEANSWARIFYOUSTILLTRYTODEFENDTHEINFAMIESANDHORRORSPERPETRATEDBYTHATANTICHRISTIREALLYBELIEVEHEISANTICHRISTIWILLHAVENOTHINGMORETODOWITHYOUANDYOUARENOLONGERMYFRIENDNOLONGERMYFAITHFULSLAVEASYOUCALLYOURSELFB...
result:
ok single line: 'WELLPRINCESOGENOAANDLUCCAARENO...YOLDMAIDSHAVEAMANIAFORMATCHMAKF'