From e0955c344b978f3f6c498e1bed2800bf151c921d Mon Sep 17 00:00:00 2001 From: Abheek Dhawan Date: Tue, 16 Nov 2021 23:12:14 -0600 Subject: [PATCH] Add some new stuff --- usaco/Breed Counting/a.out | Bin 0 -> 40770 bytes usaco/Breed Counting/index.cpp | 34 ++++++++++++++++ usaco/Mixing Milk/a.out | Bin 0 -> 35394 bytes usaco/Mixing Milk/index.cpp | 69 +++++++++++++++++++++++++++++++++ usaco/Mixing Milk/mixmilk.in | 3 ++ usaco/Mixing Milk/mixmilk.out | 3 ++ usaco/Shell Game/a.out | Bin 0 -> 35538 bytes usaco/Shell Game/index.cpp | 41 ++++++++++++++++++++ usaco/Shell Game/shell.out | 0 9 files changed, 150 insertions(+) create mode 100755 usaco/Breed Counting/a.out create mode 100644 usaco/Breed Counting/index.cpp create mode 100755 usaco/Mixing Milk/a.out create mode 100644 usaco/Mixing Milk/index.cpp create mode 100644 usaco/Mixing Milk/mixmilk.in create mode 100644 usaco/Mixing Milk/mixmilk.out create mode 100755 usaco/Shell Game/a.out create mode 100644 usaco/Shell Game/index.cpp create mode 100644 usaco/Shell Game/shell.out diff --git a/usaco/Breed Counting/a.out b/usaco/Breed Counting/a.out new file mode 100755 index 0000000000000000000000000000000000000000..2fef82ba2c1eb4d7381be8158f9c6d30e5cffd1d GIT binary patch literal 40770 zcmeHQ4Rlo1oxg8hkV%9RB?>|ypsX8^LM9|35o`vA5hxL2lC6}l=VbDdOqtAtnF$}_ zYV7D%tDcgUv$cL~6VS5>Qp+MolP)gUoFlfYN8(y#mD+$DI~=gJ==RLGrrF>BzB`jQ zlL=5Lr#*Y_JKVYVcR&93e}DIX@11)y@AB3cpZsYIV+zA#fx8y2J%h1_TBlPKy8&() zoTgPSTIyWmtXf5}$qz4_95oD)oMXtSX*JH(HOa}mygfON2|NnXaYs2cEu?P^QOI~w z&Y_;{SAwfMGp ze07?~SMNt;sytRMj3M5sz^O9gvdE`?eF9F?mMp4Sq&ZfttTuYrF66-HPl~T1k{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ob?j-5m#sl9@6u2z99@rx#X`Xnl}7fkjB3tUFj{M+@QI&^KW+kA8gPrxPSU0-_j-}9N zBQzd|W5$8rFeTvp&blP{3GK+&SB_AE!(FQ)T#$VFH02>g8c0xhhC5b7jbA?<< zjTy2TqoHP1hxkPGchIRQ_{Skg(ixR0Q{jl2E=^lUVZ71em~}pmUi?kX0X-Ph>o8_L z0p7=#L(3_pr#hTM$<6=rRtxm6ZwRl7PlvE438l2UOFveEZXsd99X70o*rAgtR zt4YQDdVgRG4unQ5$o1zFNJ&6%@^9AB?s`4IPZ4PfDdLCJrp6T(4x?Gqy?WDSb6w#n za8}e7IGyNNnu5|1evx`4A8c26Y!Ga_Siwn!p-a->#$w>}`*4=;+3az7HBbF=k_>f| zO7W`9;96fCsKff3Y;HrVPnyIF zOT?0;`;z`NR5A2-JesZ&U%#=wSFNbgs#YLU{KYTnt5YIl@oaI)~gq>)R_6hVr;fyQAGvAqi~RGdcOE@%we49>_-%ib@-EmIGnF2|HA07$HLFH zHXvoSNXH52GdrePaJBqJJ@$Am#We@tf7v(cZ&$Zh{_jn@UV3tI@6WfC%qjn@sU&Bi zEi?Aq^)EjC+x0)WfA9X){?|^|AI^BMuWzGe)#_1$_a3Fl<LINHTLV5 zKWuCL;Ki~hcW7Nw3{NsI(|J%gp zvre80{`8Y~?>xGF%lF>9|95${P5S6x&8eL9@#!bO_xR)g^xU04>TUe(kww*q%YU!j z@cD)6zufeU1DhW?7jmtBVs+NfCPyAQ((>eM|D4@1dH3$y7S#F=6kIcJ${E)O@Ar0( fTM%4ZT=5g{=+EAI@AlZs_uO3KDtYdub+!KoTw$QH literal 0 HcmV?d00001 diff --git a/usaco/Breed Counting/index.cpp b/usaco/Breed Counting/index.cpp new file mode 100644 index 0000000..9b81be3 --- /dev/null +++ b/usaco/Breed Counting/index.cpp @@ -0,0 +1,34 @@ +using namespace std; + +#include +#include + +int main() { + freopen("bcount.in", "r", stdin); + freopen("bcount.out", "w", stdout); + int n, q; + cin >> n >> q; + int cow_array[n]; + for (int i = 0; i < n; i++) { + int j; + cin >> j; + cow_array[i] = j; + } + for (int i = 0; i < q; i++) { + int j, k; + cin >> j >> k; + int a = 0; + int b = 0; + int c = 0; + for (int i = 0; i < abs(j - k) + 1; i++) { + if (cow_array[i + j - 1] == 1) { + a++; + } else if (cow_array[i + j - 1] == 2) { + b++; + } else if (cow_array[i + j - 1] == 3) { + c++; + } + } + cout << a << " " << b << " " << c << endl; + } +} diff --git a/usaco/Mixing Milk/a.out b/usaco/Mixing Milk/a.out new file mode 100755 index 0000000000000000000000000000000000000000..5a0c37dc1c490859be1b4882f5f1acb3013326ac GIT binary patch literal 35394 zcmeI5Yiv}<701urwZS|B1{@v%W77a3KmlVOc3R95vtSA`U^^A1#FO>LqtTCVC1&xLluuo*b%Lqq@ku#YfD7!hc-g45N%V5N7__IRjRhBDle+*{?EO4 zm%A5-6s1z7_Kb9P=A4;1GxM9r^_Ll6zWx3`rxIy|;DOA9oXR3Pnpngpng^+XD79zH zcK?2V)o!+C2D5Ue=`M}^{2B$7s`2lu$;>wE`!a20>)9};gi9!8=y8KnR&e{vd(0Y4 zKgPg;bskqbWKklWMnb8W(OMTvo810>QD*r&VV7Xt=`Y9j2Zm-)sv#IudOWDN7|ICL zx&0m3Z22p+%d_tEXPeWJQo)!J4MiGki`!p^?Qg!F&$=_XeJj-(IUI`At5D=%GYY!> zy<+=ow4Jc-_Tlu;^ZJVEXX}=lEvkHXWwkZCK6_CiHiIkn!pOpNp9=xEX2-NbAKxFh zWd@&B-_~dX5~(?0+nsg0Ye(fy|JEI;HJ5Pp3p$6#CtET1$6Sw=O6!Oc+&^A5g8)%% z>x0h|#bIVPb0HO-L_7!aqeN>kuqjCIfpFlyvG8~&L3odSSQt4%R4`8FG}sCuJjT_n zvFPe>sBU$ATeu!N2X34DvAW{&Te(X&oO$Er7q7i=GZ9=1TOq_66W5+C&!Q4I`id_4`F-XF`|>siQ-HNLO=)z0U;m+gn$qb0zyCt z2mv7=1cZPP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000000..c1b2c8b --- /dev/null +++ b/usaco/Mixing Milk/index.cpp @@ -0,0 +1,69 @@ +using namespace std; + +#include + +int main() { + freopen("mixmilk.in", "r", stdin); + freopen("mixmilk.out", "w", stdout); + + int a_cap, a_val; + cin >> a_cap >> a_val; + int b_cap, b_val; + cin >> b_cap >> b_val; + int c_cap, c_val; + cin >> c_cap >> c_val; + + for (int i = 0; i < 33; i++) { + int a_diff, b_diff, c_diff; + a_diff = abs(a_cap - a_val); + b_diff = abs(b_cap - b_val); + c_diff = abs(c_cap - c_val); + + if (b_diff >= a_val) { + b_val += a_val; + a_val = 0; + } else { + b_val = b_cap; + a_val -= b_diff; + } + a_diff = abs(a_cap - a_val); + b_diff = abs(b_cap - b_val); + c_diff = abs(c_cap - c_val); + + if (c_diff >= b_val) { + c_val += b_val; + b_val = 0; + } else { + c_val = c_cap; + b_val -= c_diff; + } + a_diff = abs(a_cap - a_val); + b_diff = abs(b_cap - b_val); + c_diff = abs(c_cap - c_val); + + if (a_diff >= c_val) { + a_val += c_val; + c_val = 0; + } else { + a_val = a_cap; + c_val -= a_diff; + } + a_diff = abs(a_cap - a_val); + b_diff = abs(b_cap - b_val); + c_diff = abs(c_cap - c_val); + } + int a_diff, b_diff, c_diff; + a_diff = abs(a_cap - a_val); + b_diff = abs(b_cap - b_val); + c_diff = abs(c_cap - c_val); + + if (b_diff >= a_val) { + b_val += a_val; + a_val = 0; + } else { + b_val = b_cap; + a_val -= b_diff; + } + + cout << a_val << endl << b_val << endl << c_val << endl; +} diff --git a/usaco/Mixing Milk/mixmilk.in b/usaco/Mixing Milk/mixmilk.in new file mode 100644 index 0000000..b74be8d --- /dev/null +++ b/usaco/Mixing Milk/mixmilk.in @@ -0,0 +1,3 @@ +10 3 +11 4 +12 5 diff --git a/usaco/Mixing Milk/mixmilk.out b/usaco/Mixing Milk/mixmilk.out new file mode 100644 index 0000000..c2a9177 --- /dev/null +++ b/usaco/Mixing Milk/mixmilk.out @@ -0,0 +1,3 @@ +0 +10 +2 diff --git a/usaco/Shell Game/a.out b/usaco/Shell Game/a.out new file mode 100755 index 0000000000000000000000000000000000000000..3dfbf6800280ff06912dfa7b0b6033af5414610e GIT binary patch literal 35538 zcmeI5e{56N702(h10+BpZTOv^{MgixED*wvz*aCdZb@MwB-sdoadDiN#Kdtj`x%mw zwk|1Sh*lyfn^;?EurbX^X@yudj5ZWdrdHe9t=S~TCd7dKu~djn+ArB?Y4$zuy%_s7 zrK>t=+H|gTeD68;p7YNA-1j5@+?!wCyZga(ArygPgFFH`l_tdD@Io?)`H;;JDXTU< z>8f{CZzF4J(VbIGAJQn!H4K!p)>T)V+O7LLQfx{`1 zV-8eEr+Fnxng}P_Xh<25M=c>T?$#TqYc#+z&Qlb&3xv84?84|x5J((7+($3Sbm zlV-dYGYIL{7|HQzT~F$9Hf^lkD4p9XYmC)(m^T$_y;y2Hj3l)7nGkSmPg+*!6UU2S ztX>?3zp07IXpFA`+3w%BTPrHJxHeUc-*aJ0UeKxhYN}CFKKlJ=sA8oMVakv0nixQo znR@Jy5S=g+n|ajTBSbFhYlnr{i-}D`y9z>uawDPnWWYA zf`Mf|Z^N?2E?*;bD%lXqqrsDR@RA~P2zzyz286JP>NfC(@GCcp%k z025#WOn?b60Vco%m;e)C0!)AjFaajO1egF5U;<2l2`~XBzyz286JP>NfC(@GCcp%k z025#WOn?b60Vco%m;e*_FAx|#IM_dG7rkRn+ip^bHQ>MI&|@ zeIM8Cx97z&{{HN*3m+4`g?GD8^!Ln-VgK2=%+7Jh?71^JRCvHJ7Z&W2kkl0!J+JEWN243{UPzyrIQhx z+BAmxdeGOiD{<|CG`coo;yMG!;kBVxqEB_TMhBeP(E+pzyY^vhcC;Vu^e!*rE$nCe7Ln7ay?C39` zpT=07Nr5AdEth=?)^y<#M;vPlK6_&MSj&i0BCol|{bk;B{XH^<9PgY)9;ci;qJvob z(Suham+kWEbMPJO5yPVgmHttu=)E~b#BbR}{N@x#e8i6XMcHt5^x(#RjOnHE*0Ce{ zI1#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_3w6HFS@#8`^eHSubJ~y{EBSuc=i1G zKgEt*c>TGv=j+yr)e|zJH-!83qCKSAKxa95ceeTxvqFL7qR{nH){?6PDRX1K+^m0wK zZt +#include + +int main() { + freopen("shell.in", "r", stdin); + freopen("shell.out", "w", stdout); + + int n; + cin >> n; + + int score = 0; + + int a_values[n]; + int b_values[n]; + int g_values[n]; + for (int i = 0; i < n; i++) { + cin >> a_values[i] >> b_values[i] >> g_values[i]; + } + int shell_num; + shell_num = 0; + for (int i = 0; i < 3; i++) { + shell_num = i + 1; + for (int j = 0; j < n; j++) { + int a, b, g; + a = a_values[i]; + b = b_values[i]; + g = g_values[i]; + if (a == shell_num) { + shell_num = b; + } else if (b == shell_num) { + shell_num = a; + } + if (g == shell_num) { + score++; + } + } + } + cout << score << endl; +} diff --git a/usaco/Shell Game/shell.out b/usaco/Shell Game/shell.out new file mode 100644 index 0000000..e69de29