#include #include typedef long long cookie_t; char const fnames[][16]={"hand","lily","factory","casino","grimoire"}; cookie_t const bspeeds[]={1,10,120,2000,25000}; cookie_t const bprices[]={150,2000,30000,600000,10000000}; char const * const actss[]={ /* 00 */ "AABBBBBBCBBDDBDDDBDAEDDFDFFFBDBBFFGFFCBBHBHDBHFHHHDIHHFJHJHEDJFFDDJJBDDBJKJGHFFJJFJFHDHFDBIHHJHJFHFDBBHJJJCDBBBBAKJJJJHHFEDFDDHGFFFFDDDBBJHFDIHHHJHBFJHBBFDBFHDKJBFJJJDHFBJCBBBBDHFBJDHFEDDDDBJDHFABGFFF", /* 01 */ "AABBBBBBDCBBDBDBDADDEDFDFBFDFDBFCBBFGFFBHHDBBBFFBDBHHHHDIHHJJHFJHJEDHFFDDDDBJBGJJKJFFFFHJJFDJHHIHHHBJHDJFFCDDDDBBBBBAHEFHHFFJJJJKJGFDFDJFDJDBBBJFHHHIJHHHFJHJHBBFDBFHDKJBFJJJDHFBJCBBBBDHFBJDHFEDDDDBFBD", /* 02 */ "AABBBBBBCBBDDBBBDADDDEDDFFDBBFDDFCBBFBDBGFFFHHHBFBHBFDFHHIHHHDEDFDDDBFFBJJJFJHGJDHJKJJFFHHDBJDHHIJFFBBHHJHFHCDBBAJBBJJKJJJHFEDDJGHHFFFFFDDDDDBBJFIHHJHHJFJBHBBFDBFHDKJBFJJJDHFBJCBBBBDHFBJDHFEDDDDDJHFHH", /* 03 */ "AABBBBBBBCBDDBDBBBDDDADBBEDFFFFDDFFCBBDFGBBFFBHHHDFHBDHFFHEIHHJFDDBHJDDBJHDJJHHFJGHKJJFFFDDBJJIHHFFBHHJJHFJHJDFCDBBBBAJHJKJJEFDDHJJHHFFFDDDBBGFDIHFHJHJJHBFBBFDBFHDKJBFJJJDHFBJCBBBBDHFBJDHFEDDDBFBHJFDH", /* 04 */ "AABBBBBBCBDBDBDBABDDDBEDDFFDFFDCBBFBFBGFFBHHDBFHDHHHDDIHFJJHEJFFDHDBBHDDHDBJJFGF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HFEDDDFDBBHBDDD", /* 49 */ "AABBBBBBCBDBDBDBDADBDEDFDFFDDBBFBFFGFFCBBDBHHFHDHFHDFHIHHDJHDFJJEDBHDJGFFDBFHFDJKJJJJFHFDBIHHHHJJFFCDDBBBBBBBAHFHHJJFDDDBJKJJEJHJGHFFFFFDDDDDBBBJHIHHFHJJHHJHFFHDKJBFJJJDHFBJCBBBBDHFBJDHFEDDDDBDBJHBFBB", 0 }; char buf[100]; char events[10010]; int asale[10010]; int akoma[10010]; int abonus[10010]; cookie_t buy_price(cookie_t price,int num){ for(;num--;){ price+=(price+4)/5; } return price; } cookie_t rein_price(cookie_t price,int lvl){ for(;lvl--;){ price*=10; } return price; } struct Solver { char const * acts=0; bool final=false; cookie_t cookie=0; int acti=0; int cl=0; int n[5]={0,0,0,0,0}; int l[5]={0,0,0,0,0}; int nsum=0; int nowsale=0; int nowfever=0; int turn=0; void output(char const * cmd){ if(final){ dprintf(1,"%s\n",cmd); } } void output(char const * cmd, char const * arg){ if(final){ dprintf(1,"%s %s\n",cmd,arg); } } void estimate(cookie_t & price, cookie_t & refund, cookie_t & delta, cookie_t & saved){ int a=acts[acti]; if(a=='A'){ // enhclick price=rein_price(15,cl); refund=0; delta=cookie_t(1)<>1; if(a&1){ // reinforce price=rein_price(bprices[i]*10,l[i]); refund=0; delta=bspeeds[i]*n[i]<>1; if(a&1){ // reinforce l[i]+=1; output("reinforce",fnames[i]); }else{ // buy n[i]+=1; nsum+=1; output("buy",fnames[i]); } } } void act_click(){ cookie+=(cookie_t(1)<=10000){ for(int i=0;i<5;++i){ if(n[i]){ n[i]-=1; cookie+=(buy_price(bprices[i],n[i])+3)/4; output("sell",fnames[i]); return; } } }else if(a>='A'&&a<='K'){ cookie_t price,refund,delta,saved; estimate(price,refund,delta,saved); if(cookie>=price && akoma[turn]*delta+refund>=price && asale[turn]*delta*2>=saved){ act_consume(); return; } }else{ dprintf(2,"out of action\n"); } act_click(); } void step() { // action action(); // produce for(int i=0;i<5;++i){ cookie+=(bspeeds[i]*n[i]<