QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#467853 | #8654. DRM Messages | Bahnasy# | AC ✓ | 0ms | 3860kb | C++20 | 1.1kb | 2024-07-08 17:54:05 | 2024-07-08 17:54:05 |
Judging History
answer
// #pragma GCC target("avx2,avx512f,avx512vl,avx512bw,avx512dq,avx512cd,avx512vbmi,avx512vbmi2,avx512vpopcntdq,avx512bitalg,bmi,bmi2,lzcnt,popcnt")
// #pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
using namespace std;
signed main() {
ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
string s;
cin >> s;
int n = s.size();
string a = s.substr(0, n / 2);
string b = s.substr(n/2, n / 2);
int sum = 0;
for (auto& i : a) {
sum += (i - 'A');
}
for (int i = 0; i < n / 2;i++) {
int cur = a[i] - 'A';
int nw = cur + sum;
nw %= 26;
a[i] = char('A' + nw);
}
sum = 0;
for (auto& i : b) {
sum += (i - 'A');
}
for (int i = 0; i < n / 2; i++) {
int cur = b[i] - 'A';
int nw = cur + sum;
nw %= 26;
b[i] = char('A' + nw);
}
for (int i = 0; i < n / 2; i++) {
int cur = (a[i] - 'A') + (b[i] - 'A');
cur %= 26;
cout << char('A' + cur);
}
cout << "\n";
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3564kb
input:
EWPGAJRB
output:
ABCD
result:
ok single line: 'ABCD'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3504kb
input:
UEQBJPJCBUDGBNKCAHXCVERXUCVK
output:
ACMECNACONTEST
result:
ok single line: 'ACMECNACONTEST'
Test #3:
score: 0
Accepted
time: 0ms
memory: 3860kb
input:
TPQJDRJWSQXGRRIPXFMINTELHBJA
output:
FIRSTDATAFILEV
result:
ok single line: 'FIRSTDATAFILEV'
Test #4:
score: 0
Accepted
time: 0ms
memory: 3556kb
input:
ZSRSJIYNXOVEDGVDJJBEZBKJUFEROTIVRSMJMN
output:
THISISTHESECONDFILE
result:
ok single line: 'THISISTHESECONDFILE'
Test #5:
score: 0
Accepted
time: 0ms
memory: 3556kb
input:
BDNSBVIGHFOQXREDETCRMVXTCSNVENAWPETCAR
output:
DATAFILENUMBERTHREE
result:
ok single line: 'DATAFILENUMBERTHREE'
Test #6:
score: 0
Accepted
time: 0ms
memory: 3816kb
input:
ORONXMHNNSUJCCGMDDLSUTTDTJIXIZTWPDQTDREPNYZXEAHJMEUUHYTEBHCOPQUBMWNZKEXBGACVKQ
output:
NOWWEAREGOINGTOPROCESSTHEFOURTHDATAFILE
result:
ok single line: 'NOWWEAREGOINGTOPROCESSTHEFOURTHDATAFILE'
Test #7:
score: 0
Accepted
time: 0ms
memory: 3552kb
input:
OXUUYTRGCFWLFFEOAXGYIXTSFMQWNHBVGOIMIMAWZDHXOAVCDIXLVRGANTMAWDEMRVIMNNWJYRSETNBIRLMADBDSDQLCUZGTQICLUICZQHYHIFUNVOOA
output:
DATAFILENUMBERFIVECOMINGUPWATCHOUTFORITHEREITCOMESITSHEREW
result:
ok single line: 'DATAFILENUMBERFIVECOMINGUPWATCHOUTFORITHEREITCOMESITSHEREW'
Test #8:
score: 0
Accepted
time: 0ms
memory: 3560kb
input:
LDIDCWRCLKMSYCPMXGISYZKOIHMXJVFXTISGCPMOUAKNVZNTPLARHNQETHQGQEMDZWYVXFCRVSVGTXAEHLXJCDPGCPZBQK
output:
THISISTHESIXTHINPUTFILEFORTHEDRMMESSAGESPROBLEM
result:
ok single line: 'THISISTHESIXTHINPUTFILEFORTHEDRMMESSAGESPROBLEM'
Test #9:
score: 0
Accepted
time: 0ms
memory: 3504kb
input:
IIOVOSLLXUPCMVJNTLIYCNCPFXRBWPAZFOPVNSHXPVTLVEHLZKOBHKCNEDSFGGHXPIUVXOQQSHSOASLFKPQQIVEURVOFYBWIBIDBRNKKOLOAAXETVHEKUWZJQQQPLSWPBZIZ
output:
NOWUPTODATAFILENUMBERSEVENANDIMSTARTINGTOGETKINDOFTIREDOFDOINGTHIS
result:
ok single line: 'NOWUPTODATAFILENUMBERSEVENANDI...TINGTOGETKINDOFTIREDOFDOINGTHIS'
Test #10:
score: 0
Accepted
time: 0ms
memory: 3784kb
input:
OQEZTKUXBMEPICNWKKDPCFMAEFFHSFJPGMPNNPDEALMEGISYQNZTIERJTSDHJOZHSEXYZRGNPJZMOIQBCAMLPEDL
output:
EIGHTHDATAFILEANDIMGETTINGVERYSLEEPYZZZZZZZZ
result:
ok single line: 'EIGHTHDATAFILEANDIMGETTINGVERYSLEEPYZZZZZZZZ'
Test #11:
score: 0
Accepted
time: 0ms
memory: 3616kb
input:
QRYSCYVTNGJNZBQXGZVSAIYYYIXRLMFKYCOAJIGXNYFUPGYRHOCSRZXDZKYPKNMSECRG
output:
ANDWERENOWUPTOTHENINTHTESTDATAFILE
result:
ok single line: 'ANDWERENOWUPTOTHENINTHTESTDATAFILE'
Test #12:
score: 0
Accepted
time: 0ms
memory: 3560kb
input:
BTNJCR
output:
TEN
result:
ok single line: 'TEN'
Test #13:
score: 0
Accepted
time: 0ms
memory: 3628kb
input:
PEZMNZAOAJWQQORPDFUUCVAMTLADPHSPXZHYECXMAOBXHCWMJZOGEIQNHDZFURVPVEIVJWPSHGYSDICDPUGAYPJARYZNCVGNXVJA
output:
ELEVENISAPRIMENUMBERSOITSEEMSLIKEAGOODPLACETOQUITA
result:
ok single line: 'ELEVENISAPRIMENUMBERSOITSEEMSLIKEAGOODPLACETOQUITA'
Test #14:
score: 0
Accepted
time: 0ms
memory: 3656kb
input:
IEKKKAHDZMKXIZCBILVIXCLYVVNA
output:
TOBEORNOTTOBEI
result:
ok single line: 'TOBEORNOTTOBEI'
Test #15:
score: 0
Accepted
time: 0ms
memory: 3792kb
input:
GOYLHTXJYFUXORNFWIKSSQXLSLOBGQSQWLDHRPVUSWUBIJCPHQHA
output:
TODAYISTALKLIKEAPIRATEDAYK
result:
ok single line: 'TODAYISTALKLIKEAPIRATEDAYK'
Test #16:
score: 0
Accepted
time: 0ms
memory: 3632kb
input:
ZKHJKPURXTGIIGAGEJPOBXHJAZOEIHHDZDYDRQRUBWZVQSGLCBLN
output:
ABCDEFGHIJKLMNOPQRSTUVWXYZ
result:
ok single line: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
Test #17:
score: 0
Accepted
time: 0ms
memory: 3788kb
input:
AREIPAGBICDAICPA
output:
TESTINGM
result:
ok single line: 'TESTINGM'
Test #18:
score: 0
Accepted
time: 0ms
memory: 3820kb
input:
ZTTYGHJILVRPTKLRVGGNEOYMPTGASMUUFXRVNQWVEMQZEQMXVZZO
output:
IWONDERIFTHISISGOINGTOWORK
result:
ok single line: 'IWONDERIFTHISISGOINGTOWORK'
Test #19:
score: 0
Accepted
time: 0ms
memory: 3612kb
input:
QBRNIGACFQEKNDKZNBAIFKTSRTOWLBICGCIFSFSJEEUNOEZEHAOMUQQHVTZRONXYZWISITNWFRLHCAOILJBXNEQEECDKWFGBDUEHZFEITJAMVFTMLORUZVJAVAOHIIEJMFEHAGHHOASPDKKBLVGQJHZVTDCHDYUESCOCFLORROVXJFIRNKNAZURTUMCEHQCXUZTIGTVRUEDVPZWQKWIODBHQYLEZHENRDSZU
output:
DRMENCRYPTIONISANEWKINDOFENCRYPTIONINWHICHTHEENCRYPTEDDRMMESSAGEISDIVIDEDROTATEDANDMERGEDTOFORMTHEDECRYPTEDMESSAGE
result:
ok single line: 'DRMENCRYPTIONISANEWKINDOFENCRY...MERGEDTOFORMTHEDECRYPTEDMESSAGE'
Test #20:
score: 0
Accepted
time: 0ms
memory: 3612kb
input:
PCEXFOHRBGEXULHRZEPIKQYCRVKZWLACMNMDSUHVPUMYHBOKRSGAJDIRVSRKXXVQ
output:
THISPAGEISINTENTIONALLYLEFTBLANK
result:
ok single line: 'THISPAGEISINTENTIONALLYLEFTBLANK'
Test #21:
score: 0
Accepted
time: 0ms
memory: 3624kb
input:
JFQIKONTZYCHXCYAURFLNEDSXNXTQHAHMKQPCJADPBGRXDXGPUFIYTYVPXUJAJZZMXBIPGJQSQOYBFVGYNUTBRYGENOSAFHQCADUXUIDYP
output:
NOWISTHETIMEFORALLGOODMENTOCOMETOTHEAIDOFTHEIRCOUNTRY
result:
ok single line: 'NOWISTHETIMEFORALLGOODMENTOCOMETOTHEAIDOFTHEIRCOUNTRY'
Test #22:
score: 0
Accepted
time: 0ms
memory: 3620kb
input:
OAGDYLDDEWOGCCKQINSRENTEFGKSUZMPULBUFEXZMJFIWOKOXKSWZZKCUIMLXQBKHMZZGBXDPDMXGDEPMQGUICIZPEEVSJIBXFKHTZMA
output:
MYPERSONALOPINIONNOTSPEAKINGFORIBMISTHATDRMISSTUPIDV
result:
ok single line: 'MYPERSONALOPINIONNOTSPEAKINGFORIBMISTHATDRMISSTUPIDV'
Test #23:
score: 0
Accepted
time: 0ms
memory: 3788kb
input:
QUBZIGTBDTINQGFVTVPEJRUKOLFUURWBLHTBJEYGAYWYPNSWSMNCWBLIWPOZOKAKCEJJUUHFNQCXCXTMAUMQJCRAZNYNSTFWIPAIZYWIKJIGYQEILWEGFMYYHZPUCRWYZGJCGNCNGJQKADXYIPITLTPOYQZMCUGANGEDMJRXCLMLOUJDNHJNHJJEXQUGGGDTCECGUDWEMEVXPECAQDXQIGHBWOQYIZIIKQNFRPDOHGAREEYLENGMNOWWPFHCVSMPHZTPYQQHQVYXAITCZJRGVQUEZLTNZBFWFMJTUQCIZESL...
output:
CRYPTOGRAPHYISTHESCIENCEANDSTUDYOFSECRETWRITINGACIPHERISASECRETMETHODOFWRITINGWHEREBYPLAINTEXTORCLEARTEXTISTRANSFORMEDINTOCIPHERTEXTSOMETIMESCALLEDACRYPTOGRAMTHEPROCESSOFTRANSFORMINGPLAINTEXTINTOCIPHERTEXTISCALLEDENCIPHERMENTORENCRYPTIONTHEREVERSEPROCESSOFTRANSFORMINGCIPHERTEXTINTOPLAINTEXTISCALLEDD...
result:
ok single line: 'CRYPTOGRAPHYISTHESCIENCEANDSTU...RANGEBITSORCHARACTERSINTHEDATAA'
Test #24:
score: 0
Accepted
time: 0ms
memory: 3560kb
input:
IOITLIWYVGZFHDONESAAJGJDMXJZZMUOTVVUICYQCUEKPNSIOTGHMUVJAGVOIJFESZYGNSNSUDQLDEPPRIWMCIVJGQICALPUPKWUSNMPOSCWCBNVYGZQWECSDSCGUIQMGSPGYUGMGBDIILCIXQTYNOTTKTHSSEQWODMZHXOPUJVOIGFGIANWGPZZJTRVIHJVOSYFSCCSRBZIPOHYAZDSQOBDIPHFXYCNTETBDXPPJYQPXRGHMXANJTEGMMXBHBLCFGMYEHOYKVSBTTNRTGZCKZXZSYORVIYUROEJQIIMZEBZ...
output:
ACONCURRENTPROGRAMCONSISTSOFSEQUENTIALPROCESSESTHATARECARRIEDOUTSIMULTANEOUSLYTHEPROCESSESCOOPERATEONCOMMONTASKSBYEXCHANGINGDATATHROUGHSHAREDVARIABLESTHEPROBLEMISTHATUNRESTRICTEDACCESSTOTHESHAREDVARIABLESCANMAKETHERESULTOFACONCURRENTPROGRAMDEPENDANTONTHERELATIVESPEEDSOFITSPROCESSESTHISISOBVIOUSIFYOU...
result:
ok single line: 'ACONCURRENTPROGRAMCONSISTSOFSE...NDEVENTHENYOUCANNOTBESUREITWILL'
Test #25:
score: 0
Accepted
time: 0ms
memory: 3600kb
input:
XHFWQYWMSVAJJHMCYXDRLURHDXESHQADVDRCKEPHIYLBYNKIDSOAQRQGQLCCWSNQJKEKICJLXHGBUFUMILWNQXKDYLXRNKRLPJPXCYGCQXZIGUKPCEGQENSUOWPUUIHBLVCHMLWKJRLTCWRDGNOQUUGUAYQYJTUGPOJWFMDLNISLGZUYWXSBRQZXGEGLBIHTFUIUITWHQWZWMKSKRMNOUKUEXNYVZOXULCHBLNOTXYMZQQNBYAICYCYTZGMDQRDYBLJLLSYLJBWGFVLIGDNMUMDYPWVKCRFRQAAMKSAWPKRB...
output:
LOREMIPSUMDOLORSITAMETCONSECTETURADIPISCINGELITVIVAMUSSEDEFFICITURNEQUENULLADAPIBUSEGESTASDIAMVESTIBULUMINBIBENDUMFELISNULLAQUISVENENATISDUIETIAMINFACILISISSAPIENMAURISJUSTOPURUSSEMPERINBLANDITUTMALESUADASEDRISUSETIAMRUTRUMEXSEMVITAEINTERDUMLOREMCONDIMENTUMNECDUISVARIUSNIBHELITFERMENTUMCONSECTETURLA...
result:
ok single line: 'LOREMIPSUMDOLORSITAMETCONSECTE...INGELITQUISQUEMALESUADATURPISID'
Test #26:
score: 0
Accepted
time: 0ms
memory: 3656kb
input:
UCFAAQIAKGNWPUQKDATJROEQLRXCMSCIYWAOVPEOVEVKLBSIQBZPFRDSLICMSROUVYQIBMGTRXZWFEUIZWSIVJEVDBNFXAHYZMKIYWKLSNNYEDEDPISLJWAXTWGXCBYIVZTVGSXNXQHVJEKMUKLDFHKXEJTFEZOZHPLEGDDORVDEQIUZTJBPEJKNYTSYUGXAYTDPNHKNYGMBYUJNKOYSOGZXEDPUSFHXXERYWFGQKMAANVUXGWHZELOUSGFONMFDWMOWTMDLZYRNMMJYWSPSDEVIKFEYRWARXXZUVEMIHRMI...
output:
THETECHMODELRAILROADCLUBJUSTWHYPETERSAMSONWASWANDERINGAROUNDINBUILDINGINTHEMIDDLEOFTHENIGHTISAMATTERTHATHEWOULDFINDDIFFICULTTOEXPLAINSOMETHINGSARENOTSPOKENIFYOUWERELIKETHEPEOPLEWHOMPETERSAMSONWASCOMINGTOKNOWANDBEFRIENDINTHISHISFRESHMANYEARATTHEMASSACHUSETTSINSTITUTEOFTECHNOLOGYINTHEWINTEROFNOEXPLANA...
result:
ok single line: 'THETECHMODELRAILROADCLUBJUSTWH...THETECHMODELRAILROADCLUBORTMRCY'
Test #27:
score: 0
Accepted
time: 0ms
memory: 3628kb
input:
MB
output:
A
result:
ok single line: 'A'
Test #28:
score: 0
Accepted
time: 0ms
memory: 3656kb
input:
BD
output:
I
result:
ok single line: 'I'
Test #29:
score: 0
Accepted
time: 0ms
memory: 3620kb
input:
BB
output:
E
result:
ok single line: 'E'
Test #30:
score: 0
Accepted
time: 0ms
memory: 3784kb
input:
HH
output:
C
result:
ok single line: 'C'
Test #31:
score: 0
Accepted
time: 0ms
memory: 3652kb
input:
LCKFQGUZXRPOVOYHRRIHXEFZLAEJPVMTYBTPPPUAGPLYKBFDLCBEHOXYJIEOIKPPERJXCUGYADICFXVNSHYBLRDBKIBCRJVRPPSBYISLPWGQKBSZHNVFMWIWKJFWCRUUCFTYIETJQOWHJPAVQAMJGLQTLXPPSRTIMQDFOOXBKAYKAEOUIRXWKJRLFSXXCEYMYALAFBYFJMLQKIUJUPZXQCMNCZDJJNFUPOGWXPVYEJJULWAMHLZUPTLOOZONDMZTYPSHUUYACQZSMUZXLSMDUHIGWUQNAMANFTBZOQFEMTWD...
output:
WELLPRINCESOGENOAANDLUCCAARENOWJUSTFAMILYESTATESOFTHEBUONAPARTESBUTIWARNYOUIFYOUDONTTELLMETHATTHISMEANSWARIFYOUSTILLTRYTODEFENDTHEINFAMIESANDHORRORSPERPETRATEDBYTHATANTICHRISTIREALLYBELIEVEHEISANTICHRISTIWILLHAVENOTHINGMORETODOWITHYOUANDYOUARENOLONGERMYFRIENDNOLONGERMYFAITHFULSLAVEASYOUCALLYOURSELFB...
result:
ok single line: 'WELLPRINCESOGENOAANDLUCCAARENO...YOLDMAIDSHAVEAMANIAFORMATCHMAKF'