답안 #247984

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
247984 2020-07-12T07:15:57 Z VEGAnn Savrsen (COCI17_savrsen) C++14
120 / 120
97 ms 504 KB
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 1010;
const int cn = int(1e4);
ll f[N], A, B, res = 0;

int main(){
    ios_base::sync_with_stdio(0); cin.tie(0);

#ifdef _LOCAL
    freopen("in.txt","r",stdin);
#endif // _LOCAL

    cin >> A >> B;

    while (A % cn != 1 && A <= B){
        int j = A;

        ll cur = 0;

        for (int cr = 1; cr * cr <= j; cr++)
            if (j % cr == 0){
                cur += cr;

                if (j / cr != cr)
                    cur += j / cr;
            }

        cur -= j;

        res += abs(j - cur);

        A++;
    }

    while (B % cn != 0 && B >= A){
        int j = B;

        ll cur = 0;

        for (int cr = 1; cr * cr <= j; cr++)
            if (j % cr == 0){
                cur += cr;

                if (j / cr != cr)
                    cur += j / cr;
            }

        cur -= j;

        res += abs(j - cur);

        B--;
    }

    if (A > B){
        cout << res << '\n';
        return 0;
    }

    int lf = (A - 1) / cn, rt = B / cn - 1;

    f[0]=27990750;
f[1]=83970979;
f[2]=140016552;
f[3]=195998622;
f[4]=251959250;
f[5]=307994124;
f[6]=363966358;
f[7]=419915473;
f[8]=475885642;
f[9]=531766061;
f[10]=588064804;
f[11]=643748195;
f[12]=700075744;
f[13]=755667812;
f[14]=811924422;
f[15]=867929722;
f[16]=923754793;
f[17]=979948083;
f[18]=1035541861;
f[19]=1091930696;
f[20]=1147936199;
f[21]=1204035512;
f[22]=1259165892;
f[23]=1316176487;
f[24]=1371738398;
f[25]=1427997244;
f[26]=1483693577;
f[27]=1539974177;
f[28]=1595550857;
f[29]=1651990936;
f[30]=1707065221;
f[31]=1763988088;
f[32]=1820120847;
f[33]=1875717961;
f[34]=1931855730;
f[35]=1987642695;
f[36]=2043276242;
f[37]=2100001395;
f[38]=2155349714;
f[39]=2211918018;
f[40]=2266633419;
f[41]=2325109066;
f[42]=2379183326;
f[43]=2435355740;
f[44]=2492284776;
f[45]=2547166095;
f[46]=2603735578;
f[47]=2659484300;
f[48]=2715112159;
f[49]=2771912953;
f[50]=2828143977;
f[51]=2882872934;
f[52]=2940005806;
f[53]=2995771203;
f[54]=3050889984;
f[55]=3107565316;
f[56]=3163049292;
f[57]=3219808896;
f[58]=3275239326;
f[59]=3332614664;
f[60]=3385875746;
f[61]=3443895764;
f[62]=3500271125;
f[63]=3554948151;
f[64]=3610919097;
f[65]=3667928746;
f[66]=3723037548;
f[67]=3780082993;
f[68]=3835886350;
f[69]=3890209588;
f[70]=3947910254;
f[71]=4003942275;
f[72]=4057974268;
f[73]=4116357554;
f[74]=4171136372;
f[75]=4228198009;
f[76]=4282193450;
f[77]=4339620758;
f[78]=4394602561;
f[79]=4451841230;
f[80]=4508439550;
f[81]=4563402809;
f[82]=4617539712;
f[83]=4676819319;
f[84]=4730748386;
f[85]=4785311448;
f[86]=4844610665;
f[87]=4900213122;
f[88]=4952987591;
f[89]=5011754620;
f[90]=5067110837;
f[91]=5124485284;
f[92]=5179203288;
f[93]=5235292473;
f[94]=5290841965;
f[95]=5346267328;
f[96]=5402354461;
f[97]=5460766003;
f[98]=5516096742;
f[99]=5570473840;
f[100]=5626857323;
f[101]=5682995051;
f[102]=5739182800;
f[103]=5792577111;
f[104]=5854105620;
f[105]=5905598391;
f[106]=5963400074;
f[107]=6020292610;
f[108]=6074433347;
f[109]=6131527183;
f[110]=6187687112;
f[111]=6241015953;
f[112]=6298364610;
f[113]=6355005319;
f[114]=6410726715;
f[115]=6468263376;
f[116]=6525639375;
f[117]=6578256429;
f[118]=6634342411;
f[119]=6691124770;
f[120]=6747513812;
f[121]=6802012804;
f[122]=6859956166;
f[123]=6913066617;
f[124]=6970760256;
f[125]=7027208203;
f[126]=7082609361;
f[127]=7140725639;
f[128]=7195694313;
f[129]=7248457994;
f[130]=7305638039;
f[131]=7363357289;
f[132]=7418258856;
f[133]=7475326941;
f[134]=7531127889;
f[135]=7585142256;
f[136]=7646678137;
f[137]=7696935705;
f[138]=7754399039;
f[139]=7810539960;
f[140]=7867852133;
f[141]=7921331025;
f[142]=7979367843;
f[143]=8034908354;
f[144]=8091576737;
f[145]=8146793957;
f[146]=8206197333;
f[147]=8258681299;
f[148]=8309912953;
f[149]=8371203019;
f[150]=8425212866;
f[151]=8484501881;
f[152]=8539718327;
f[153]=8594014781;
f[154]=8648212587;
f[155]=8709162679;
f[156]=8762835183;
f[157]=8817853926;
f[158]=8874586253;
f[159]=8929681257;
f[160]=8986738045;
f[161]=9043524637;
f[162]=9097801806;
f[163]=9155910007;
f[164]=9210840779;
f[165]=9265329555;
f[166]=9321975928;
f[167]=9379003783;
f[168]=9435318069;
f[169]=9489104717;
f[170]=9552554053;
f[171]=9599010999;
f[172]=9657946693;
f[173]=9714406840;
f[174]=9772416294;
f[175]=9823972829;
f[176]=9883864400;
f[177]=9935963533;
f[178]=9995236796;
f[179]=10050920018;
f[180]=10107565415;
f[181]=10162013090;
f[182]=10221216292;
f[183]=10275567817;
f[184]=10326921890;
f[185]=10386693456;
f[186]=10444581670;
f[187]=10498280183;
f[188]=10555001454;
f[189]=10611505092;
f[190]=10663525925;
f[191]=10721230323;
f[192]=10777636325;
f[193]=10834183625;
f[194]=10894502637;
f[195]=10944874602;
f[196]=11000288378;
f[197]=11062415112;
f[198]=11111427680;
f[199]=11172225411;
f[200]=11223434839;
f[201]=11286019980;
f[202]=11332602444;
f[203]=11392829994;
f[204]=11451552936;
f[205]=11508899688;
f[206]=11563662792;
f[207]=11616672992;
f[208]=11673554372;
f[209]=11731538190;
f[210]=11785767598;
f[211]=11839803202;
f[212]=11897400113;
f[213]=11954776030;
f[214]=12012195484;
f[215]=12067777940;
f[216]=12121122326;
f[217]=12181315866;
f[218]=12229664889;
f[219]=12292800640;
f[220]=12348570226;
f[221]=12400140099;
f[222]=12459423602;
f[223]=12511128868;
f[224]=12575011796;
f[225]=12627291302;
f[226]=12679308561;
f[227]=12738212951;
f[228]=12793364873;
f[229]=12849560849;
f[230]=12905198017;
f[231]=12957123857;
f[232]=13020312191;
f[233]=13074978325;
f[234]=13130597577;
f[235]=13188065209;
f[236]=13238935003;
f[237]=13299242683;
f[238]=13356101182;
f[239]=13409827498;
f[240]=13463730125;
f[241]=13523002986;
f[242]=13578672011;
f[243]=13634336142;
f[244]=13689125451;
f[245]=13746794600;
f[246]=13800152333;
f[247]=13855679887;
f[248]=13920189601;
f[249]=13971465409;
f[250]=14023899193;
f[251]=14084429649;
f[252]=14134841211;
f[253]=14194597371;
f[254]=14256057158;
f[255]=14299370604;
f[256]=14360838183;
f[257]=14416546605;
f[258]=14476208853;
f[259]=14528620328;
f[260]=14593140169;
f[261]=14635979515;
f[262]=14704660939;
f[263]=14753114461;
f[264]=14807389442;
f[265]=14866127405;
f[266]=14920950962;
f[267]=14978305333;
f[268]=15031972773;
f[269]=15091375561;
f[270]=15142941212;
f[271]=15199059579;
f[272]=15263327067;
f[273]=15313174405;
f[274]=15365244099;
f[275]=15425753907;
f[276]=15479806825;
f[277]=15536046573;
f[278]=15598779466;
f[279]=15647642455;
f[280]=15705838603;
f[281]=15764059049;
f[282]=15816999835;
f[283]=15872618261;
f[284]=15934118267;
f[285]=15979730641;
f[286]=16043571023;
f[287]=16102224498;
f[288]=16151369097;
f[289]=16206844334;
f[290]=16271800247;
f[291]=16320503823;
f[292]=16374426717;
f[293]=16434326509;
f[294]=16491351921;
f[295]=16541580719;
f[296]=16603938857;
f[297]=16657078663;
f[298]=16717620987;
f[299]=16766380577;
f[300]=16830902664;
f[301]=16874618667;
f[302]=16935740461;
f[303]=16996088263;
f[304]=17055155475;
f[305]=17102357663;
f[306]=17158795989;
f[307]=17220726832;
f[308]=17277018471;
f[309]=17327349135;
f[310]=17386153257;
f[311]=17441629235;
f[312]=17497999391;
f[313]=17544924983;
f[314]=17618793616;
f[315]=17662854329;
f[316]=17720959435;
f[317]=17777419505;
f[318]=17837625529;
f[319]=17886915902;
f[320]=17941958225;
f[321]=18002133405;
f[322]=18058326165;
f[323]=18112105405;
f[324]=18164926032;
f[325]=18224406289;
f[326]=18284128139;
f[327]=18335536679;
f[328]=18390390582;
f[329]=18455592363;
f[330]=18497733493;
f[331]=18567919287;
f[332]=18622050368;
f[333]=18673937887;
f[334]=18723928459;
f[335]=18792514041;
f[336]=18837849450;
f[337]=18896560867;
f[338]=18952994454;
f[339]=19008784848;
f[340]=19067988353;
f[341]=19122667215;
f[342]=19176038125;
f[343]=19231186796;
f[344]=19291078815;
f[345]=19340856813;
f[346]=19401556244;
f[347]=19460926115;
f[348]=19515721392;
f[349]=19561414254;
f[350]=19626468431;
f[351]=19681458161;
f[352]=19737198802;
f[353]=19792139359;
f[354]=19851668483;
f[355]=19902839900;
f[356]=19964948243;
f[357]=20014868016;
f[358]=20067039316;
f[359]=20131534145;
f[360]=20184533135;
f[361]=20240136360;
f[362]=20294955209;
f[363]=20356567406;
f[364]=20414273044;
f[365]=20458391467;
f[366]=20520310844;
f[367]=20581732589;
f[368]=20634002330;
f[369]=20684522847;
f[370]=20749174648;
f[371]=20808885210;
f[372]=20850217031;
f[373]=20909632576;
f[374]=20966932903;
f[375]=21024251375;
f[376]=21079613965;
f[377]=21138819613;
f[378]=21187023896;
f[379]=21251458363;
f[380]=21304899374;
f[381]=21362058457;
f[382]=21416750862;
f[383]=21475422818;
f[384]=21528431893;
f[385]=21583236608;
f[386]=21644652201;
f[387]=21692748171;
f[388]=21754663707;
f[389]=21812934942;
f[390]=21863934301;
f[391]=21918738284;
f[392]=21982869762;
f[393]=22034268330;
f[394]=22090194929;
f[395]=22145507440;
f[396]=22198050362;
f[397]=22255697320;
f[398]=22309854011;
f[399]=22368448679;
f[400]=22422507367;
f[401]=22482302164;
f[402]=22539380091;
f[403]=22591229308;
f[404]=22651861413;
f[405]=22709339873;
f[406]=22755502381;
f[407]=22819051718;
f[408]=22865511315;
f[409]=22934325773;
f[410]=22982064257;
f[411]=23048435274;
f[412]=23093300735;
f[413]=23154993371;
f[414]=23203045581;
f[415]=23264229542;
f[416]=23322849602;
f[417]=23372162426;
f[418]=23430509798;
f[419]=23493372875;
f[420]=23543030735;
f[421]=23597655643;
f[422]=23661552974;
f[423]=23709799927;
f[424]=23770268197;
f[425]=23822421090;
f[426]=23882261783;
f[427]=23933800583;
f[428]=23989237719;
f[429]=24047693004;
f[430]=24114587250;
f[431]=24154029288;
f[432]=24222642952;
f[433]=24272795903;
f[434]=24328324179;
f[435]=24386971831;
f[436]=24442474902;
f[437]=24490976015;
f[438]=24554576921;
f[439]=24603004066;
f[440]=24660678894;
f[441]=24713847798;
f[442]=24782185590;
f[443]=24833949506;
f[444]=24888696516;
f[445]=24941042700;
f[446]=24994823638;
f[447]=25057756372;
f[448]=25118868606;
f[449]=25176220115;
f[450]=25221205151;
f[451]=25279041463;
f[452]=25335588779;
f[453]=25395065944;
f[454]=25446377211;
f[455]=25506668171;
f[456]=25558267100;
f[457]=25611849291;
f[458]=25673067629;
f[459]=25729421746;
f[460]=25775606417;
f[461]=25854453313;
f[462]=25892431856;
f[463]=25950117691;
f[464]=26010712423;
f[465]=26062201170;
f[466]=26122876589;
f[467]=26172422857;
f[468]=26235590278;
f[469]=26282389475;
f[470]=26348390443;
f[471]=26396842138;
f[472]=26457643839;
f[473]=26511353765;
f[474]=26571733900;
f[475]=26617802297;
f[476]=26682747873;
f[477]=26734720105;
f[478]=26797101716;
f[479]=26847781622;
f[480]=26894297648;
f[481]=26964043952;
f[482]=27020550322;
f[483]=27070350132;
f[484]=27128313428;
f[485]=27190245317;
f[486]=27238187758;
f[487]=27301090497;
f[488]=27345490055;
f[489]=27408337392;
f[490]=27461077311;
f[491]=27519191509;
f[492]=27572373844;
f[493]=27633590843;
f[494]=27687538468;
f[495]=27746542264;
f[496]=27801440918;
f[497]=27856835247;
f[498]=27912294516;
f[499]=27959916881;
f[500]=28023178321;
f[501]=28077901958;
f[502]=28141495807;
f[503]=28191491452;
f[504]=28238815847;
f[505]=28308009337;
f[506]=28369629874;
f[507]=28409690675;
f[508]=28466367469;
f[509]=28532092053;
f[510]=28578360964;
f[511]=28636343748;
f[512]=28712878373;
f[513]=28745492775;
f[514]=28816097143;
f[515]=28858000194;
f[516]=28924783001;
f[517]=28966159072;
f[518]=29044131194;
f[519]=29082208040;
f[520]=29141774898;
f[521]=29196554943;
f[522]=29256889988;
f[523]=29301009814;
f[524]=29380678716;
f[525]=29420911221;
f[526]=29479870682;
f[527]=29536088509;
f[528]=29590218067;
f[529]=29645240519;
f[530]=29716360740;
f[531]=29758819899;
f[532]=29813043290;
f[533]=29866730006;
f[534]=29929007124;
f[535]=29978467246;
f[536]=30049826779;
f[537]=30084746298;
f[538]=30156315845;
f[539]=30208034308;
f[540]=30260465869;
f[541]=30314696791;
f[542]=30375754583;
f[543]=30441239536;
f[544]=30481848553;
f[545]=30555077760;
f[546]=30592766855;
f[547]=30656612628;
f[548]=30712857852;
f[549]=30769265190;
f[550]=30813677225;
f[551]=30888953652;
f[552]=30928293747;
f[553]=30982623104;
f[554]=31061063811;
f[555]=31091721634;
f[556]=31169789760;
f[557]=31212094518;
f[558]=31267171147;
f[559]=31320966598;
f[560]=31384831339;
f[561]=31438568954;
f[562]=31495916993;
f[563]=31552711874;
f[564]=31609238433;
f[565]=31657073739;
f[566]=31735437869;
f[567]=31769933054;
f[568]=31831399741;
f[569]=31891149764;
f[570]=31939704745;
f[571]=31993377574;
f[572]=32060404159;
f[573]=32112479558;
f[574]=32170112191;
f[575]=32225924045;
f[576]=32281581049;
f[577]=32321055544;
f[578]=32397896113;
f[579]=32455848333;
f[580]=32484979614;
f[581]=32563504527;
f[582]=32609308892;
f[583]=32668118151;
f[584]=32734602944;
f[585]=32781880613;
f[586]=32833321018;
f[587]=32902067557;
f[588]=32956485102;
f[589]=32993235677;
f[590]=33072096823;
f[591]=33114453707;
f[592]=33184298611;
f[593]=33225832646;
f[594]=33285106395;
f[595]=33339895660;
f[596]=33403055089;
f[597]=33464859320;
f[598]=33505498149;
f[599]=33571304272;
f[600]=33614994467;
f[601]=33692818617;
f[602]=33738785638;
f[603]=33780877869;
f[604]=33850908396;
f[605]=33898685531;
f[606]=33955219092;
f[607]=34011154447;
f[608]=34074401995;
f[609]=34128515286;
f[610]=34175935309;
f[611]=34243470678;
f[612]=34299211003;
f[613]=34342403558;
f[614]=34410585217;
f[615]=34463537211;
f[616]=34513402520;
f[617]=34574273309;
f[618]=34619278054;
f[619]=34705721059;
f[620]=34743834864;
f[621]=34795031847;
f[622]=34848216239;
f[623]=34928035688;
f[624]=34957666002;
f[625]=35019722929;
f[626]=35089757913;
f[627]=35135793456;
f[628]=35187894533;
f[629]=35250985377;
f[630]=35289457434;
f[631]=35364307385;
f[632]=35424104188;
f[633]=35469274643;
f[634]=35511989437;
f[635]=35596284616;
f[636]=35644313379;
f[637]=35686093880;
f[638]=35759567663;
f[639]=35800597983;
f[640]=35875369416;
f[641]=35902132195;
f[642]=35972273634;
f[643]=36031556867;
f[644]=36100875755;
f[645]=36130377506;
f[646]=36190825607;
f[647]=36265961266;
f[648]=36302269385;
f[649]=36369488921;
f[650]=36419774094;
f[651]=36475895217;
f[652]=36531562725;
f[653]=36596374250;
f[654]=36634651905;
f[655]=36699813356;
f[656]=36777621903;
f[657]=36809103997;
f[658]=36882545600;
f[659]=36920950499;
f[660]=36975266508;
f[661]=37039937336;
f[662]=37098747181;
f[663]=37146901442;
f[664]=37212369385;
f[665]=37257189799;
f[666]=37318986318;
f[667]=37377296327;
f[668]=37436809649;
f[669]=37484746268;
f[670]=37541087533;
f[671]=37610388688;
f[672]=37644501997;
f[673]=37706119147;
f[674]=37766762346;
f[675]=37824092853;
f[676]=37873073296;
f[677]=37934837928;
f[678]=38001727585;
f[679]=38035871427;
f[680]=38096974996;
f[681]=38160918435;
f[682]=38208789579;
f[683]=38278844848;
f[684]=38315167473;
f[685]=38388589964;
f[686]=38435976827;
f[687]=38505307192;
f[688]=38538675290;
f[689]=38611716959;
f[690]=38652219555;
f[691]=38723417406;
f[692]=38773326759;
f[693]=38827397869;
f[694]=38884175826;
f[695]=38952144445;
f[696]=38997706671;
f[697]=39053374717;
f[698]=39110589363;
f[699]=39159282599;
f[700]=39235549558;
f[701]=39281166983;
f[702]=39318998045;
f[703]=39387088714;
f[704]=39450422155;
f[705]=39491359789;
f[706]=39551159797;
f[707]=39620975703;
f[708]=39673675939;
f[709]=39723209506;
f[710]=39793335119;
f[711]=39841604155;
f[712]=39893077704;
f[713]=39950938815;
f[714]=40008069470;
f[715]=40038613708;
f[716]=40129640395;
f[717]=40173201319;
f[718]=40236710448;
f[719]=40288782419;
f[720]=40348689577;
f[721]=40391926666;
f[722]=40457136840;
f[723]=40508476527;
f[724]=40571469653;
f[725]=40616884800;
f[726]=40675134559;
f[727]=40726453129;
f[728]=40801856738;
f[729]=40837240788;
f[730]=40906528883;
f[731]=40943842874;
f[732]=41015184627;
f[733]=41054523877;
f[734]=41144919342;
f[735]=41184567350;
f[736]=41240381263;
f[737]=41288174823;
f[738]=41346391508;
f[739]=41405544501;
f[740]=41471831153;
f[741]=41517014267;
f[742]=41560807657;
f[743]=41634404815;
f[744]=41686470336;
f[745]=41735804349;
f[746]=41804966531;
f[747]=41851893326;
f[748]=41909744404;
f[749]=41962851033;
f[750]=42035086979;
f[751]=42079620202;
f[752]=42134620825;
f[753]=42171384162;
f[754]=42257214801;
f[755]=42304353676;
f[756]=42358280755;
f[757]=42403677489;
f[758]=42477039403;
f[759]=42517775439;
f[760]=42581252561;
f[761]=42641498577;
f[762]=42692705628;
f[763]=42743212609;
f[764]=42798940628;
f[765]=42853651002;
f[766]=42943307955;
f[767]=42973317507;
f[768]=43030129067;
f[769]=43073319987;
f[770]=43143582299;
f[771]=43191690747;
f[772]=43252979743;
f[773]=43307802454;
f[774]=43376349762;
f[775]=43415414207;
f[776]=43493535656;
f[777]=43534120363;
f[778]=43582651985;
f[779]=43653435278;
f[780]=43691973524;
f[781]=43761776331;
f[782]=43816195377;
f[783]=43866718693;
f[784]=43914876783;
f[785]=43989093385;
f[786]=44029151239;
f[787]=44096286945;
f[788]=44144564343;
f[789]=44203051415;
f[790]=44263006343;
f[791]=44328696775;
f[792]=44359027358;
f[793]=44435738014;
f[794]=44486108957;
f[795]=44550496403;
f[796]=44590633700;
f[797]=44662116120;
f[798]=44699529665;
f[799]=44764112654;
f[800]=44832397051;
f[801]=44872207970;
f[802]=44932775821;
f[803]=45001468625;
f[804]=45040336308;
f[805]=45089208137;
f[806]=45162210340;
f[807]=45213824295;
f[808]=45266862722;
f[809]=45346583537;
f[810]=45375268078;
f[811]=45422150977;
f[812]=45495719434;
f[813]=45559202323;
f[814]=45612079334;
f[815]=45648336429;
f[816]=45724372090;
f[817]=45754284963;
f[818]=45832173968;
f[819]=45891918631;
f[820]=45932711458;
f[821]=46024558129;
f[822]=46038453506;
f[823]=46097009927;
f[824]=46161075228;
f[825]=46224428097;
f[826]=46284484624;
f[827]=46344997383;
f[828]=46380491723;
f[829]=46453581587;
f[830]=46492772009;
f[831]=46548796939;
f[832]=46613552651;
f[833]=46674336603;
f[834]=46729370141;
f[835]=46775530049;
f[836]=46837515775;
f[837]=46874825944;
f[838]=46942638376;
f[839]=47015153011;
f[840]=47083949427;
f[841]=47093039036;
f[842]=47176934206;
f[843]=47223029721;
f[844]=47280858966;
f[845]=47351771211;
f[846]=47408341045;
f[847]=47431569682;
f[848]=47521484788;
f[849]=47542284753;
f[850]=47642724713;
f[851]=47682541968;
f[852]=47735774636;
f[853]=47777611415;
f[854]=47844700539;
f[855]=47883441200;
f[856]=47973582530;
f[857]=48025614781;
f[858]=48057222740;
f[859]=48116520427;
f[860]=48205209381;
f[861]=48230229523;
f[862]=48278168167;
f[863]=48356277477;
f[864]=48406755599;
f[865]=48447711854;
f[866]=48518756530;
f[867]=48568475175;
f[868]=48640983838;
f[869]=48677415475;
f[870]=48742723137;
f[871]=48785686733;
f[872]=48859867107;
f[873]=48910451555;
f[874]=48960423011;
f[875]=49029842426;
f[876]=49077650398;
f[877]=49128404577;
f[878]=49180060994;
f[879]=49247973229;
f[880]=49298309399;
f[881]=49382164767;
f[882]=49406122297;
f[883]=49455257881;
f[884]=49531328790;
f[885]=49567985485;
f[886]=49642416373;
f[887]=49701085973;
f[888]=49742968499;
f[889]=49795839539;
f[890]=49867286828;
f[891]=49907441007;
f[892]=49974369132;
f[893]=50033007816;
f[894]=50082891589;
f[895]=50129499577;
f[896]=50205224926;
f[897]=50241840033;
f[898]=50315866720;
f[899]=50366956715;
f[900]=50412634492;
f[901]=50474859525;
f[902]=50538333668;
f[903]=50578201566;
f[904]=50641737893;
f[905]=50701075328;
f[906]=50766439831;
f[907]=50811337041;
f[908]=50874608280;
f[909]=50923282140;
f[910]=50966995373;
f[911]=51051185604;
f[912]=51094762505;
f[913]=51139509869;
f[914]=51186071910;
f[915]=51255779258;
f[916]=51350755429;
f[917]=51370157442;
f[918]=51422920969;
f[919]=51483279601;
f[920]=51545826726;
f[921]=51589419698;
f[922]=51650137485;
f[923]=51709261118;
f[924]=51769904291;
f[925]=51817696061;
f[926]=51870177176;
f[927]=51930849132;
f[928]=51982496994;
f[929]=52058701483;
f[930]=52104295153;
f[931]=52154556404;
f[932]=52194318515;
f[933]=52270452334;
f[934]=52324944840;
f[935]=52387006843;
f[936]=52422353971;
f[937]=52483635532;
f[938]=52558712063;
f[939]=52607125768;
f[940]=52660164118;
f[941]=52731164209;
f[942]=52757355838;
f[943]=52825085023;
f[944]=52883517343;
f[945]=52950671242;
f[946]=52991149684;
f[947]=53062378714;
f[948]=53099609845;
f[949]=53163898681;
f[950]=53207524788;
f[951]=53286662111;
f[952]=53314196569;
f[953]=53404394771;
f[954]=53418785235;
f[955]=53520328074;
f[956]=53540752605;
f[957]=53612597231;
f[958]=53654781434;
f[959]=53745325445;
f[960]=53763229406;
f[961]=53837005860;
f[962]=53898785399;
f[963]=53951925828;
f[964]=54007194559;
f[965]=54075128719;
f[966]=54086238458;
f[967]=54174101942;
f[968]=54237166444;
f[969]=54296693785;
f[970]=54340345607;
f[971]=54418013120;
f[972]=54432520667;
f[973]=54509528198;
f[974]=54578567019;
f[975]=54612518902;
f[976]=54679431308;
f[977]=54738051589;
f[978]=54769323736;
f[979]=54853771539;
f[980]=54902746911;
f[981]=54963215488;
f[982]=54995701771;
f[983]=55076219841;
f[984]=55116126489;
f[985]=55180483977;
f[986]=55250998904;
f[987]=55277686091;
f[988]=55329474898;
f[989]=55424604951;
f[990]=55448376237;
f[991]=55526221067;
f[992]=55556854959;
f[993]=55633228372;
f[994]=55676968129;
f[995]=55740626966;
f[996]=55773433605;
f[997]=55854572807;
f[998]=55916132500;
f[999]=55964956840;

    for (int i = lf; i <= rt; i++)
        res += f[i];

    cout << res << '\n';

    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 384 KB Output is correct
2 Correct 1 ms 384 KB Output is correct
3 Correct 10 ms 384 KB Output is correct
4 Correct 25 ms 384 KB Output is correct
5 Correct 8 ms 384 KB Output is correct
6 Correct 0 ms 384 KB Output is correct
7 Correct 97 ms 384 KB Output is correct
8 Correct 34 ms 504 KB Output is correct