From 581d26b01821bc3eabe8c043db04091379b94367 Mon Sep 17 00:00:00 2001 From: "sigonasr2, Sig, Sigo" Date: Fri, 29 Jul 2022 15:20:50 +0000 Subject: [PATCH] #32 complete Co-authored-by: sigonasr2 --- archives/32/current | Bin 0 -> 21368 bytes archives/32/src/main.c | 76 +++++++++++++++ archives/32/src/utils.c | 207 ++++++++++++++++++++++++++++++++++++++++ archives/32/src/utils.h | 18 ++++ current | Bin 21464 -> 21368 bytes src/main.c | 145 ++++++++++++---------------- 6 files changed, 362 insertions(+), 84 deletions(-) create mode 100755 archives/32/current create mode 100644 archives/32/src/main.c create mode 100644 archives/32/src/utils.c create mode 100644 archives/32/src/utils.h diff --git a/archives/32/current b/archives/32/current new file mode 100755 index 0000000000000000000000000000000000000000..e531a5b7e2f44f1265916b13333b8d3e45bc9b04 GIT binary patch literal 21368 zcmeHP4|G)3nZJ`i5EL@O!WOkFQ)_miNDLNPBBf>^4_<5{tPo{a=`bV%$u|F*%vk7> z6dco&cOKE%-9w9KTQ_?2EZy28+f!{?iA(~`M9Q{{!D!gkxp@@HKtE=|f+<@_l;oxg<PykFmingGy$=}c{wzUNU zVr^CBs@1+5OO~c$HP1@=7P_io2Fd>e(iC_e;_*MK=K1|{ti>w!O854`2R=68Dd zOo49Z|Lhha^sZ_1a!T8Nz+dpMP*1=zWBcENeERJAja5DQZ+`@?=$Z9pNmdTPyyV>PK;(Qx?^*dX zMD(8g=ZKVD49=@B9e-`9<^`oJ5v=mQsXb=Q!7 z;{D(pCgSR%`d+bo#R$RA(-0}8l^r>lpBVq2Wb)Y~+}pi( zdhhVocsFj)_neuBR>9~q`lHmD%_l9=KP58QaQ;YPpy3CGVy>>_sCtR>%3zb_tRB0Ub_LG|tuj;wJ%ZkPnQ@zCmc0sXNR{@A( zsWb+?Ps_O3BXiAfP_AygSm}P^Io+^8LxIBpkLW!!b6_@cSH5#fcby=I!6KvUEIBmR zbrB?`e#m>6;#KB1D7VUdjB=}tQ_%E6l`#SmBZU-w=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m~LS~MOh!y?>ppq zy~A{_T6eJ;mgDqchdl2Snew?3^E>_bLnY7c&+9*?8Vf4wl>aY>JnuW1?)?DypF8Av zf67!(8D=Ts{=;ftMTGWxYT8NdWBHyqCqJi|z6n{kO`i9=`_;XD%m)@3IL-7upwxG{ zeBKxHy?@WNa~yAnNEYST|TuBD7Qqo99F<` zoSq3`!nk~1#}<`a98P{J%N}N{@=NU?;w-<&fwR1wI+|EYl$TqAyOrbq5=q(vusu94 m(m5g9Zb?|*(X|%k`zkq)%jGmJ|1-(&zt!Tn$|2xLivI=Wo_U@C literal 0 HcmV?d00001 diff --git a/archives/32/src/main.c b/archives/32/src/main.c new file mode 100644 index 0000000..ddb7be3 --- /dev/null +++ b/archives/32/src/main.c @@ -0,0 +1,76 @@ +#include +#include "utils.h" +#include + +/* + We shall say that an n-digit number is pandigital if it makes use of all the digits 1 to n exactly once; for example, the 5-digit number, 15234, is 1 through 5 pandigital. + + The product 7254 is unusual, as the identity, 39 × 186 = 7254, containing multiplicand, multiplier, and product is 1 through 9 pandigital. + + Find the sum of all products whose multiplicand/multiplier/product identity can be written as a 1 through 9 pandigital. + + HINT: Some products can be obtained in more than one way so be sure to only include it once in your sum. + + https://projecteuler.net/problem=32 +*/ + +int main(int argc,char**argv) { + int numb1=1; + int numb2=1; + long sumPandigital=0; + boolean*uniqueProducts = malloc(100000000); + for (int i=0;i<100000000;i++) { + uniqueProducts[i]=false; + } + for (numb1=1;numb1<10000;numb1++) { + for (numb2=1;numb2<10000;numb2++) { + int prod=numb1*numb2; + int numb=prod; + boolean uniqueDigits[9] = {}; + while (numb>0) { + int digit=numb%10-1; + if (digit!=-1&&!uniqueDigits[digit]) { + uniqueDigits[digit]=true; + } else { + goto skip; + } + numb/=10; + } + numb=numb1; + while (numb>0) { + int digit=numb%10-1; + if (digit!=-1&&!uniqueDigits[digit]) { + uniqueDigits[digit]=true; + } else { + goto skip; + } + numb/=10; + } + numb=numb2; + while (numb>0) { + int digit=numb%10-1; + if (digit!=-1&&!uniqueDigits[digit]) { + uniqueDigits[digit]=true; + } else { + goto skip; + } + numb/=10; + } + for (int i=0;i<9;i++) { + if (!uniqueDigits[i]) { + goto skip; + } + } + //If we got here it's a pandigital. + if (!uniqueProducts[prod]) { + uniqueProducts[prod]=true; + sumPandigital+=prod; + printf("\n%d*%d = %d is pandigital!",numb1,numb2,prod); + } + skip: + continue; + } + } + printf("\nSum of pandigitals: %ld",sumPandigital); + return 0; +} diff --git a/archives/32/src/utils.c b/archives/32/src/utils.c new file mode 100644 index 0000000..b20be5d --- /dev/null +++ b/archives/32/src/utils.c @@ -0,0 +1,207 @@ +#include "utils.h" +#include +#include + +struct String mult(struct String numb1, struct String numb2) { + struct String n1 = numb1; + struct String n2 = numb2; + byte carryover = 0; + if (numb2.length>numb1.length) { + n1=numb2; + n2=numb1; + } + int addends[n2.length][n1.length+1]; + for (int i=0;i=0;i--) { + carryover=0; + for (int j=n1.length-1;j>=0;j--) { + int mult = (n1.str[j]-'0')*(n2.str[i]-'0')+((carryover!=0)?carryover:0); + //printf(" %d/%d\n",mult,carryover); + carryover=0; + if (mult>=10) { + carryover=mult/10; + mult=mult%10; + } + addends[(n2.length-1)-i][j+1]=mult; + } + if (carryover>0) { + addends[(n2.length-1)-i][0]=carryover; + } + } + //printIntDoubleArr(n2.length,n1.length+1,addends); + struct String sum = {1,"0"}; + for (int i=0;i=numb2.length) { + for (int offset=0;offsetoffset) { + //printf("%c %c\n",numb1.str[numb1.length-offset-1],numb2.str[numb2.length-offset-1]); + int sum=((numb1.str[numb1.length-offset-1]-'0')+(numb2.str[numb2.length-offset-1]-'0'))+((carryover>0)?carryover--:0); + if (sum>=10) { + carryover=1; + sum-=10; + } + str[offset]=sum+'0'; + } else { + str[offset]=numb1.str[numb1.length-offset-1]+((carryover>0)?carryover--:0); + } + //str[offset+1]='\0'; + } + } else { + for (int offset=0;offsetoffset) { + //printf("%c %c\n",numb1.str[numb1.length-offset-1],numb2.str[numb2.length-offset-1]); + int sum=((numb1.str[numb1.length-offset-1]-'0')+(numb2.str[numb2.length-offset-1]-'0'))+((carryover>0)?carryover--:0); + if (sum>=10) { + carryover=1; + sum-=10; + } + str[offset]=sum+'0'; + } else { + str[offset]=numb2.str[numb2.length-offset-1]+((carryover>0)?carryover--:0); + } + //str[offset+1]='\0'; + } + } + if (carryover>0) { + str = realloc(str,++digitCount); + str[digitCount-1]='1'; + //str[digitCount]='\0'; + } + for (int i=0;i0) { + newStr=realloc(newStr,++strLength); + newStr[strLength-1]=(numb1%10)+'0'; + numb1/=10; + } + for (int i=0;iDzVkcZ z`F)RbZX5a%#=ijnEJI*%*X+k3MKY4;khChu2d7-1Panp1ohI#Ux8aQStF+s$uQN|s zl}6KV&&rE8EIvah+rBdaFYEZi>p=(s!BM~?zd z`e;Ca+($z~`4qW$%RKVkea_KqxQ})VGHg|8xBSMStkPi_273unXg9QayZP`f^X5x2 zrO~;DgxqKr+A2MoV>wI%KH9I+ejg2DkTIdxOaCU}CbcHWe$LIy-&V?fbV%_IaZB5` zn2Sn>s-rpylJeai$juP-&1&pE}iwVv09NTDD>gv>y^1RJ?;I=8kS1oFL|i zGyf-sxjrm5pm+yR>LaV}avo0ehg1FGN&c|O zUmFI$f=Alw4OsFBv1~tok8=f&y48DBCr%=P2N{y1N^25IR#b{=%4+ktM=qKZy(>-T zk+62gT51AG%gnk3@FPpMuY|eGV}Ay+Sf_m%{L04dbK!)RKP>~`pjI+H31AQ3pm=GcP()*<*x_4PU>DYY?b7L8|-(< z1AAGuQ--DZ&SKv}@dF3h>fN^DC7A4LB;#Wm8lsR^+W{9mQDoYmqBiKjgESao5=W0mR{0q03KxP@GHVEN+ingfq2*5NJDSIF3hVndc zuusb!u#t6@uZ8o>NgWViCDaCXwt`l|hpdyXWY!9+`3gpnSeIck++-ycwkp6_86*=A z6l3Br=|Iwv&%`Tp&Z-j^lXRRC<2%HO;doOA;$oc@wv_p?)hAh`BG3H`#u6GBAUdK4 zj#hQdYe>@hXminAE;OK#)mPf8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G2(qpEo{J?;%LO|yFX-k6_$nf%0o^|hT?TVGXPB?FsxC{rCh=D>4iTH zy?^D&J%nOq0~35&^mrZkh9}pfZq**jKFx`a%msh5mwlO&6tN6biJi+S(9~mAhJ$0N zd1E~D(yvB)cFlQPO;@qF`~-oRJ(Kg#;PGO81(on^v`nIzY_}zaRy%r%8x%O2F&LN=x*F6e;fTM-PjepP(NA8z<zwsD5gFueJ&wDU@|6}l*2w{5*<039&K7ln0I?u_%pQvWTdV6u{ri%4!?}D|l zcALF)6IoYUUjC+S+xl`(V1Z0MfrV?-w1kxuWySsH?+B}dH~8W}3d#$FkS5R7BAL>& Y?CO%~(Hbe3TOZReolYOJ#Y-ps3uYeV(f|Me diff --git a/src/main.c b/src/main.c index b8d6040..ddb7be3 100644 --- a/src/main.c +++ b/src/main.c @@ -1,99 +1,76 @@ #include #include "utils.h" +#include /* - In the United Kingdom the currency is made up of pound (£) and pence (p). There are eight coins in general circulation: + We shall say that an n-digit number is pandigital if it makes use of all the digits 1 to n exactly once; for example, the 5-digit number, 15234, is 1 through 5 pandigital. - 1p, 2p, 5p, 10p, 20p, 50p, £1 (100p), and £2 (200p). + The product 7254 is unusual, as the identity, 39 × 186 = 7254, containing multiplicand, multiplier, and product is 1 through 9 pandigital. - It is possible to make £2 in the following way: + Find the sum of all products whose multiplicand/multiplier/product identity can be written as a 1 through 9 pandigital. - 1×£1 + 1×50p + 2×20p + 1×5p + 1×2p + 3×1p + HINT: Some products can be obtained in more than one way so be sure to only include it once in your sum. - How many different ways can £2 be made using any number of coins? - - - https://projecteuler.net/problem=31 + https://projecteuler.net/problem=32 */ -enum Currency{ - pence1, - pence2, - pence5, - pence10, - pence20, - pence50, - pound1, //100 pences - pound2, //200 pences -}; - -int getValue(enum Currency cur) { - switch (cur) { - case pence1:{ - return 1; - }break; - case pence2:{ - return 2; - }break; - case pence5:{ - return 5; - }break; - case pence10:{ - return 10; - }break; - case pence20:{ - return 20; - }break; - case pence50:{ - return 50; - }break; - case pound1:{ - return 100; - }break; - case pound2:{ - return 200; - }break; - } -} - -int total(int*amts) { - return - getValue(pence1)*amts[0]+ - getValue(pence2)*amts[1]+ - getValue(pence5)*amts[2]+ - getValue(pence10)*amts[3]+ - getValue(pence20)*amts[4]+ - getValue(pence50)*amts[5]+ - getValue(pound1)*amts[6]+ - getValue(pound2)*amts[7]; -} - -void carryover(int*amts,int placeVal) { - amts[placeVal]++; - if (placeVal<7&&amts[placeVal]>200/getValue(placeVal)) { - carryover(amts,placeVal+1); - amts[placeVal]=0; - } -} - int main(int argc,char**argv) { - int currencyAmts[8] = {}; - int combinationCount=0; - int maxCurrencyVal=200; - int currentMarker=0; - - while (currencyAmts[6]!=2) { - if (total(currencyAmts)==200) { - printf("Coin amts: "); - for (int i=0;i<8;i++) { - printf("%d ",currencyAmts[i]); + int numb1=1; + int numb2=1; + long sumPandigital=0; + boolean*uniqueProducts = malloc(100000000); + for (int i=0;i<100000000;i++) { + uniqueProducts[i]=false; + } + for (numb1=1;numb1<10000;numb1++) { + for (numb2=1;numb2<10000;numb2++) { + int prod=numb1*numb2; + int numb=prod; + boolean uniqueDigits[9] = {}; + while (numb>0) { + int digit=numb%10-1; + if (digit!=-1&&!uniqueDigits[digit]) { + uniqueDigits[digit]=true; + } else { + goto skip; + } + numb/=10; + } + numb=numb1; + while (numb>0) { + int digit=numb%10-1; + if (digit!=-1&&!uniqueDigits[digit]) { + uniqueDigits[digit]=true; + } else { + goto skip; + } + numb/=10; } - printf("\n"); - combinationCount++; + numb=numb2; + while (numb>0) { + int digit=numb%10-1; + if (digit!=-1&&!uniqueDigits[digit]) { + uniqueDigits[digit]=true; + } else { + goto skip; + } + numb/=10; + } + for (int i=0;i<9;i++) { + if (!uniqueDigits[i]) { + goto skip; + } + } + //If we got here it's a pandigital. + if (!uniqueProducts[prod]) { + uniqueProducts[prod]=true; + sumPandigital+=prod; + printf("\n%d*%d = %d is pandigital!",numb1,numb2,prod); + } + skip: + continue; } - carryover(currencyAmts,0); } - printf("\n\nCombination count: %d",(combinationCount+2)); - + printf("\nSum of pandigitals: %ld",sumPandigital); return 0; -} \ No newline at end of file +}