分段打表,但比另一个打表题解快了近20倍!
因为ta不知道你谷可以交50kb的代码
如果暴力一一验证,复杂度是 \(\mathcal O(n\log n)\) 的,但 \(r\le2\times10^9\),几分钟还是可以跑完的。
因为是查询一个区间,我们可以想到打表前缀和,不过若全打出来空间不够且代码太长,于是想到分段打表。
分段,即每 \(blo(块的长度)\) 个数变成一段记录前缀和,类似于分块的思想,就可以直接查询整块,边角暴力,复杂度 \(\mathcal O(blo)\)。
显然 \(blo\) 越小越好,但代码长度限制我们只能打大约 \(5000\) 个数,即 \(blo=\dfrac{2\times10^9}{5000}=4\times10^5\),不吸氧总时长也只有100+ms。
打表代码:
#include<bits/stdc++.h>
using namespace std;
const int n=2e9,blo=400000,tot=n/blo+(n%blo!=0);
int sum[tot+5];
int main(){
freopen("P6218table.txt","w",stdout);
for(register int i=1;i<=n;i++){
int c[2]={},j=i;
for(;j;j>>=1)c[j&1]++;
sum[(i-1)/blo+1]+=(c[0]>=c[1]);
}
for(register int i=1;i<=tot;i++)
printf("%d,",sum[i]+=sum[i-1]);
return 0;
}
AC代码:
#include<bits/stdc++.h>
using namespace std;
const int blo=4e5,sum[5005]={0,193089,395896,597220,773925,912008,1157070,1399860,1584651,1786716,1936710,2139581,2389622,2582137,2798866,2953836,3101012,3281245,3430004,3558911,3666046,3727488,4073045,4367750,4637470,4888435,5098407,5359879,5599489,5784841,5985204,6135499,6342130,6591835,6778503,6997710,7150060,7301173,7476620,7626492,7759888,7863932,7933069,8276772,8570899,8841202,9091048,9295711,9560929,9799167,9988999,10183117,10332725,10542928,10792963,10975302,11195805,11345708,11498962,11677401,11825190,11960070,12061347,12136954,12422337,12647109,12847270,13021938,13147691,13354661,13513784,13638078,13753008,13838605,13999872,14173972,14280973,14429050,14516891,14618715,14726176,14804289,14881917,14930897,14992366,15366960,15712894,16038247,16353263,16625115,16950748,17253027,17514784,17775583,17998696,18268984,18581272,18830773,19125386,19350893,19575038,19825556,20039049,20247235,20412596,20548986,20883830,21177881,21448036,21697973,21888932,22167168,22398109,22593551,22772734,22921271,23142848,23394145,23573126,23793516,23944182,24105991,24282794,24415314,24555406,24649517,24753466,25086967,25380430,25650375,25899457,26085565,26369206,26596092,26793047,26967731,27118870,27347989,27596842,27777047,27991458,28143089,28307608,28483298,28610955,28751667,28846232,28953950,29222925,29446521,29645428,29820747,29930041,30150088,30299376,30430558,30539230,30620542,30799998,30970150,31084403,31219320,31304953,31413007,31518310,31584664,31667252,31710777,31814402,32181769,32527953,32854088,33167294,33418917,33760410,34055961,34326731,34577871,34794957,35084383,35395499,35650524,35930512,36153842,36384854,36635786,36830436,37047039,37202519,37368535,37692107,37984324,38251930,38499465,38677198,38971194,39196933,39398039,39573456,39710853,39958625,40199951,40385330,40585113,40736367,40907482,41083298,41198876,41344966,41432979,41573188,41892002,42183400,42451791,42702594,42882438,43173463,43398235,43599020,43775676,43906876,44160530,44398222,44587157,44784315,44934441,45107146,45281022,45394333,45541625,45627800,45766154,46014697,46240338,46443306,46616525,46732786,46946636,47097659,47228023,47334412,47401068,47601056,47762713,47885075,48002942,48088092,48203079,48308614,48363358,48448125,48488761,48628665,48943727,49235880,49508491,49753191,49940124,50223598,50447803,50647285,50821778,50946740,51213234,51447873,51639722,51826299,51975858,52151721,52326241,52431729,52582071,52669622,52820528,53071797,53287273,53494317,53661982,53786646,53990643,54139486,54271505,54378112,54439359,54649601,54804200,54931498,55041310,55126405,55242648,55348037,55405732,55488162,55529764,55672423,55922617,56134466,56342666,56507355,56636150,56836115,56986942,57117284,57223338,57281767,57496304,57649461,57777333,57883974,57968801,58089661,58195105,58254186,58331732,58372625,58498196,58674313,58804546,58944775,59038794,59121009,59242335,59328137,59400927,59454657,59477906,59624440,59710599,59783077,59838502,59878002,59949943,60000381,60027745,60060711,60076643,60259504,60643583,61015544,61384956,61739336,62061321,62430520,62775321,63102208,63415911,63670504,64040214,64385220,64712722,65027775,65319293,65625939,65937282,66191985,66473788,66698497,66957412,67316089,67649417,67984879,68288036,68556571,68881770,69174862,69442860,69691123,69865255,70211512,70506740,70777285,71028168,71242172,71500093,71743044,71927618,72130110,72279782,72514357,72873602,73203960,73540776,73841081,74113401,74433974,74726814,74993797,75243073,75422375,75767950,76062801,76332676,76583375,76793753,77054868,77294730,77480193,77680480,77830866,78060056,78374089,78636769,78924323,79152330,79365952,79616994,79839891,80042327,80216876,80332947,80621812,80846697,81047747,81223038,81352675,81554249,81716473,81838842,81958693,82044088,82276494,82635306,82958307,83298939,83593908,83872636,84187511,84481307,84753126,85000355,85185284,85527185,85821279,86090867,86340306,86540180,86811000,87046983,87238531,87427305,87576880,87818990,88131937,88385668,88675526,88900647,89123322,89374314,89592928,89798109,89967525,90094434,90375641,90599524,90797774,90975179,91097101,91307573,91464160,91588917,91701463,91786620,92021539,92334149,92583169,92877836,93103714,93327544,93578090,93791835,93999860,94165312,94298565,94574304,94799020,94999986,95175515,95292685,95505844,95660996,95788119,95896432,95981371,96189939,96441247,96620172,96840765,96991627,97153009,97330085,97462900,97602872,97697091,97787988,97987128,98136940,98267639,98373054,98430817,98577081,98663526,98735891,98789229,98830728,99093802,99452764,99768256,100111289,100405921,100692484,101006822,101285026,101562657,101801714,102005944,102336625,102630018,102898017,103147925,103329339,103616490,103840435,104039580,104217610,104364096,104632412,104944805,105198292,105483137,105707251,105936318,106185295,106385365,106599986,106758842,106910321,107173793,107398235,107597220,107771551,107877826,108098898,108252091,108384485,108491946,108569162,108836782,109148004,109403058,109683298,109906642,110137304,110388236,110583251,110799860,110955508,111113470,111373372,111596092,111794524,111967859,112076812,112301173,112452427,112583988,112690189,112764583,113005748,113247235,113432558,113632180,113783833,113954857,114130477,114246470,114392411,114480424,114595580,114774132,114922504,115053406,115160187,115221186,115365046,115450908,115525006,115579430,115609494,115893789,116199820,116458302,116731220,116955369,117190780,117439435,117625403,117845107,117996402,118166701,118415016,118640976,118843888,119017093,119133298,119347218,119498192,119628927,119735316,119802016,120056939,120294996,120484758,120677217,120826306,121001028,121176200,121284738,121432641,121517801,121643494,121821271,121966713,122102203,122201831,122272449,122406112,122491809,122564764,122618251,122646452,122908349,123143079,123334928,123521596,123671169,123847200,124021657,124127253,124277277,124364989,124493965,124671532,124811203,124948766,125047131,125120763,125249570,125334728,125409109,125463267,125488847,125698196,125852959,125980128,126090180,126175283,126291474,126396436,126454397,126536995,126578569,126667802,126774331,126847495,126927153,126973480,127014845,127081122,127122282,127156896,127179226,127187141,127546368,127926910,128289498,128651662,128995718,129340645,129699930,130015175,130359704,130653468,130947517,131306786,131645623,131977434,132282495,132546847,132879102,133173000,133441887,133690676,133875298,134235375,134583849,134907729,135221376,135515945,135819962,136133536,136386413,136672688,136898020,137142925,137457063,137732340,138013541,138250631,138451459,138718342,138940902,139141272,139315877,139423816,139791437,140136340,140463888,140778914,141070572,141377218,141688413,141943116,142225466,142449993,142698779,143012434,143286000,143568204,143802527,144007088,144269096,144492783,144691263,144865146,144970369,145316040,145611225,145881813,146132745,146346819,146604705,146847908,147032272,147235170,147384415,147587117,147837509,148030451,148247033,148401989,148548773,148729485,148878501,149007461,149114003,149174785,149552298,149899137,150226118,150540602,150825115,151138242,151446088,151702758,151977243,152202071,152459152,152773290,153035865,153323685,153551930,153765139,154016601,154239015,154441534,154616399,154732440,155076471,155370360,155640768,155890809,156096194,156361090,156598901,156788572,156983222,157133090,157343110,157592676,157775793,157996022,158146240,158299290,158476995,158625477,158760175,158861774,158937680,159279740,159573995,159843317,160093022,160292826,160563505,160799825,160991142,161180218,161329757,161544644,161793103,161971486,162192688,162343846,162502692,162679608,162822781,162958628,163058561,163141501,163422834,163646773,163845352,164022372,164144651,164354857,164511654,164635984,164749056,164834215,164997694,165171416,165277405,165428094,165515183,165618715,165725315,165800144,165879693,165926286,165997318,166370077,166715675,167042857,167357047,167624737,167953647,168253959,168518294,168773811,168996405,169269285,169583701,169835658,170127711,170353050,170577198,170828503,171037747,171247200,171410019,171552827,171886400,172180591,172450214,172699296,172885964,173169045,173395994,173593390,173768359,173918835,174147457,174396387,174576661,174791969,174943215,175107573,175283193,175411530,175551719,175646659,175758351,176089271,176382643,176650460,176900711,177082329,177369206,177593417,177792022,177970032,178117085,178351728,178598165,178779664,178991373,179140876,179307447,179482052,179607630,179751401,179842738,179957450,180221343,180445519,180644644,180818940,180925419,181146373,181299270,181431769,181539391,181616712,181800146,181969393,182085383,182215560,182300807,182410438,182517689,182580079,182663520,182705910,182815881,183139868,183431847,183700279,183947814,184124481,184418885,184644428,184845625,185021721,185159181,185406246,185647873,185833035,186032890,186184576,186355530,186531185,186647402,186793049,186881380,187011772,187266365,187488532,187687340,187864034,187976381,188196309,188346709,188477940,188585100,188654952,188849867,189011782,189132388,189255746,189341400,189454431,189559741,189617444,189701888,189742991,189861802,190110157,190336182,190538933,190712334,190828287,191042298,191193552,191324350,191430683,191497541,191696473,191858662,191981010,192099361,192184556,192299224,192404913,192459821,192544571,192585245,192691760,192869705,193015364,193150658,193250701,193321009,193454833,193540635,193613626,193666748,193695331,193834879,193925803,193995475,194053386,194094169,194160113,194213428,194235561,194276770,194293234,194439572,194798911,195142672,195471713,195782691,196039862,196377762,196670532,196939986,197190798,197385077,197704418,198005212,198268868,198527516,198750502,198991453,199238196,199417121,199640535,199791810,199990285,200304486,200590088,200866199,201107273,201299680,201573948,201799399,201999273,202175250,202290307,202567856,202797347,202992894,203170702,203319057,203500529,203676563,203787322,203929829,204015466,204194864,204509505,204790620,205068251,205305033,205503398,205775376,205999525,206199063,206373464,206485727,206768780,206995043,207192285,207367749,207518108,207703379,207876437,207988904,208126539,208212787,208381790,208631922,208832718,209046151,209207290,209344894,209535951,209684773,209815455,209920842,209975420,210195818,210344609,210478291,210586340,210666237,210793447,210893114,210955738,211026453,211067401,211251020,211564540,211838311,212120521,212355104,212559343,212821547,213045304,213243714,213417773,213523105,213816638,214043091,214244345,214421225,214559851,214754642,214921684,215038542,215166326,215251573,215433940,215684437,215877540,216094199,216249064,216395519,216576779,216725794,216854711,216960987,217021060,217242803,217394582,217525464,217632511,217704750,217838098,217933344,217998091,218064424,218105428,218284559,218534341,218721488,218940937,219093729,219244001,219420341,219568942,219702541,219807481,219873296,220090536,220240823,220372349,220478683,220547442,220682924,220777322,220845308,220907152,220948110,221097112,221272227,221383334,221530871,221616581,221713368,221821770,221905574,221982471,222032507,222072557,222209933,222295844,222369165,222422665,222451176,222531972,222576019,222608984,222633367,222649265,222865780,223179258,223433438,223723135,223947534,224170069,224421009,224640677,224845592,225014686,225141273,225422802,225646748,225845635,226022305,226144886,226354895,226511853,226636093,226749396,226834562,227039502,227287569,227461892,227687695,227839376,227999679,228176188,228314131,228452568,228549355,228634324,228835968,228986257,229117727,229223598,229284084,229427721,229516441,229588095,229642847,229683456,229885751,230136064,230314897,230536044,230686997,230847916,231025329,231158691,231298361,231392946,231482656,231682421,231832667,231963310,232068768,232126636,232272724,232359279,232431710,232485113,232526463,232693044,232866865,232979157,233118688,233205288,233312188,233418290,233486140,233566615,233612582,233674225,233793775,233879142,233951712,234005743,234028614,234113240,234153992,234189026,234212784,234226705,234445789,234692541,234873669,235085679,235235491,235401753,235576519,235702174,235845763,235937170,236040585,236228638,236378507,236508352,236613482,236667361,236815352,236903540,236978323,237033349,237067996,237247497,237417214,237533148,237663409,237748769,237857993,237965342,238028057,238111446,238153880,238224378,238336179,238421163,238493944,238546995,238571998,238656740,238698173,238733338,238755723,238767287,238953692,239118983,239236507,239362246,239449160,239561030,239667293,239726664,239810206,239852430,239927023,240034841,240119779,240193267,240247537,240276778,240356430,240397404,240432562,240455165,240465463,240597479,240691477,240758279,240822587,240863453,240928229,240981555,241005494,241045988,241061934,241106964,241160169,241201777,241238442,241258923,241273827,241307042,241323155,241336697,241344048,241346568,241674549,242069093,242453834,242843634,243221094,243591406,243975484,244339749,244713961,245060202,245394240,245778409,246155922,246521846,246880036,247196512,247572157,247918179,248244736,248558130,248832650,249189932,249571816,249933346,250300397,250646732,250987805,251346239,251662554,252005324,252300718,252591079,252950418,253294222,253623220,253934290,254191422,254529543,254822418,255091577,255342453,255536893,255891646,256272761,256634798,257000606,257345573,257687849,258045387,258360122,258706478,259001333,259292758,259651802,259993761,260324257,260633004,260892697,261226371,261521069,261790887,262041062,262229941,262581296,262932191,263254475,263573198,263864491,264165269,264480037,264732033,265022640,265247356,265489161,265803914,266085156,266362731,266599821,266797703,267069982,267294292,267493669,267667909,267780652,268150628,268530042,268893453,269251902,269598566,269945052,270303949,270619461,270961742,271256411,271551528,271910781,272246108,272579664,272885574,273150870,273480274,273773058,274042310,274291553,274471163,274838304,275183389,275510591,275825660,276117593,276423973,276735160,276989958,277272949,277497420,277745856,278059135,278333035,278615497,278850066,279054088,279316453,279540301,279738550,279912952,280018330,280393741,280740690,281067919,281382760,281670595,281980630,282291148,282546403,282824726,283047286,283301547,283616180,283885491,284169683,284400211,284609456,284867019,285090040,285287876,285462300,285573532,285919466,286214420,286484414,286734762,286946247,287206263,287447021,287632687,287832652,287983409,288188864,288438597,288626292,288845592,288998384,289148495,289325137,289473289,289607000,289712192,289779241,290171770,290549386,290914945,291274171,291612705,291966593,292320707,292640213,292971979,293265912,293571983,293930594,294254433,294594400,294890300,295168727,295482745,295777027,296048495,296296138,296481025,296857023,297203488,297530202,297844340,298118355,298440930,298746197,299006611,299272787,299495773,299761131,300074764,300329105,300618781,300842746,301065273,301316451,301536253,301741098,301910353,302038720,302413425,302759724,303085712,303399727,303672772,303997360,304300201,304561785,304823737,305047032,305316018,305628894,305877116,306172272,306398459,306621658,306872590,307086545,307294325,307460758,307595494,307931508,308224480,308494860,308744866,308937346,309215147,309445857,309641068,309821210,309969940,310191006,310440892,310619774,310841047,310992056,311153227,311330332,311464051,311603616,311698321,311801629,312173250,312519686,312846289,313160398,313422973,313756294,314054282,314320137,314570604,314794104,315073263,315387266,315639968,315928531,316153542,316380620,316630466,316835010,317045423,317208074,317357466,317688544,317982112,318250215,318500285,318682568,318968941,319193572,319391104,319569479,319717233,319950889,320197970,320378789,320590968,320741151,320907308,321081913,321207729,321351262,321442627,321562653,321890091,322183135,322452218,322700586,322878133,323167359,323393082,323595169,323772176,323914515,324153893,324399063,324582565,324789035,324938461,325105215,325282536,325404094,325548958,325638313,325759641,326020412,326243434,326442201,326615635,326722902,326947996,327098914,327231308,327337845,327412295,327601841,327767237,327884684,328010748,328097505,328209354,328315582,328375157,328458610,328500932,328624825,329011779,329388576,329752034,330111415,330426668,330804102,331150722,331477344,331792187,332074699,332410977,332766234,333084242,333417714,333711206,334004438,334318141,334580093,334867913,335094764,335324893,335684384,336030106,336357656,336671468,336924821,337267436,337562348,337832349,338082349,338285352,338591095,338897532,339157416,339426426,339649952,339886512,340136266,340317196,340538254,340687542,340881510,341240914,341586499,341914921,342227118,342482205,342823484,343117116,343386269,343635351,343835512,344148256,344452328,344713478,344976292,345200972,345440102,345688722,345864943,346086839,346239640,346432858,346747763,347037126,347310533,347555173,347743575,348023493,348246823,348446753,348623472,348743645,349014950,349246536,349440507,349623813,349772673,349949794,350123074,350232448,350380986,350467906,350644781,351003886,351345919,351676359,351985204,352244771,352578402,352873317,353143157,353393276,353582527,353907328,354207137,354471633,354725603,354947706,355191516,355442291,355621162,355840548,355990787,356194546,356509342,356790794,357068208,357305788,357503123,357775571,357999986,358199524,358373337,358486655,358769241,358995532,359192928,359367467,359518401,359703679,359876828,359989169,360127126,360213479,360399106,360713536,360989800,361269677,361507447,361707447,361975354,362198502,362398235,362573211,362681581,362968744,363191713,363393683,363571278,363716496,363905731,364074587,364190458,364323638,364409292,364584064,364832689,365032124,365247109,365405447,365546671,365733283,365882786,366012032,366117326,366170691,366394656,366547016,366678731,366786318,366862082,366992689,367090648,367154378,367222123,367262750,367465231,367824494,368155450,368492259,368792193,369064417,369386640,369678948,369946463,370194093,370373174,370719267,371014165,371284201,371534451,371746279,372006126,372247144,372432649,372632649,372783476,373010991,373325375,373589373,373876079,374105073,374317358,374569905,374791594,374993753,375169206,375283823,375573834,375797837,375999489,376175641,376305839,376506915,376668551,376790360,376911560,376997369,377214803,377528357,377788742,378076303,378302503,378518905,378768780,378993516,379196387,379368793,379488624,379774927,379999951,380199881,380375214,380500726,380706985,380867627,380990920,381107200,381192385,381391753,381640765,381819583,382040701,382190598,382349248,382526688,382670758,382806409,382906272,382984166,383191686,383341981,383471601,383578419,383642622,383784076,383874218,383943978,384001681,384042364,384268817,384581784,384830323,385125050,385351314,385574513,385825340,386039400,386247446,386413963,386545605,386822849,387046326,387247460,387423311,387541754,387754480,387909506,388036629,388145412,388230506,388438856,388688167,388867092,389088561,389239577,389400937,389577811,389711832,389851361,389946171,390035064,390235386,390385737,390516233,390621929,390679889,390825711,390912586,390984956,391038430,391079575,391289693,391539220,391719257,391935629,392086308,392250610,392425922,392555439,392695732,392790284,392886907,393081256,393230759,393360379,393466687,393522404,393669733,393755266,393827699,393884419,393922688,394095892,394267325,394380052,394516671,394602518,394710645,394816103,394882309,394964861,395008581,395074881,395190036,395275618,395348581,395401808,395424172,395508954,395551287,395587049,395609939,395622350,395912142,396295778,396655638,397030278,397376240,397712174,398071467,398404088,398740084,399042490,399314603,399681163,400026585,400352286,400664826,400913946,401260608,401555607,401826216,402076818,402290507,402604798,402961475,403278857,403613960,403907724,404199368,404513594,404780800,405065328,405296269,405515161,405835235,406127151,406393342,406644769,406824253,407116038,407341363,407541294,407718272,407851066,408162108,408517590,408835362,409168909,409462708,409755640,410069420,410331694,410619192,410846204,411071397,411385829,411679347,411950614,412199516,412381362,412668879,412894604,413095122,413270882,413398785,413695569,414002165,414262049,414531059,414754907,414991089,415240906,415422292,415643265,415792610,415967408,416219043,416441025,416645660,416816008,416935509,417146791,417296581,417426945,417532212,417598566,417924081,418277738,418597984,418924334,419218127,419514265,419827506,420079430,420369220,420596279,420831946,421146807,421436488,421709629,421954269,422142776,422422960,422646248,422845933,423022729,423143099,423457020,423758424,424021148,424280994,424503714,424744518,424992004,425169253,425393551,425544770,425728315,425978503,426191730,426399951,426565060,426692896,426892574,427044115,427174962,427281190,427340225,427659770,427959615,428224349,428478585,428700583,428943923,429194790,429373658,429593390,429743720,429931436,430182312,430389622,430599538,430761333,430894569,431092147,431242098,431372244,431477216,431534910,431816525,432043054,432240268,432414441,432565902,432750872,432924112,433036453,433174501,433260868,433401945,433577831,433704531,433846592,433940239,434024527,434142850,434228009,434301222,434354758,434377342,434742639,435088467,435414718,435729824,436022006,436328153,436639660,436894147,437177866,437402176,437650185,437963255,438237742,438520127,438754857,438958599,439221118,439445057,439643671,439818156,439923724,440266915,440562301,440832689,441084087,441299892,441555781,441799986,441983636,442187843,442336904,442538425,442789069,442983096,443199489,443354223,443500641,443682721,443831617,443960727,444065759,444125581,444471717,444766615,445036847,445286886,445498960,445758912,445999916,446185365,446385365,446536283,446741003,446991373,447179545,447398165,447551637,447701012,447878242,448026606,448159517,448265059,448330797,448621013,448845050,449046773,449222925,449353348,449554304,449715709,449837707,449959138,450044919,450201357,450375989,450487993,450635197,450721347,450817999,450925182,451010113,451086380,451137099,451184599,451526696,451821329,452090651,452340384,452540949,452810769,453047747,453238476,453429106,453577707,453792356,454041473,454220418,454441605,454590970,454749794,454927256,455071578,455207222,455306980,455388273,455670525,455895031,456094107,456269762,456393498,456602401,456760284,456884698,456998093,457083340,457246169,457420052,457525211,457676604,457763763,457866637,457973797,458048654,458128372,458175475,458240565,458518181,458741294,458942582,459118678,459237226,459449826,459604817,459731870,459840873,459926030,460090778,460266190,460376353,460522383,460609045,460713075,460820430,460892269,460972317,461018138,461083785,461284037,461434402,461564975,461670699,461728666,461874537,461961464,462033677,462087310,462128373,462243674,462348474,462408213,462484704,462526050,462586979,462640643,462670306,462709080,462727031,462806670,463177006,463523277,463849195,464163079,464422350,464758802,465053946,465320508,465571627,465795406,466077919,466390956,466643701,466929820,467154557,467382742,467632384,467832223,468046347,468206366,468362078,468689986,468982848,469252022,469500369,469678752,469967730,470192591,470394826,470571742,470714796,470953788,471198902,471382299,471589196,471738860,471905334,472082410,472204633,472349259,472438896,472566394,472891310,473184150,473452183,473700180,473874992,474169669,474395792,474597347,474773499,474911547,475157310,475399126,475584603,475785855,475936410,476107273,476282711,476400198,476545532,476634316,476763088,477018640,477241164,477438514,477615602,477727284,477948157,478098970,478229340,478337088,478407904,478601841,478764562,478883571,479008238,479093938,479207211,479312577,479370425,479454869,479495972,479623652,479938483,480231517,480502757,480751694,480933551,481221456,481446859,481647573,481823228,481951474,482208299,482447041,482636957,482830487,482979885,483153157,483328882,483438565,483586489,483671804,483814081,484065718,484288170,484492588,484663097,484782248,484993866,485143460,485274195,485379505,485445711,485649798,485808724,485932550,486047167,486132950,486248285,486353499,486407241,486492025,486534849,486666998,486918074,487135791,487340840,487509996,487633511,487839484,487988721,488119036,488226287,488288613,488497650,488653445,488779281,488890718,488975741,489091892,489196499,489252899,489337361,489378815,489496019,489672171,489809596,489948187,490044466,490120870,490246190,490333243,490406729,490460602,490485117,490628893,490717161,490788907,490843357,490883954,490951660,491005832,491031607,491067568,491083500,491241284,491556117,491837794,492115537,492353558,492549826,492822998,493047147,493246741,493421234,493534552,493816402,494043253,494240411,494414287,494566066,494750805,494924115,495036491,495174539,495261061,495429138,495679257,495881378,496093108,496255234,496391885,496584365,496733538,496863721,496969389,497024290,497244148,497393243,497525465,497633962,497714826,497841195,497941139,498003948,498075307,498116226,498279147,498527305,498727767,498942514,499100880,499241950,499428653,499578283,499707895,499813117,499866574,500089557,500242078,500373884,500481793,500557954,500687933,500786319,500849727,500917960,500958633,501097183,501273748,501393417,501538454,501627104,501719281,501829480,501914591,501987154,502040258,502068454,502216334,502302988,502376909,502431040,502463190,502540491,502586826,502616879,502645442,502661429,502835308,503085609,503274124,503492541,503646160,503795157,503972866,504121222,504253662,504359603,504423757,504642266,504792225,504924289,505030931,505100123,505235369,505328926,505397017,505459897,505500820,505649178,505823649,505935814,506083166,506169326,506265848,506372660,506457990,506534041,506585068,506624413,506762048,506848296,506921518,506975190,507003774,507084304,507128709,507161380,507186123,507201956,507351871,507526581,507634648,507782663,507867959,507969734,508077818,508157680,508235319,508284144,508329460,508462100,508547909,508620692,508675073,508702378,508784001,508827326,508860434,508884365,508900221,509006749,509111685,509165021,509251768,509293550,509351827,509406391,509439708,509478132,509496588,509525805,509593083,509633947,509669175,509691561,509699864,509739874,509756239,509769583,509777004,509781887,510039529,510434348,510818518,511211150,511589106,511957181,512341273,512716980,513083935,513440058,513759548,514149825,514527695,514892945,515251994,515578028,515943958,516294181,516617129,516933802,517224783,517555200,517939339,518298772,518675798,519021868,519356926,519716142,520054508,520386340,520691879,520958167,521328504,521674932,522001011,522314586,522574327,522910401,523205699,523472450,523723142,523947187,524257025,524641011,525000552,525376522,525723007,526058355,526417361,526750999,527086384,527391364,527659902,528028806,528373875,528700404,529013861,529267950,529608274,529901577,530172660,530423601,530643170,530950014,531307710,531624266,531963500,532256963,532545576,532859838,533132405,533415400,533648736,533860843,534185916,534478756,534746824,534994891,535169278,535464211,535690293,535891792,536068266,536206153,536516519,536899945,537259998,537632879,537978358,538316436,538675479,539005400,539342524,539642675,539918952,540282910,540627673,540952239,541266298,541518375,541863895,542158585,542427850,542679165,542888696,543208838,543564590,543882045,544215845,544509995,544802528,545116441,545378911,545666353,545893674,546118292,546433550,546726206,546997382,547246327,547428219,547716418,547941604,548142479,548318078,548446618,548765633,549120133,549439648,549770697,550064160,550357155,550671788,550929848,551218648,551443139,551673124,551988287,552281597,552553746,552800463,552984713,553269995,553494179,553694466,553869162,553994817,554299580,554603751,554865040,555129136,555353179,555592253,555840747,556017872,556239035,556391665,556571198,556822323,557040376,557245033,557414651,557538005,557743978,557893481,558023460,558130718,558193426,558538921,558920337,559282052,559648330,559993366,560335663,560693622,561007366,561353963,561648705,561940058,562299276,562641408,562971805,563280889,563540061,563874419,564168967,564438961,564688996,564879430,565228552,565579956,565902409,566221776,566513601,566812516,567127356,567379497,567671036,567895899,568136480,568451322,568733244,569011043,569249225,569445057,569718434,569942527,570142401,570316957,570430324,570785808,571134668,571458387,571771985,572066539,572370118,572683913,572936642,573223339,573449301,573693480,574007714,574285133,574563742,574801954,575001873,575270582,575493807,575693176,575868404,575977215,576313206,576606586,576875404,577127011,577348508,577599973,577845766,578028134,578238582,578388533,578584080,578832665,579032861,579247608,579406212,579546953,579733712,579883671,580013263,580118477,580171988,580544852,580891802,581219223,581534136,581823029,582131805,582442868,582697578,582977405,583200630,583452743,583767556,584037673,584321599,584552975,584761036,585020034,585242950,585441129,585614141,585724642,586070990,586365845,586636120,586885983,587098835,587358486,587599651,587785100,587984974,588135983,588340702,588590947,588779756,588997970,589151764,589300313,589478570,589626934,589758790,589865158,589930234,590274917,590569102,590839312,591089956,591296853,591560503,591797537,591987137,592183945,592333889,592542810,592791277,592976635,593196423,593347598,593500089,593675146,593825730,593959588,594062637,594134887,594421449,594646844,594846466,595022429,595148658,595353570,595515038,595637743,595754913,595840071,596000160,596174828,596283134,596431141,596516095,596617918,596726002,596806089,596883741,596932510,596989638,597381578,597759247,598124416,598482880,598816443,599175778,599529193,599849560,600175018,600468425,600780141,601138852,601453487,601798267,602093644,602377480,602692322,602980058,603255084,603498497,603691266,604064906,604409753,604737071,605051711,605320924,605648686,605948704,606212919,606470412,606693433,606965416,607277730,607529662,607822532,608048397,608272654,608523002,608734396,608942701,609107019,609248840,609620286,609966906,610293508,610607654,610871252,611203928,611502560,611767771,612019821,612241324,612520272,612834774,613087008,613376753,613600994,613827966,614078393,614284114,614494282,614656226,614804433,615136100,615430124,615698759,615948010,616131708,616416806,616642502,616839989,617016819,617166078,617398101,617645744,617826390,618039722,618190087,618355530,618530723,618656007,618799750,618892052,619011922,619380985,619725921,620052533,620366166,620620507,620960579,621253608,621524691,621775848,621995615,622282594,622593873,622848612,623130260,623354535,623583903,623834119,624031900,624247144,624404319,624566432,624891519,625184450,625452518,625700676,625874652,626169779,626395931,626597248,626773960,626912008,627157035,627399825,627584742,627786589,627936745,628107377,628282794,628401117,628546379,628635079,628771304,629091820,629384072,629651006,629900948,630080231,630372413,630597913,630797948,630975088,631108751,631359935,631599454,631784969,631985113,632135408,632307538,632482605,632596337,632743285,632830060,632965566,633215935,633439554,633642074,633815965,633931280,634147246,634298051,634429465,634535462,634603538,634800594,634963280,635085453,635205038,635290454,635403824,635510204,635565849,635650567,635691319,635832308,636191723,636537952,636865813,637178608,637433016,637774596,638068724,638338347,638587485,638787590,639099276,639403404,639664841,639929336,640153071,640392180,640640604,640818031,641039306,641191466,641383768,641698630,641988917,642261780,642507041,642694799,642975676,643199363,643397956,643575214,643696708,643966650,644199237,644391969,644576661,644725504,644902804,645076238,645183524,645333652,645420040,645588955,645903588,646189835,646465715,646707412,646898726,647174003,647399293,647599916,647775641,647892349,648167077,648398144,648593551,648772615,648921173,649099216,649276401,649386865,649531348,649617379,649777928,650028875,650237201,650447200,650609430,650741096,650939809,651089438,651220082,651325385,651383116,651599802,651751307,651879717,651985039,652071887,652194300,652297972,652357915,652432899,652474553,652646230,652960533,653238254,653516456,653755033,653954651,654223598,654447089,654646031,654821420,654930551,655217058,655440757,655640610,655818584,655964614,656153317,656323413,656437876,656572562,656658216,656831426,657080410,657280606,657495031,657653957,657794467,657981233,658131500,658261141,658366258,658419892,658641780,658794546,658926849,659034597,659111216,659240506,659339424,659402553,659471267,659511950,659680817,659931700,660126315,660342827,660498244,660643391,660826578,660975466,661104647,661209160,661267652,661491480,661642965,661774435,661880180,661954602,662087287,662183187,662247862,662314047,662355271,662498532,662674313,662789799,662936051,663023917,663117823,663225440,663310315,663385075,663438624,663471240,663614525,663700351,663774667,663828930,663858893,663937271,663982476,664014634,664041175,664057086,664279059,664662853,665029665,665402506,665751036,666080151,666438554,666785282,667112942,667426581,667680387,668056449,668403114,668729853,669044304,669320477,669640392,669946309,670206182,670473991,670697111,670974878,671333866,671654095,671995742,672288331,672571282,672886345,673178405,673451072,673695808,673884236,674224745,674518440,674787530,675036218,675235527,675508475,675743114,675934858,676121470,676271008,676531424,676890131,677205088,677549432,677844790,678128602,678443572,678731568,679006258,679250098,679441556,679778805,680071218,680341526,680592072,680785763,681062605,681293028,681488260,681669976,681818920,682070245,682382214,682634136,682927326,683153191,683377182,683627530,683839295,684047348,684212058,684348259,684622548,684847873,685047621,685223150,685337782,685553814,685706852,685834822,685941365,686026183,686291256,686650504,686965786,687310204,687603761,687890398,688205003,688485453,688763245,689000559,689203475,689535497,689829430,690098016,690347211,690531336,690815902,691042130,691239589,691415935,691565566,691829997,692143285,692396302,692682549,692907573,693135352,693385113,693585032,693799419,693959970,694108716,694375053,694597913,694797948,694972476,695080287,695301004,695450971,695584037,695691820,695771367,696035016,696346344,696601054,696882738,697107412,697336780,697586526,697784777,697999790,698157098,698311973,698573960,698797304,698995966,699169779,699274715,699500641,699652553,699784450,699891519,699966467,700204319,700447109,700631865,700834175,700983938,701154479,701330295,701448675,701593929,701682629,701795615,701975848,702124754,702253671,702360544,702420472,702566201,702652498,702725984,702781020,702811985,703112983,703468898,703786324,704120279,704414534,704706793,705020854,705283485,705570934,705798913,706022621,706338572,706630387,706901535,707150998,707332421,707621209,707846115,708047144,708222512,708351910,708647618,708953277,709213125,709483137,709707041,709943019,710192928,710375372,710595931,710745883,710918345,711170074,711393551,711597220,711768653,711886465,712099009,712249255,712379898,712485328,712551597,712851683,713156281,713417291,713682213,713905892,714144805,714393138,714571065,714792296,714944021,715123413,715374433,715593019,715798039,715967490,716090284,716297083,716446586,716575711,716683795,716746732,717013759,717246647,717439015,717624037,717773097,717950249,718123747,718230514,718380971,718467514,718599893,718776150,718913841,719052404,719148872,719224828,719350956,719437593,719511304,719565141,719589892,719907071,720207509,720471767,720727095,720949507,721190578,721441976,721620922,721841312,721992230,722178272,722429302,722638084,722847908,723010265,723141468,723340447,723490175,723620958,723726296,723784044,724064342,724291298,724488400,724663120,724814111,724998262,725171943,725283997,725422742,725509666,725650063,725825753,725953635,726094010,726188876,726273037,726391830,726477134,726550139,726603682,726626532,726912369,727136152,727335543,727513552,727659821,727848523,728018780,728132998,728268006,728353604,728497607,728672163,728797944,728941617,729032814,729120532,729234668,729320476,729393295,729446582,729468773,729690074,729843106,729975500,730083087,730160085,730289010,730388054,730451379,730520145,730560820,730660400,730767560,730829467,730912956,730955300,731006353,731062556,731103210,731137639,731159671,731171926,731549783,731896468,732223694,732538141,732824227,733136187,733445172,733701373,733975473,734201414,734457033,734771295,735037155,735322230,735552344,735763711,736017891,736239945,736439518,736616064,736729594,737074686,737368941,737638793,737889669,738096979,738360258,738598069,738786682,738984190,739134176,739342628,739591122,739777118,739996850,740148068,740300250,740474543,740625905,740759770,740862980,740935175,741277464,741572169,741841889,742092134,742293813,742561545,742799525,742989260,743181620,743330688,743543546,743793251,743973162,744193978,744343058,744500802,744678516,744823923,744959378,745058914,745139004,745422660,745646935,745846382,746020686,746145984,746354431,746512895,746637120,746750796,746836240,746998242,747172706,747278266,747428382,747516094,747617911,747725806,747801699,747880808,747928456,747993663,748330955,748623795,748893725,749144313,749338305,749614916,749845396,750040676,750222658,750371561,750591965,750839279,751018116,751241047,751392553,751553514,751729373,751865375,752004107,752099943,752195061,752469427,752694766,752894444,753070295,753185076,753400728,753554109,753681897,753788643,753873487,754043404,754218892,754330113,754472123,754557518,754664460,754771032,754840011,754920496,754965933,755046883,755318378,755542814,755741939,755916683,756028575,756246690,756397717,756526562,756633815,756718655,756893911,757066688,757179246,757316776,757402863,757510330,757616145,757682408,757764925,757809194,757888961,758079521,758228094,758358941,758464251,758518738,758666654,758752504,758828029,758883266,758919308,759043031,759142824,759205735,759275842,759316799,759378721,759433235,759460354,759500301,759516882,759613362,759938554,760231807,760499749,760747998,760922357,761216695,761442910,761644381,761821121,761959225,762204196,762447308,762631637,762834479,762983906,763154363,763330459,763449007,763594164,763682933,763809912,764066417,764289578,764487294,764662762,764773869,764995457,765146802,765277544,765384997,765456738,765649372,765812982,765930892,766056736,766142675,766255421,766361166,766419133,766503538,766544872,766660411,766911754,767134371,767336743,767511608,767626097,767842679,767993330,768124835,768230707,768299420,768496209,768658489,768780662,768900674,768986170,769099672,769205875,769261722,769346386,769387202,769489649,769667515,769815892,769950625,770052133,770118883,770255943,770341805,770415167,770468618,770497137,770634923,770726958,770796465,770855157,770896038,770961911,771015033,771037520,771078103,771094727,771217453,771468430,771687409,771892450,772061831,772184527,772391459,772541053,772670335,772778101,772841347,773049198,773205848,773330381,773443243,773528393,773644485,773749180,773803782,773889553,773931053,774047497,774223705,774361662,774500225,774596532,774672649,774798935,774885316,774959209,775013018,775037862,775181020,775269797,775341402,775396102,775436710,775502931,775558102,775583939,775620258,775636236,775751662,775928920,776061854,776201742,776296081,776375084,776499716,776585353,776658794,776712157,776736114,776882098,776968522,777040944,777094291,777135668,777206532,777258002,777284923,777318590,777334784,777424121,777530405,777597925,777678374,777724388,777770851,777831894,777872631,777907209,777929437,777936896,778021563,778062260,778097672,778121310,778134973,778171016,778190473,778201480,778212307,778217201,778403673,778787679,779159116,779529063,779882735,780205427,780573340,780919153,781245323,781558578,781810789,782182593,782529391,782856828,783171724,783461546,783769341,784080719,784335661,784616048,784839539,785100870,785460197,785792027,786128619,786430198,786700191,787024093,787316149,787584378,787831913,788008811,788355382,788650132,788920520,789170953,789384285,789643117,789884814,790070032,790269668,790421447,790658463,791017551,791346248,791683376,791983530,792257070,792576297,792867800,793135480,793386392,793566534,793911626,794205986,794475782,794726665,794934150,795197534,795435464,795623622,795821557,795971473,796203298,796516874,796778791,797066380,797293140,797508366,797756524,797982711,798185518,798358758,798476789,798763478,798989076,799189482,799365263,799492189,799695802,799857872,799980129,800098473,800183647,800420149,800779147,801099720,801441549,801734621,802016501,802331617,802623890,802896396,803141873,803329465,803670258,803964107,804233225,804481447,804681810,804954170,805188809,805380819,805567487,805717053,805961810,806275156,806525722,806817371,807043993,807266738,807517983,807734096,807940601,808108637,808237770,808517019,808740139,808940867,809117376,809236989,809448811,809603799,809730834,809841012,809926116,810163897,810475354,810727338,811020943,811246570,811470799,811720733,811932912,812141525,812306263,812441680,812716039,812941455,813141182,813317250,813432180,813647557,813801141,813928726,814035727,814120601,814333927,814584453,814763564,814982073,815131941,815296004,815472247,815602901,815743045,815836693,815931544,816127918,816277904,816407812,816513292,816570131,816716805,816802964,816875397,816930401,816970322,817237937,817596806,817912362,818254542,818549176,818835875,819150238,819425606,819706527,819943841,820149841,820479053,820771396,821040914,821290157,821469340,821757658,821980451,822183129,822360640,822505123,822776253,823087476,823342135,823624767,823849273,824078375,824327799,824526638,824741063,824899366,825053512,825315555,825539347,825737792,825911732,826017055,826242124,826394218,826526115,826633345,826708457,826980833,827291224,827546598,827824375,828047278,828280825,828531231,828724299,828940937,829095823,829256740,829513777,829736882,829934626,830109730,830220689,830442313,830594057,830724904,830831930,830904141,831148310,831388410,831574223,831774384,831924798,832096557,832271785,832385764,832532991,832619982,832737406,832913683,833062473,833195981,833300802,833364315,833505135,833591251,833665277,833719069,833748733,834036918,834342436,834602179,834872416,835096999,835332802,835582151,835765569,835985714,836135932,836308366,836559121,836783068,836986555,837158401,837275677,837488953,837639248,837769765,837875461,837941611,838200376,838436766,838627957,838817306,838966628,839142336,839316514,839424131,839572191,839659229,839786784,839963623,840107118,840242993,840342786,840414772,840545972,840631395,840704113,840759167,840785736,841051072,841284352,841476103,841662120,841811209,841988038,842161823,842267475,842418529,842505569,842637255,842813659,842951616,843090109,843186734,843262533,843389128,843475438,843549282,843603028,843628066,843838930,843993977,844121205,844229638,844314605,844430822,844538458,844596454,844676996,844718163,844807912,844915996,844986941,845067161,845112774,845155223,845220681,845261639,845296391,845318510,845326358,845678443,846027780,846351457,846666617,846959364,847262684,847576534,847829337,848117445,848342701,848586263,848900482,849179107,849457109,849695704,849894685,850164360,850388173,850586394,850762448,850872260,851206396,851500952,851767943,852019642,852242412,852492981,852739600,852920889,853132738,853282466,853477648,853726800,853926765,854141281,854300312,854440395,854628321,854778282,854908071,855013180,855067044,855407194,855702071,855972961,856224058,856442076,856695560,856940924,857124461,857330469,857479881,857678248,857929180,858125092,858341386,858497244,858641236,858825522,858974152,859103764,859208371,859265061,859559500,859785036,859986457,860162518,860300034,860496292,860661492,860779142,860904718,860991648,861143541,861319266,861435610,861581060,861669609,861763462,861871280,861956181,862029832,862084039,862118641,862463881,862758136,863027932,863278864,863486503,863749915,863988097,864175813,864374134,864523889,864732040,864981031,865167132,865386717,865538173,865690033,865864165,866015688,866149497,866252903,866323492,866610189,866836130,867036522,867212247,867339483,867542597,867704786,867827295,867945738,868030925,868189782,868365010,868473758,868621825,868706996,868806987,868915624,868996649,869073987,869123031,869175965,869460169,869684444,869884052,870058111,870184011,870392136,870550705,870674825,870788739,870874292,871036220,871210593,871316440,871465835,871553638,871655672,871763546,871839854,871918709,871966575,872023197,872228427,872377495,872508623,872615783,872677361,872820144,872909021,872980462,873036208,873076880,873186684,873291115,873349081,873432205,873473695,873532762,873586732,873619138,873657617,873675732,873739610,874073277,874367982,874637681,874887891,875076665,875357052,875586795,875782069,875960206,876108571,876333647,876584330,876763336,876981950,877132245,877295972,877472215,877603184,877743300,877836732,877939829,878211947,878436257,878635704,878809979,878922525,879140651,879291770,879420510,879526866,879612532,879787304,879960348,880072759,880210555,880296796,880403808,880510044,880576525,880658690,880703271,880792103,881059337,881282450,881482498,881657103,881765416,881985904,882134505,882268216,882376335,882456324,882637369,882806372,882921935,883054750,883140531,883248880,883355025,883420013,883502638,883545954,883631607,883817953,883967379,884096707,884201771,884255109,884405926,884493386,884567720,884622263,884655766,884783590,884881219,884945223,885012630,885053239,885117396,885171434,885196801,885236941,885253305,885350891,885608349,885831349,886029157,886203819,886314693,886536766,886688433,886819371,886926397,886998713,887190541,887354747,887472726,887598479,887684566,887797038,887902888,887961079,888045521,888086910,888185101,888361624,888509895,888643641,888748728,888811709,888953061,889039016,889113000,889167031,889196713,889330221,889424562,889492443,889554513,889595471,889660395,889714161,889737319,889777867,889793746,889887410,890064366,890213527,890347833,890449810,890516363,890653732,890739671,890812992,890866535,890894982,891032593,891124867,891194030,891253129,891293947,891359672,891413006,891435494,891476076,891492600,891568272,891675621,891755048,891832736,891881604,891919553,891989258,892030042,892064528,892087508,892096293,892178258,892221076,892254142,892278071,892293916,892325918,892347961,892355544,892371433,892376406,892525401,892884725,893227015,893557255,893867176,894125666,894461463,894754645,895025025,895274842,895467301,895789337,896089509,896353823,896609753,896832411,897073733,897323766,897502627,897723830,897874853,898075485,898390237,898674020,898950692,899190141,899383763,899658314,899883016,900083051,900258027,900371780,900651837,900879550,901076616,901251936,901402005,901585568,901759340,901871842,902011513,902097966,902280406,902594597,902873516,903151686,903389959,903588904,903858706,904082624,904280993,904456934,904566986,904852341,905076853,905274631,905452970,905600521,905788117,905959214,906072438,906208510,906294147,906466576,906715714,906915784,907130209,907289191,907429379,907617614,907767266,907897321,908002402,908056337,908277249,908429528,908562083,908669740,908747552,908875356,908975394,909038606,909107657,909148394,909335231,909650230,909921781,910205350,910437846,910643791,910904485,911127374,911326148,911499603,911607080,911901649,912127080,912328830,912504947,912642442,912838630,913003991,913121319,913247375,913334224,913518755,913768804,913959525,914176080,914331344,914479444,914658487,914807045,914936563,915043974,915106436,915326763,915477324,915608198,915715519,915785754,915920511,916014594,916081248,916145683,916186534,916368946,916618028,916804143,917023805,917175289,917326834,917501390,917652755,917786242,917889970,917958335,918172409,918324188,918455070,918561221,918628435,918764911,918859231,918927588,918988410,919029094,919179937,919355270,919464337,919612351,919697575,919797177,919905793,919987035,920064541,920113601,920157176,920291743,920377425,920450472,920503713,920532286,920613753,920657223,920690278,920714273,920730194,920950671,921263821,921515283,921805811,922032594,922255438,922506550,922723363,922929280,923097785,923226410,923506272,923729588,923929623,924106237,924226410,924438008,924593396,924719891,924830626,924915721,925122440,925369674,925547687,925771487,925922937,926083737,926259029,926396334,926535184,926631056,926718312,926918116,927069132,927199951,927306319,927365068,927509953,927597756,927669362,927723777,927764373,927970279,928220998,928399933,928619122,928769312,928932717,929109226,929240279,929380332,929473958,929568117,929765184,929915149,930045204,930150201,930207684,930354324,930440512,930512969,930567184,930607693,930777564,930950713,931062949,931200941,931287273,931394069,931500570,931567105,931649090,931693833,931757499,931875050,931960207,932033578,932086965,932109531,932194278,932234897,932271439,932294614,932307688,932530779,932775543,932958925,933168169,933318155,933484621,933659331,933784054,933927966,934018833,934124286,934310954,934460457,934589610,934694913,934748269,934898731,934986387,935060560,935115258,935148926,935332487,935499900,935616443,935744780,935829772,935941463,936048161,936109261,936192704,936234928,936307561,936417273,936502412,936574930,936628860,936655979,936738163,936779773,936814572,936837369,936848205,937036469,937201207,937319158,937444736,937531005,937643302,937749174,937807593,937891981};
int l,r,lb,rb,ans,c[2];
int main(){
scanf("%d%d",&l,&r);
lb=(l-1)/blo+1;rb=(r-1)/blo+1;
ans=sum[rb]-sum[lb-1];//整块查询
for(register int i=(lb-1)*blo+1;i<l;i++){
int j=i;c[0]=c[1]=0;
for(;j;j>>=1)c[j&1]++;
ans-=(c[0]>=c[1]);
}//左边角
for(register int i=r+1;i<=rb*blo;i++){
int j=i;c[0]=c[1]=0;
for(;j;j>>=1)c[j&1]++;
ans-=(c[0]>=c[1]);
}//右边角
printf("%d\n",ans);
return 0;
}
题解 P6218 【[USACO06NOV] Round Numbers S】
原文:https://www.cnblogs.com/aday526/p/solution-p6218.html