Submission #904190

#TimeUsernameProblemLanguageResultExecution timeMemory
904190phoebeParrots (IOI11_parrots)C++17
0 / 100
1 ms1320 KiB
#include <bits/stdc++.h> #include "encoder.h" #include "encoderlib.h" using namespace std; #define ll unsigned long long static const int maxx = 31; static ll idx, dp[40][32] = {{1ULL,1ULL,1ULL,1ULL,1ULL,1ULL,1ULL,1ULL,1ULL,1ULL,1ULL,1ULL,1ULL,1ULL,1ULL,1ULL,1ULL,1ULL,1ULL,1ULL,1ULL,1ULL,1ULL,1ULL,1ULL,1ULL,1ULL,1ULL,1ULL,1ULL,1ULL,1ULL},{32ULL,31ULL,30ULL,29ULL,28ULL,27ULL,26ULL,25ULL,24ULL,23ULL,22ULL,21ULL,20ULL,19ULL,18ULL,17ULL,16ULL,15ULL,14ULL,13ULL,12ULL,11ULL,10ULL,9ULL,8ULL,7ULL,6ULL,5ULL,4ULL,3ULL,2ULL,1ULL},{528ULL,496ULL,465ULL,435ULL,406ULL,378ULL,351ULL,325ULL,300ULL,276ULL,253ULL,231ULL,210ULL,190ULL,171ULL,153ULL,136ULL,120ULL,105ULL,91ULL,78ULL,66ULL,55ULL,45ULL,36ULL,28ULL,21ULL,15ULL,10ULL,6ULL,3ULL,1ULL},{5984ULL,5456ULL,4960ULL,4495ULL,4060ULL,3654ULL,3276ULL,2925ULL,2600ULL,2300ULL,2024ULL,1771ULL,1540ULL,1330ULL,1140ULL,969ULL,816ULL,680ULL,560ULL,455ULL,364ULL,286ULL,220ULL,165ULL,120ULL,84ULL,56ULL,35ULL,20ULL,10ULL,4ULL,1ULL},{52360ULL,46376ULL,40920ULL,35960ULL,31465ULL,27405ULL,23751ULL,20475ULL,17550ULL,14950ULL,12650ULL,10626ULL,8855ULL,7315ULL,5985ULL,4845ULL,3876ULL,3060ULL,2380ULL,1820ULL,1365ULL,1001ULL,715ULL,495ULL,330ULL,210ULL,126ULL,70ULL,35ULL,15ULL,5ULL,1ULL},{376992ULL,324632ULL,278256ULL,237336ULL,201376ULL,169911ULL,142506ULL,118755ULL,98280ULL,80730ULL,65780ULL,53130ULL,42504ULL,33649ULL,26334ULL,20349ULL,15504ULL,11628ULL,8568ULL,6188ULL,4368ULL,3003ULL,2002ULL,1287ULL,792ULL,462ULL,252ULL,126ULL,56ULL,21ULL,6ULL,1ULL},{2324784ULL,1947792ULL,1623160ULL,1344904ULL,1107568ULL,906192ULL,736281ULL,593775ULL,475020ULL,376740ULL,296010ULL,230230ULL,177100ULL,134596ULL,100947ULL,74613ULL,54264ULL,38760ULL,27132ULL,18564ULL,12376ULL,8008ULL,5005ULL,3003ULL,1716ULL,924ULL,462ULL,210ULL,84ULL,28ULL,7ULL,1ULL},{12620256ULL,10295472ULL,8347680ULL,6724520ULL,5379616ULL,4272048ULL,3365856ULL,2629575ULL,2035800ULL,1560780ULL,1184040ULL,888030ULL,657800ULL,480700ULL,346104ULL,245157ULL,170544ULL,116280ULL,77520ULL,50388ULL,31824ULL,19448ULL,11440ULL,6435ULL,3432ULL,1716ULL,792ULL,330ULL,120ULL,36ULL,8ULL,1ULL},{61523748ULL,48903492ULL,38608020ULL,30260340ULL,23535820ULL,18156204ULL,13884156ULL,10518300ULL,7888725ULL,5852925ULL,4292145ULL,3108105ULL,2220075ULL,1562275ULL,1081575ULL,735471ULL,490314ULL,319770ULL,203490ULL,125970ULL,75582ULL,43758ULL,24310ULL,12870ULL,6435ULL,3003ULL,1287ULL,495ULL,165ULL,45ULL,9ULL,1ULL},{273438880ULL,211915132ULL,163011640ULL,124403620ULL,94143280ULL,70607460ULL,52451256ULL,38567100ULL,28048800ULL,20160075ULL,14307150ULL,10015005ULL,6906900ULL,4686825ULL,3124550ULL,2042975ULL,1307504ULL,817190ULL,497420ULL,293930ULL,167960ULL,92378ULL,48620ULL,24310ULL,11440ULL,5005ULL,2002ULL,715ULL,220ULL,55ULL,10ULL,1ULL},{1121099408ULL,847660528ULL,635745396ULL,472733756ULL,348330136ULL,254186856ULL,183579396ULL,131128140ULL,92561040ULL,64512240ULL,44352165ULL,30045015ULL,20030010ULL,13123110ULL,8436285ULL,5311735ULL,3268760ULL,1961256ULL,1144066ULL,646646ULL,352716ULL,184756ULL,92378ULL,43758ULL,19448ULL,8008ULL,3003ULL,1001ULL,286ULL,66ULL,11ULL,1ULL},{4280561376ULL,3159461968ULL,2311801440ULL,1676056044ULL,1203322288ULL,854992152ULL,600805296ULL,417225900ULL,286097760ULL,193536720ULL,129024480ULL,84672315ULL,54627300ULL,34597290ULL,21474180ULL,13037895ULL,7726160ULL,4457400ULL,2496144ULL,1352078ULL,705432ULL,352716ULL,167960ULL,75582ULL,31824ULL,12376ULL,4368ULL,1365ULL,364ULL,78ULL,12ULL,1ULL},{15338678264ULL,11058116888ULL,7898654920ULL,5586853480ULL,3910797436ULL,2707475148ULL,1852482996ULL,1251677700ULL,834451800ULL,548354040ULL,354817320ULL,225792840ULL,141120525ULL,86493225ULL,51895935ULL,30421755ULL,17383860ULL,9657700ULL,5200300ULL,2704156ULL,1352078ULL,646646ULL,293930ULL,125970ULL,50388ULL,18564ULL,6188ULL,1820ULL,455ULL,91ULL,13ULL,1ULL},{51915526432ULL,36576848168ULL,25518731280ULL,17620076360ULL,12033222880ULL,8122425444ULL,5414950296ULL,3562467300ULL,2310789600ULL,1476337800ULL,927983760ULL,573166440ULL,347373600ULL,206253075ULL,119759850ULL,67863915ULL,37442160ULL,20058300ULL,10400600ULL,5200300ULL,2496144ULL,1144066ULL,497420ULL,203490ULL,77520ULL,27132ULL,8568ULL,2380ULL,560ULL,105ULL,14ULL,1ULL},{166871334960ULL,114955808528ULL,78378960360ULL,52860229080ULL,35240152720ULL,23206929840ULL,15084504396ULL,9669554100ULL,6107086800ULL,3796297200ULL,2319959400ULL,1391975640ULL,818809200ULL,471435600ULL,265182525ULL,145422675ULL,77558760ULL,40116600ULL,20058300ULL,9657700ULL,4457400ULL,1961256ULL,817190ULL,319770ULL,116280ULL,38760ULL,11628ULL,3060ULL,680ULL,120ULL,15ULL,1ULL},{511738760544ULL,344867425584ULL,229911617056ULL,151532656696ULL,98672427616ULL,63432274896ULL,40225345056ULL,25140840660ULL,15471286560ULL,9364199760ULL,5567902560ULL,3247943160ULL,1855967520ULL,1037158320ULL,565722720ULL,300540195ULL,155117520ULL,77558760ULL,37442160ULL,17383860ULL,7726160ULL,3268760ULL,1307504ULL,490314ULL,170544ULL,54264ULL,15504ULL,3876ULL,816ULL,136ULL,16ULL,1ULL},{1503232609098ULL,991493848554ULL,646626422970ULL,416714805914ULL,265182149218ULL,166509721602ULL,103077446706ULL,62852101650ULL,37711260990ULL,22239974430ULL,12875774670ULL,7307872110ULL,4059928950ULL,2203961430ULL,1166803110ULL,601080390ULL,300540195ULL,145422675ULL,67863915ULL,30421755ULL,13037895ULL,5311735ULL,2042975ULL,735471ULL,245157ULL,74613ULL,20349ULL,4845ULL,969ULL,153ULL,17ULL,1ULL},{4244421484512ULL,2741188875414ULL,1749695026860ULL,1103068603890ULL,686353797976ULL,421171648758ULL,254661927156ULL,151584480450ULL,88732378800ULL,51021117810ULL,28781143380ULL,15905368710ULL,8597496600ULL,4537567650ULL,2333606220ULL,1166803110ULL,565722720ULL,265182525ULL,119759850ULL,51895935ULL,21474180ULL,8436285ULL,3124550ULL,1081575ULL,346104ULL,100947ULL,26334ULL,5985ULL,1140ULL,171ULL,18ULL,1ULL},{11554258485616ULL,7309837001104ULL,4568648125690ULL,2818953098830ULL,1715884494940ULL,1029530696964ULL,608359048206ULL,353697121050ULL,202112640600ULL,113380261800ULL,62359143990ULL,33578000610ULL,17672631900ULL,9075135300ULL,4537567650ULL,2203961430ULL,1037158320ULL,471435600ULL,206253075ULL,86493225ULL,34597290ULL,13123110ULL,4686825ULL,1562275ULL,480700ULL,134596ULL,33649ULL,7315ULL,1330ULL,190ULL,19ULL,1ULL},{30405943383200ULL,18851684897584ULL,11541847896480ULL,6973199770790ULL,4154246671960ULL,2438362177020ULL,1408831480056ULL,800472431850ULL,446775310800ULL,244662670200ULL,131282408400ULL,68923264410ULL,35345263800ULL,17672631900ULL,8597496600ULL,4059928950ULL,1855967520ULL,818809200ULL,347373600ULL,141120525ULL,54627300ULL,20030010ULL,6906900ULL,2220075ULL,657800ULL,177100ULL,42504ULL,8855ULL,1540ULL,210ULL,20ULL,1ULL},{77535155627160ULL,47129212243960ULL,28277527346376ULL,16735679449896ULL,9762479679106ULL,5608233007146ULL,3169870830126ULL,1761039350070ULL,960566918220ULL,513791607420ULL,269128937220ULL,137846528820ULL,68923264410ULL,33578000610ULL,15905368710ULL,7307872110ULL,3247943160ULL,1391975640ULL,573166440ULL,225792840ULL,84672315ULL,30045015ULL,10015005ULL,3108105ULL,888030ULL,230230ULL,53130ULL,10626ULL,1771ULL,231ULL,21ULL,1ULL},{191991813933920ULL,114456658306760ULL,67327446062800ULL,39049918716424ULL,22314239266528ULL,12551759587422ULL,6943526580276ULL,3773655750150ULL,2012616400080ULL,1052049481860ULL,538257874440ULL,269128937220ULL,131282408400ULL,62359143990ULL,28781143380ULL,12875774670ULL,5567902560ULL,2319959400ULL,927983760ULL,354817320ULL,129024480ULL,44352165ULL,14307150ULL,4292145ULL,1184040ULL,296010ULL,65780ULL,12650ULL,2024ULL,253ULL,22ULL,1ULL},{462525733568080ULL,270533919634160ULL,156077261327400ULL,88749815264600ULL,49699896548176ULL,27385657281648ULL,14833897694226ULL,7890371113950ULL,4116715363800ULL,2104098963720ULL,1052049481860ULL,513791607420ULL,244662670200ULL,113380261800ULL,51021117810ULL,22239974430ULL,9364199760ULL,3796297200ULL,1476337800ULL,548354040ULL,193536720ULL,64512240ULL,20160075ULL,5852925ULL,1560780ULL,376740ULL,80730ULL,14950ULL,2300ULL,276ULL,23ULL,1ULL},{1085929983159840ULL,623404249591760ULL,352870329957600ULL,196793068630200ULL,108043253365600ULL,58343356817424ULL,30957699535776ULL,16123801841550ULL,8233430727600ULL,4116715363800ULL,2012616400080ULL,960566918220ULL,446775310800ULL,202112640600ULL,88732378800ULL,37711260990ULL,15471286560ULL,6107086800ULL,2310789600ULL,834451800ULL,286097760ULL,92561040ULL,28048800ULL,7888725ULL,2035800ULL,475020ULL,98280ULL,17550ULL,2600ULL,300ULL,24ULL,1ULL},{2488589544741300ULL,1402659561581460ULL,779255311989700ULL,426384982032100ULL,229591913401900ULL,121548660036300ULL,63205303218876ULL,32247603683100ULL,16123801841550ULL,7890371113950ULL,3773655750150ULL,1761039350070ULL,800472431850ULL,353697121050ULL,151584480450ULL,62852101650ULL,25140840660ULL,9669554100ULL,3562467300ULL,1251677700ULL,417225900ULL,131128140ULL,38567100ULL,10518300ULL,2629575ULL,593775ULL,118755ULL,20475ULL,2925ULL,325ULL,25ULL,1ULL},{5574440580220512ULL,3085851035479212ULL,1683191473897752ULL,903936161908052ULL,477551179875952ULL,247959266474052ULL,126410606437752ULL,63205303218876ULL,30957699535776ULL,14833897694226ULL,6943526580276ULL,3169870830126ULL,1408831480056ULL,608359048206ULL,254661927156ULL,103077446706ULL,40225345056ULL,15084504396ULL,5414950296ULL,1852482996ULL,600805296ULL,183579396ULL,52451256ULL,13884156ULL,3365856ULL,736281ULL,142506ULL,23751ULL,3276ULL,351ULL,26ULL,1ULL},{12220888964329584ULL,6646448384109072ULL,3560597348629860ULL,1877405874732108ULL,973469712824056ULL,495918532948104ULL,247959266474052ULL,121548660036300ULL,58343356817424ULL,27385657281648ULL,12551759587422ULL,5608233007146ULL,2438362177020ULL,1029530696964ULL,421171648758ULL,166509721602ULL,63432274896ULL,23206929840ULL,8122425444ULL,2707475148ULL,854992152ULL,254186856ULL,70607460ULL,18156204ULL,4272048ULL,906192ULL,169911ULL,27405ULL,3654ULL,378ULL,27ULL,1ULL},{26252279997448736ULL,14031391033119152ULL,7384942649010080ULL,3824345300380220ULL,1946939425648112ULL,973469712824056ULL,477551179875952ULL,229591913401900ULL,108043253365600ULL,49699896548176ULL,22314239266528ULL,9762479679106ULL,4154246671960ULL,1715884494940ULL,686353797976ULL,265182149218ULL,98672427616ULL,35240152720ULL,12033222880ULL,3910797436ULL,1203322288ULL,348330136ULL,94143280ULL,23535820ULL,5379616ULL,1107568ULL,201376ULL,31465ULL,4060ULL,406ULL,28ULL,1ULL},{55317304280338408ULL,29065024282889672ULL,15033633249770520ULL,7648690600760440ULL,3824345300380220ULL,1877405874732108ULL,903936161908052ULL,426384982032100ULL,196793068630200ULL,88749815264600ULL,39049918716424ULL,16735679449896ULL,6973199770790ULL,2818953098830ULL,1103068603890ULL,416714805914ULL,151532656696ULL,52860229080ULL,17620076360ULL,5586853480ULL,1676056044ULL,472733756ULL,124403620ULL,30260340ULL,6724520ULL,1344904ULL,237336ULL,35960ULL,4495ULL,435ULL,29ULL,1ULL},{114449595062769120ULL,59132290782430712ULL,30067266499541040ULL,15033633249770520ULL,7384942649010080ULL,3560597348629860ULL,1683191473897752ULL,779255311989700ULL,352870329957600ULL,156077261327400ULL,67327446062800ULL,28277527346376ULL,11541847896480ULL,4568648125690ULL,1749695026860ULL,646626422970ULL,229911617056ULL,78378960360ULL,25518731280ULL,7898654920ULL,2311801440ULL,635745396ULL,163011640ULL,38608020ULL,8347680ULL,1623160ULL,278256ULL,40920ULL,4960ULL,465ULL,30ULL,1ULL},{232714176627630544ULL,118264581564861424ULL,59132290782430712ULL,29065024282889672ULL,14031391033119152ULL,6646448384109072ULL,3085851035479212ULL,1402659561581460ULL,623404249591760ULL,270533919634160ULL,114456658306760ULL,47129212243960ULL,18851684897584ULL,7309837001104ULL,2741188875414ULL,991493848554ULL,344867425584ULL,114955808528ULL,36576848168ULL,11058116888ULL,3159461968ULL,847660528ULL,211915132ULL,48903492ULL,10295472ULL,1947792ULL,324632ULL,46376ULL,5456ULL,496ULL,31ULL,1ULL},{465428353255261088ULL,232714176627630544ULL,114449595062769120ULL,55317304280338408ULL,26252279997448736ULL,12220888964329584ULL,5574440580220512ULL,2488589544741300ULL,1085929983159840ULL,462525733568080ULL,191991813933920ULL,77535155627160ULL,30405943383200ULL,11554258485616ULL,4244421484512ULL,1503232609098ULL,511738760544ULL,166871334960ULL,51915526432ULL,15338678264ULL,4280561376ULL,1121099408ULL,273438880ULL,61523748ULL,12620256ULL,2324784ULL,376992ULL,52360ULL,5984ULL,528ULL,32ULL,1ULL},{916312070471295267ULL,450883717216034179ULL,218169540588403635ULL,103719945525634515ULL,48402641245296107ULL,22150361247847371ULL,9929472283517787ULL,4355031703297275ULL,1866442158555975ULL,780512175396135ULL,317986441828055ULL,125994627894135ULL,48459472266975ULL,18053528883775ULL,6499270398159ULL,2254848913647ULL,751616304549ULL,239877544005ULL,73006209045ULL,21090682613ULL,5752004349ULL,1471442973ULL,350343565ULL,76904685ULL,15380937ULL,2760681ULL,435897ULL,58905ULL,6545ULL,561ULL,33ULL,1ULL},{1777090076065542336ULL,860778005594247069ULL,409894288378212890ULL,191724747789809255ULL,88004802264174740ULL,39602161018878633ULL,17451799771031262ULL,7522327487513475ULL,3167295784216200ULL,1300853625660225ULL,520341450264090ULL,202355008436035ULL,76360380541900ULL,27900908274925ULL,9847379391150ULL,3348108992991ULL,1093260079344ULL,341643774795ULL,101766230790ULL,28760021745ULL,7669339132ULL,1917334783ULL,445891810ULL,95548245ULL,18643560ULL,3262623ULL,501942ULL,66045ULL,7140ULL,595ULL,34ULL,1ULL},{3397378086595889760ULL,1620288010530347424ULL,759510004936100355ULL,349615716557887465ULL,157890968768078210ULL,69886166503903470ULL,30284005485024837ULL,12832205713993575ULL,5309878226480100ULL,2142582442263900ULL,841728816603675ULL,321387366339585ULL,119032357903550ULL,42671977361650ULL,14771069086725ULL,4923689695575ULL,1575580702584ULL,482320623240ULL,140676848445ULL,38910617655ULL,10150595910ULL,2481256778ULL,563921995ULL,118030185ULL,22481940ULL,3838380ULL,575757ULL,73815ULL,7770ULL,630ULL,35ULL,1ULL},{6406484391866534976ULL,3009106305270645216ULL,1388818294740297792ULL,629308289804197437ULL,279692573246309972ULL,121801604478231762ULL,51915437974328292ULL,21631432489303455ULL,8799226775309880ULL,3489348548829780ULL,1346766106565880ULL,505037289962205ULL,183649923622620ULL,64617565719070ULL,21945588357420ULL,7174519270695ULL,2250829575120ULL,675248872536ULL,192928249296ULL,52251400851ULL,13340783196ULL,3190187286ULL,708930508ULL,145008513ULL,26978328ULL,4496388ULL,658008ULL,82251ULL,8436ULL,666ULL,36ULL,1ULL},{11923179284862717872ULL,5516694892996182896ULL,2507588587725537680ULL,1118770292985239888ULL,489462003181042451ULL,209769429934732479ULL,87967825456500717ULL,36052387482172425ULL,14420954992868970ULL,5621728217559090ULL,2132379668729310ULL,785613562163430ULL,280576272201225ULL,96926348578605ULL,32308782859535ULL,10363194502115ULL,3188675231420ULL,937845656300ULL,262596783764ULL,69668534468ULL,17417133617ULL,4076350421ULL,886163135ULL,177232627ULL,32224114ULL,5245786ULL,749398ULL,91390ULL,9139ULL,703ULL,37ULL,1ULL},{3466125963335443392ULL,9989690752182277136ULL,4472995859186094240ULL,1965407271460556560ULL,846636978475316672ULL,357174975294274221ULL,147405545359541742ULL,59437719903041025ULL,23385332420868600ULL,8964377427999630ULL,3342649210440540ULL,1210269541711230ULL,424655979547800ULL,144079707346575ULL,47153358767970ULL,14844575908435ULL,4481381406320ULL,1292706174900ULL,354860518600ULL,92263734836ULL,22595200368ULL,5178066751ULL,1101716330ULL,215553195ULL,38320568ULL,6096454ULL,850668ULL,101270ULL,9880ULL,741ULL,38ULL,1ULL},{2895670604057335072ULL,17876288714431443296ULL,7886597962249166160ULL,3413602103063071920ULL,1448194831602515360ULL,601557853127198688ULL,244382877832924467ULL,96977332473382725ULL,37539612570341700ULL,14154280149473100ULL,5189902721473470ULL,1847253511032930ULL,636983969321700ULL,212327989773900ULL,68248282427325ULL,21094923659355ULL,6250347750920ULL,1768966344600ULL,476260169700ULL,121399651100ULL,29135916264ULL,6540715896ULL,1362649145ULL,260932815ULL,45379620ULL,7059052ULL,962598ULL,111930ULL,10660ULL,780ULL,39ULL,1ULL},{16076206563572644672ULL,13180535959515309600ULL,13750991318793417920ULL,5864393356544251760ULL,2450791253481179840ULL,1002596421878664480ULL,401038568751465792ULL,156655690918541325ULL,59678358445158600ULL,22138745874816900ULL,7984465725343800ULL,2794563003870330ULL,947309492837400ULL,310325523515700ULL,97997533741800ULL,29749251314475ULL,8654327655120ULL,2403979904200ULL,635013559600ULL,158753389900ULL,37353738800ULL,8217822536ULL,1677106640ULL,314457495ULL,53524680ULL,8145060ULL,1086008ULL,123410ULL,11480ULL,820ULL,40ULL,1ULL}}; static int v[6], sz; static ll _pow(ll n, ll e){ ll re = 1ll; while (e){ if (e&1) re *= n; n *= n; e /= 2; } return re; } // ll raw_to_hash(vector<int> &v){ // ll re = 0; // for (int i = 0; i < v.size(); i++){ // int rem_length = v.size() - i - 1; // ll bruh = v[i] * _pow(256, rem_length); // re += bruh; // } // return re; // } ll raw_to_hash(){ ll re = 0; for (int i = 0; i < sz; i++){ int rem_length = sz - i - 1; ll bruh = v[i] * _pow(256, rem_length); re += bruh; } return re; } void bruh_encode(int i, ll rem, int last){ while (i){ for (int y = last; y <= maxx; y++){ ll cnt = dp[i - 1][y]; if (rem >= cnt) rem -= cnt; else{ send(idx + y); last = y; i--; break; } } } } void encode(int N, int M[]){ int angie = 0; for (int i = 0; i < N; i += 8){ idx = angie<<5; angie++; // vector<int> v; sz = 0; for (int j = i; j < min(N, i + 8); j++){ // v.push_back(M[j]); v[sz++] = M[j]; } // ll hash = raw_to_hash(v); ll hash = raw_to_hash(); // actually_encode(min((int)v.size() * 5, (int)38), hash, 0); bruh_encode(min((int)sz * 5, (int)38), hash, 0); } }
#include <bits/stdc++.h> #include "decoder.h" #include "decoderlib.h" using namespace std; #define ll unsigned long long static const int maxx = 31; static ll dp[40][32]={{1ULL,1ULL,1ULL,1ULL,1ULL,1ULL,1ULL,1ULL,1ULL,1ULL,1ULL,1ULL,1ULL,1ULL,1ULL,1ULL,1ULL,1ULL,1ULL,1ULL,1ULL,1ULL,1ULL,1ULL,1ULL,1ULL,1ULL,1ULL,1ULL,1ULL,1ULL,1ULL},{32ULL,31ULL,30ULL,29ULL,28ULL,27ULL,26ULL,25ULL,24ULL,23ULL,22ULL,21ULL,20ULL,19ULL,18ULL,17ULL,16ULL,15ULL,14ULL,13ULL,12ULL,11ULL,10ULL,9ULL,8ULL,7ULL,6ULL,5ULL,4ULL,3ULL,2ULL,1ULL},{528ULL,496ULL,465ULL,435ULL,406ULL,378ULL,351ULL,325ULL,300ULL,276ULL,253ULL,231ULL,210ULL,190ULL,171ULL,153ULL,136ULL,120ULL,105ULL,91ULL,78ULL,66ULL,55ULL,45ULL,36ULL,28ULL,21ULL,15ULL,10ULL,6ULL,3ULL,1ULL},{5984ULL,5456ULL,4960ULL,4495ULL,4060ULL,3654ULL,3276ULL,2925ULL,2600ULL,2300ULL,2024ULL,1771ULL,1540ULL,1330ULL,1140ULL,969ULL,816ULL,680ULL,560ULL,455ULL,364ULL,286ULL,220ULL,165ULL,120ULL,84ULL,56ULL,35ULL,20ULL,10ULL,4ULL,1ULL},{52360ULL,46376ULL,40920ULL,35960ULL,31465ULL,27405ULL,23751ULL,20475ULL,17550ULL,14950ULL,12650ULL,10626ULL,8855ULL,7315ULL,5985ULL,4845ULL,3876ULL,3060ULL,2380ULL,1820ULL,1365ULL,1001ULL,715ULL,495ULL,330ULL,210ULL,126ULL,70ULL,35ULL,15ULL,5ULL,1ULL},{376992ULL,324632ULL,278256ULL,237336ULL,201376ULL,169911ULL,142506ULL,118755ULL,98280ULL,80730ULL,65780ULL,53130ULL,42504ULL,33649ULL,26334ULL,20349ULL,15504ULL,11628ULL,8568ULL,6188ULL,4368ULL,3003ULL,2002ULL,1287ULL,792ULL,462ULL,252ULL,126ULL,56ULL,21ULL,6ULL,1ULL},{2324784ULL,1947792ULL,1623160ULL,1344904ULL,1107568ULL,906192ULL,736281ULL,593775ULL,475020ULL,376740ULL,296010ULL,230230ULL,177100ULL,134596ULL,100947ULL,74613ULL,54264ULL,38760ULL,27132ULL,18564ULL,12376ULL,8008ULL,5005ULL,3003ULL,1716ULL,924ULL,462ULL,210ULL,84ULL,28ULL,7ULL,1ULL},{12620256ULL,10295472ULL,8347680ULL,6724520ULL,5379616ULL,4272048ULL,3365856ULL,2629575ULL,2035800ULL,1560780ULL,1184040ULL,888030ULL,657800ULL,480700ULL,346104ULL,245157ULL,170544ULL,116280ULL,77520ULL,50388ULL,31824ULL,19448ULL,11440ULL,6435ULL,3432ULL,1716ULL,792ULL,330ULL,120ULL,36ULL,8ULL,1ULL},{61523748ULL,48903492ULL,38608020ULL,30260340ULL,23535820ULL,18156204ULL,13884156ULL,10518300ULL,7888725ULL,5852925ULL,4292145ULL,3108105ULL,2220075ULL,1562275ULL,1081575ULL,735471ULL,490314ULL,319770ULL,203490ULL,125970ULL,75582ULL,43758ULL,24310ULL,12870ULL,6435ULL,3003ULL,1287ULL,495ULL,165ULL,45ULL,9ULL,1ULL},{273438880ULL,211915132ULL,163011640ULL,124403620ULL,94143280ULL,70607460ULL,52451256ULL,38567100ULL,28048800ULL,20160075ULL,14307150ULL,10015005ULL,6906900ULL,4686825ULL,3124550ULL,2042975ULL,1307504ULL,817190ULL,497420ULL,293930ULL,167960ULL,92378ULL,48620ULL,24310ULL,11440ULL,5005ULL,2002ULL,715ULL,220ULL,55ULL,10ULL,1ULL},{1121099408ULL,847660528ULL,635745396ULL,472733756ULL,348330136ULL,254186856ULL,183579396ULL,131128140ULL,92561040ULL,64512240ULL,44352165ULL,30045015ULL,20030010ULL,13123110ULL,8436285ULL,5311735ULL,3268760ULL,1961256ULL,1144066ULL,646646ULL,352716ULL,184756ULL,92378ULL,43758ULL,19448ULL,8008ULL,3003ULL,1001ULL,286ULL,66ULL,11ULL,1ULL},{4280561376ULL,3159461968ULL,2311801440ULL,1676056044ULL,1203322288ULL,854992152ULL,600805296ULL,417225900ULL,286097760ULL,193536720ULL,129024480ULL,84672315ULL,54627300ULL,34597290ULL,21474180ULL,13037895ULL,7726160ULL,4457400ULL,2496144ULL,1352078ULL,705432ULL,352716ULL,167960ULL,75582ULL,31824ULL,12376ULL,4368ULL,1365ULL,364ULL,78ULL,12ULL,1ULL},{15338678264ULL,11058116888ULL,7898654920ULL,5586853480ULL,3910797436ULL,2707475148ULL,1852482996ULL,1251677700ULL,834451800ULL,548354040ULL,354817320ULL,225792840ULL,141120525ULL,86493225ULL,51895935ULL,30421755ULL,17383860ULL,9657700ULL,5200300ULL,2704156ULL,1352078ULL,646646ULL,293930ULL,125970ULL,50388ULL,18564ULL,6188ULL,1820ULL,455ULL,91ULL,13ULL,1ULL},{51915526432ULL,36576848168ULL,25518731280ULL,17620076360ULL,12033222880ULL,8122425444ULL,5414950296ULL,3562467300ULL,2310789600ULL,1476337800ULL,927983760ULL,573166440ULL,347373600ULL,206253075ULL,119759850ULL,67863915ULL,37442160ULL,20058300ULL,10400600ULL,5200300ULL,2496144ULL,1144066ULL,497420ULL,203490ULL,77520ULL,27132ULL,8568ULL,2380ULL,560ULL,105ULL,14ULL,1ULL},{166871334960ULL,114955808528ULL,78378960360ULL,52860229080ULL,35240152720ULL,23206929840ULL,15084504396ULL,9669554100ULL,6107086800ULL,3796297200ULL,2319959400ULL,1391975640ULL,818809200ULL,471435600ULL,265182525ULL,145422675ULL,77558760ULL,40116600ULL,20058300ULL,9657700ULL,4457400ULL,1961256ULL,817190ULL,319770ULL,116280ULL,38760ULL,11628ULL,3060ULL,680ULL,120ULL,15ULL,1ULL},{511738760544ULL,344867425584ULL,229911617056ULL,151532656696ULL,98672427616ULL,63432274896ULL,40225345056ULL,25140840660ULL,15471286560ULL,9364199760ULL,5567902560ULL,3247943160ULL,1855967520ULL,1037158320ULL,565722720ULL,300540195ULL,155117520ULL,77558760ULL,37442160ULL,17383860ULL,7726160ULL,3268760ULL,1307504ULL,490314ULL,170544ULL,54264ULL,15504ULL,3876ULL,816ULL,136ULL,16ULL,1ULL},{1503232609098ULL,991493848554ULL,646626422970ULL,416714805914ULL,265182149218ULL,166509721602ULL,103077446706ULL,62852101650ULL,37711260990ULL,22239974430ULL,12875774670ULL,7307872110ULL,4059928950ULL,2203961430ULL,1166803110ULL,601080390ULL,300540195ULL,145422675ULL,67863915ULL,30421755ULL,13037895ULL,5311735ULL,2042975ULL,735471ULL,245157ULL,74613ULL,20349ULL,4845ULL,969ULL,153ULL,17ULL,1ULL},{4244421484512ULL,2741188875414ULL,1749695026860ULL,1103068603890ULL,686353797976ULL,421171648758ULL,254661927156ULL,151584480450ULL,88732378800ULL,51021117810ULL,28781143380ULL,15905368710ULL,8597496600ULL,4537567650ULL,2333606220ULL,1166803110ULL,565722720ULL,265182525ULL,119759850ULL,51895935ULL,21474180ULL,8436285ULL,3124550ULL,1081575ULL,346104ULL,100947ULL,26334ULL,5985ULL,1140ULL,171ULL,18ULL,1ULL},{11554258485616ULL,7309837001104ULL,4568648125690ULL,2818953098830ULL,1715884494940ULL,1029530696964ULL,608359048206ULL,353697121050ULL,202112640600ULL,113380261800ULL,62359143990ULL,33578000610ULL,17672631900ULL,9075135300ULL,4537567650ULL,2203961430ULL,1037158320ULL,471435600ULL,206253075ULL,86493225ULL,34597290ULL,13123110ULL,4686825ULL,1562275ULL,480700ULL,134596ULL,33649ULL,7315ULL,1330ULL,190ULL,19ULL,1ULL},{30405943383200ULL,18851684897584ULL,11541847896480ULL,6973199770790ULL,4154246671960ULL,2438362177020ULL,1408831480056ULL,800472431850ULL,446775310800ULL,244662670200ULL,131282408400ULL,68923264410ULL,35345263800ULL,17672631900ULL,8597496600ULL,4059928950ULL,1855967520ULL,818809200ULL,347373600ULL,141120525ULL,54627300ULL,20030010ULL,6906900ULL,2220075ULL,657800ULL,177100ULL,42504ULL,8855ULL,1540ULL,210ULL,20ULL,1ULL},{77535155627160ULL,47129212243960ULL,28277527346376ULL,16735679449896ULL,9762479679106ULL,5608233007146ULL,3169870830126ULL,1761039350070ULL,960566918220ULL,513791607420ULL,269128937220ULL,137846528820ULL,68923264410ULL,33578000610ULL,15905368710ULL,7307872110ULL,3247943160ULL,1391975640ULL,573166440ULL,225792840ULL,84672315ULL,30045015ULL,10015005ULL,3108105ULL,888030ULL,230230ULL,53130ULL,10626ULL,1771ULL,231ULL,21ULL,1ULL},{191991813933920ULL,114456658306760ULL,67327446062800ULL,39049918716424ULL,22314239266528ULL,12551759587422ULL,6943526580276ULL,3773655750150ULL,2012616400080ULL,1052049481860ULL,538257874440ULL,269128937220ULL,131282408400ULL,62359143990ULL,28781143380ULL,12875774670ULL,5567902560ULL,2319959400ULL,927983760ULL,354817320ULL,129024480ULL,44352165ULL,14307150ULL,4292145ULL,1184040ULL,296010ULL,65780ULL,12650ULL,2024ULL,253ULL,22ULL,1ULL},{462525733568080ULL,270533919634160ULL,156077261327400ULL,88749815264600ULL,49699896548176ULL,27385657281648ULL,14833897694226ULL,7890371113950ULL,4116715363800ULL,2104098963720ULL,1052049481860ULL,513791607420ULL,244662670200ULL,113380261800ULL,51021117810ULL,22239974430ULL,9364199760ULL,3796297200ULL,1476337800ULL,548354040ULL,193536720ULL,64512240ULL,20160075ULL,5852925ULL,1560780ULL,376740ULL,80730ULL,14950ULL,2300ULL,276ULL,23ULL,1ULL},{1085929983159840ULL,623404249591760ULL,352870329957600ULL,196793068630200ULL,108043253365600ULL,58343356817424ULL,30957699535776ULL,16123801841550ULL,8233430727600ULL,4116715363800ULL,2012616400080ULL,960566918220ULL,446775310800ULL,202112640600ULL,88732378800ULL,37711260990ULL,15471286560ULL,6107086800ULL,2310789600ULL,834451800ULL,286097760ULL,92561040ULL,28048800ULL,7888725ULL,2035800ULL,475020ULL,98280ULL,17550ULL,2600ULL,300ULL,24ULL,1ULL},{2488589544741300ULL,1402659561581460ULL,779255311989700ULL,426384982032100ULL,229591913401900ULL,121548660036300ULL,63205303218876ULL,32247603683100ULL,16123801841550ULL,7890371113950ULL,3773655750150ULL,1761039350070ULL,800472431850ULL,353697121050ULL,151584480450ULL,62852101650ULL,25140840660ULL,9669554100ULL,3562467300ULL,1251677700ULL,417225900ULL,131128140ULL,38567100ULL,10518300ULL,2629575ULL,593775ULL,118755ULL,20475ULL,2925ULL,325ULL,25ULL,1ULL},{5574440580220512ULL,3085851035479212ULL,1683191473897752ULL,903936161908052ULL,477551179875952ULL,247959266474052ULL,126410606437752ULL,63205303218876ULL,30957699535776ULL,14833897694226ULL,6943526580276ULL,3169870830126ULL,1408831480056ULL,608359048206ULL,254661927156ULL,103077446706ULL,40225345056ULL,15084504396ULL,5414950296ULL,1852482996ULL,600805296ULL,183579396ULL,52451256ULL,13884156ULL,3365856ULL,736281ULL,142506ULL,23751ULL,3276ULL,351ULL,26ULL,1ULL},{12220888964329584ULL,6646448384109072ULL,3560597348629860ULL,1877405874732108ULL,973469712824056ULL,495918532948104ULL,247959266474052ULL,121548660036300ULL,58343356817424ULL,27385657281648ULL,12551759587422ULL,5608233007146ULL,2438362177020ULL,1029530696964ULL,421171648758ULL,166509721602ULL,63432274896ULL,23206929840ULL,8122425444ULL,2707475148ULL,854992152ULL,254186856ULL,70607460ULL,18156204ULL,4272048ULL,906192ULL,169911ULL,27405ULL,3654ULL,378ULL,27ULL,1ULL},{26252279997448736ULL,14031391033119152ULL,7384942649010080ULL,3824345300380220ULL,1946939425648112ULL,973469712824056ULL,477551179875952ULL,229591913401900ULL,108043253365600ULL,49699896548176ULL,22314239266528ULL,9762479679106ULL,4154246671960ULL,1715884494940ULL,686353797976ULL,265182149218ULL,98672427616ULL,35240152720ULL,12033222880ULL,3910797436ULL,1203322288ULL,348330136ULL,94143280ULL,23535820ULL,5379616ULL,1107568ULL,201376ULL,31465ULL,4060ULL,406ULL,28ULL,1ULL},{55317304280338408ULL,29065024282889672ULL,15033633249770520ULL,7648690600760440ULL,3824345300380220ULL,1877405874732108ULL,903936161908052ULL,426384982032100ULL,196793068630200ULL,88749815264600ULL,39049918716424ULL,16735679449896ULL,6973199770790ULL,2818953098830ULL,1103068603890ULL,416714805914ULL,151532656696ULL,52860229080ULL,17620076360ULL,5586853480ULL,1676056044ULL,472733756ULL,124403620ULL,30260340ULL,6724520ULL,1344904ULL,237336ULL,35960ULL,4495ULL,435ULL,29ULL,1ULL},{114449595062769120ULL,59132290782430712ULL,30067266499541040ULL,15033633249770520ULL,7384942649010080ULL,3560597348629860ULL,1683191473897752ULL,779255311989700ULL,352870329957600ULL,156077261327400ULL,67327446062800ULL,28277527346376ULL,11541847896480ULL,4568648125690ULL,1749695026860ULL,646626422970ULL,229911617056ULL,78378960360ULL,25518731280ULL,7898654920ULL,2311801440ULL,635745396ULL,163011640ULL,38608020ULL,8347680ULL,1623160ULL,278256ULL,40920ULL,4960ULL,465ULL,30ULL,1ULL},{232714176627630544ULL,118264581564861424ULL,59132290782430712ULL,29065024282889672ULL,14031391033119152ULL,6646448384109072ULL,3085851035479212ULL,1402659561581460ULL,623404249591760ULL,270533919634160ULL,114456658306760ULL,47129212243960ULL,18851684897584ULL,7309837001104ULL,2741188875414ULL,991493848554ULL,344867425584ULL,114955808528ULL,36576848168ULL,11058116888ULL,3159461968ULL,847660528ULL,211915132ULL,48903492ULL,10295472ULL,1947792ULL,324632ULL,46376ULL,5456ULL,496ULL,31ULL,1ULL},{465428353255261088ULL,232714176627630544ULL,114449595062769120ULL,55317304280338408ULL,26252279997448736ULL,12220888964329584ULL,5574440580220512ULL,2488589544741300ULL,1085929983159840ULL,462525733568080ULL,191991813933920ULL,77535155627160ULL,30405943383200ULL,11554258485616ULL,4244421484512ULL,1503232609098ULL,511738760544ULL,166871334960ULL,51915526432ULL,15338678264ULL,4280561376ULL,1121099408ULL,273438880ULL,61523748ULL,12620256ULL,2324784ULL,376992ULL,52360ULL,5984ULL,528ULL,32ULL,1ULL},{916312070471295267ULL,450883717216034179ULL,218169540588403635ULL,103719945525634515ULL,48402641245296107ULL,22150361247847371ULL,9929472283517787ULL,4355031703297275ULL,1866442158555975ULL,780512175396135ULL,317986441828055ULL,125994627894135ULL,48459472266975ULL,18053528883775ULL,6499270398159ULL,2254848913647ULL,751616304549ULL,239877544005ULL,73006209045ULL,21090682613ULL,5752004349ULL,1471442973ULL,350343565ULL,76904685ULL,15380937ULL,2760681ULL,435897ULL,58905ULL,6545ULL,561ULL,33ULL,1ULL},{1777090076065542336ULL,860778005594247069ULL,409894288378212890ULL,191724747789809255ULL,88004802264174740ULL,39602161018878633ULL,17451799771031262ULL,7522327487513475ULL,3167295784216200ULL,1300853625660225ULL,520341450264090ULL,202355008436035ULL,76360380541900ULL,27900908274925ULL,9847379391150ULL,3348108992991ULL,1093260079344ULL,341643774795ULL,101766230790ULL,28760021745ULL,7669339132ULL,1917334783ULL,445891810ULL,95548245ULL,18643560ULL,3262623ULL,501942ULL,66045ULL,7140ULL,595ULL,34ULL,1ULL},{3397378086595889760ULL,1620288010530347424ULL,759510004936100355ULL,349615716557887465ULL,157890968768078210ULL,69886166503903470ULL,30284005485024837ULL,12832205713993575ULL,5309878226480100ULL,2142582442263900ULL,841728816603675ULL,321387366339585ULL,119032357903550ULL,42671977361650ULL,14771069086725ULL,4923689695575ULL,1575580702584ULL,482320623240ULL,140676848445ULL,38910617655ULL,10150595910ULL,2481256778ULL,563921995ULL,118030185ULL,22481940ULL,3838380ULL,575757ULL,73815ULL,7770ULL,630ULL,35ULL,1ULL},{6406484391866534976ULL,3009106305270645216ULL,1388818294740297792ULL,629308289804197437ULL,279692573246309972ULL,121801604478231762ULL,51915437974328292ULL,21631432489303455ULL,8799226775309880ULL,3489348548829780ULL,1346766106565880ULL,505037289962205ULL,183649923622620ULL,64617565719070ULL,21945588357420ULL,7174519270695ULL,2250829575120ULL,675248872536ULL,192928249296ULL,52251400851ULL,13340783196ULL,3190187286ULL,708930508ULL,145008513ULL,26978328ULL,4496388ULL,658008ULL,82251ULL,8436ULL,666ULL,36ULL,1ULL},{11923179284862717872ULL,5516694892996182896ULL,2507588587725537680ULL,1118770292985239888ULL,489462003181042451ULL,209769429934732479ULL,87967825456500717ULL,36052387482172425ULL,14420954992868970ULL,5621728217559090ULL,2132379668729310ULL,785613562163430ULL,280576272201225ULL,96926348578605ULL,32308782859535ULL,10363194502115ULL,3188675231420ULL,937845656300ULL,262596783764ULL,69668534468ULL,17417133617ULL,4076350421ULL,886163135ULL,177232627ULL,32224114ULL,5245786ULL,749398ULL,91390ULL,9139ULL,703ULL,37ULL,1ULL},{3466125963335443392ULL,9989690752182277136ULL,4472995859186094240ULL,1965407271460556560ULL,846636978475316672ULL,357174975294274221ULL,147405545359541742ULL,59437719903041025ULL,23385332420868600ULL,8964377427999630ULL,3342649210440540ULL,1210269541711230ULL,424655979547800ULL,144079707346575ULL,47153358767970ULL,14844575908435ULL,4481381406320ULL,1292706174900ULL,354860518600ULL,92263734836ULL,22595200368ULL,5178066751ULL,1101716330ULL,215553195ULL,38320568ULL,6096454ULL,850668ULL,101270ULL,9880ULL,741ULL,38ULL,1ULL},{2895670604057335072ULL,17876288714431443296ULL,7886597962249166160ULL,3413602103063071920ULL,1448194831602515360ULL,601557853127198688ULL,244382877832924467ULL,96977332473382725ULL,37539612570341700ULL,14154280149473100ULL,5189902721473470ULL,1847253511032930ULL,636983969321700ULL,212327989773900ULL,68248282427325ULL,21094923659355ULL,6250347750920ULL,1768966344600ULL,476260169700ULL,121399651100ULL,29135916264ULL,6540715896ULL,1362649145ULL,260932815ULL,45379620ULL,7059052ULL,962598ULL,111930ULL,10660ULL,780ULL,39ULL,1ULL},{16076206563572644672ULL,13180535959515309600ULL,13750991318793417920ULL,5864393356544251760ULL,2450791253481179840ULL,1002596421878664480ULL,401038568751465792ULL,156655690918541325ULL,59678358445158600ULL,22138745874816900ULL,7984465725343800ULL,2794563003870330ULL,947309492837400ULL,310325523515700ULL,97997533741800ULL,29749251314475ULL,8654327655120ULL,2403979904200ULL,635013559600ULL,158753389900ULL,37353738800ULL,8217822536ULL,1677106640ULL,314457495ULL,53524680ULL,8145060ULL,1086008ULL,123410ULL,11480ULL,820ULL,40ULL,1ULL}}; static int v[6], sz; static ll _pow(ll n, ll e){ ll re = 1ll; while (e){ if (e&1) re *= n; n *= n; e /= 2; } return re; } void actually_decode(int i, ll rem){ ll angie = 0, og_rem = rem; for (int j = 0; j < i; j++){ int rem_length = i - j - 1; ll bruh = _pow(256, rem_length); ll y = rem / bruh; output(y); rem %= bruh; angie += y * bruh; } } void decode(int N, int L, int X[]){ sort(X, X + L); for (int i = 0; i < L; i += 38){ // vector<int> v; sz = 0; for (int j = i; j < min(L, i + 38); j++){ // v.push_back(X[j] % 32); v[sz++] = (X[j] & ((1<<5) - 1)); // v[sz++] = X[j] % 32; } ll hash = 0; ll angie = 0; for (int j = 0; j < sz; j++){ int heh = sz - j - 1; for (int x = (j == 0 ? 0 : v[j - 1]); x < v[j]; x++){ hash += dp[heh][x]; } } actually_decode((sz + 4) / 5, hash); } }

Compilation message (stderr)

decoder.cpp: In function 'void actually_decode(int, long long unsigned int)':
decoder.cpp:22:19: warning: unused variable 'og_rem' [-Wunused-variable]
   22 |     ll angie = 0, og_rem = rem;
      |                   ^~~~~~
decoder.cpp: In function 'void decode(int, int, int*)':
decoder.cpp:44:12: warning: unused variable 'angie' [-Wunused-variable]
   44 |         ll angie = 0;
      |            ^~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...