fork(10) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. // バランシングの既定パラメータ
  5. #define BALANCING_BORDER 990
  6.  
  7. ///////////////////////////////
  8. // ここの数字だけパラメータに合わせて変更。
  9. // 初期パラ変更する場合ここから。
  10. int iLife=75;// ライフ
  11. int iPower=400;// ちから
  12. int iTough=1;// 丈夫さ
  13. int iAim=500;// 命中
  14. int iDodge=800;// 回避
  15. ///////////////////////////////
  16.  
  17. // 使用した薬のカウンターなので変えないこと。
  18. int iKusoCount=0;
  19. int iHittyuCount=0;
  20. int iBiasineCount=0;
  21. int iTapaCount=0;
  22. int iLaroxCount=0;
  23.  
  24. // 空走丸
  25. void UseKuso(int itrial){
  26. for(int i=0;i<itrial;++i) {
  27. iKusoCount++;
  28. std::cout<< "Using Kuso" <<std::endl;
  29. iTough-=10;
  30. if(iTough<1){
  31. iTough=1;
  32. }
  33. iDodge+=20;
  34. if(iDodge>999){
  35. iDodge=999;
  36. }}}
  37.  
  38. // 必中丸
  39. void UseHittyu(int itrial){
  40. for(int i=0;i<itrial;++i) {
  41. iHittyuCount++;
  42. std::cout<< "Using Hittyu" <<std::endl;
  43. iPower-=10;
  44. if(iPower<1){
  45. iPower=1;
  46. }
  47. iAim+=20;
  48. if(iAim>999){
  49. iAim=999;
  50. }}}
  51.  
  52. // バイアシン
  53. void UseBiasine(int itrial){
  54. for(int i=0;i<itrial;++i) {
  55. iBiasineCount++;
  56. std::cout<< "Using Biasine" <<std::endl;
  57. iAim-=10;
  58. if(iAim<1){
  59. iAim=1;
  60. }
  61. iPower+=10;
  62. if(iPower>999){
  63. iPower=999;
  64. }
  65. iLife+=10;
  66. if(iLife>999){
  67. iLife=999;
  68. }
  69. }
  70. }
  71.  
  72. // タパウリン
  73. void UseTapa(int itrial){
  74. for(int i=0;i<itrial;++i) {
  75. iTapaCount++;
  76. std::cout<< "Using Tapa" <<std::endl;
  77. iDodge-=10;
  78. if(iDodge<1){
  79. iDodge=1;
  80. }
  81. iLife+=10;
  82. if(iLife>999){
  83. iLife=999;
  84. }
  85. iTough+=10;
  86. if(iTough>999){
  87. iTough=999;
  88. }
  89. }
  90. }
  91.  
  92. // ラロックス
  93. void UseLarox(int itrial){
  94. for(int i=0;i<itrial;++i) {
  95. iLaroxCount++;
  96. std::cout<< "Using Larox" <<std::endl;
  97. iLife-=10;
  98. if(iLife<1){
  99. iLife=1;
  100. }
  101. iPower+=10;
  102. if(iPower>999){
  103. iPower=999;
  104. }
  105. iTough+=10;
  106. if(iTough>999){
  107. iTough=999;
  108. }
  109. }
  110. }
  111.  
  112. bool IsOffenseSperior(){
  113. int iOffense = iPower+iAim;
  114. int iDeffense = iTough+iDodge;
  115. if(iOffense>iDeffense){return true;}
  116. else{return false;}
  117. }
  118.  
  119. bool Balancing(){
  120. bool bSuccess=false;
  121. if(IsOffenseSperior()){
  122. if(iTough< BALANCING_BORDER) {
  123. UseTapa(1);
  124. bSuccess=true;
  125. }
  126. if(iDodge< BALANCING_BORDER - 10){
  127. UseKuso(1);
  128. bSuccess=true;
  129. }
  130. }
  131. else{
  132. if(iPower< BALANCING_BORDER){
  133. UseBiasine(1);
  134. bSuccess=true;
  135. }
  136. if(iAim< BALANCING_BORDER - 10){
  137. UseHittyu(1);
  138. bSuccess=true;
  139. }
  140. }
  141. return bSuccess;
  142. }
  143.  
  144. void Consolidate_toAim(){
  145. while(iAim<980){
  146. UseHittyu(1);
  147. }
  148. }
  149.  
  150. void Consolidate_toDodge(){
  151. while(iDodge<980){
  152. UseKuso(1);
  153. }
  154. }
  155.  
  156. // ライフちから丈夫さのうち2つが980越えたら投与終わりにする。
  157. bool bTwoStatusRemain(){
  158. int iStatusRem=0;
  159. if(iPower< BALANCING_BORDER)iStatusRem++;
  160. if(iLife< BALANCING_BORDER)iStatusRem++;
  161. if(iTough< BALANCING_BORDER)iStatusRem++;
  162. if(iStatusRem>1){return true;}
  163. else {return false;}
  164.  
  165. }
  166.  
  167. int calculateLaroxNum()
  168. {
  169. // タパウリン2と空走丸で丈夫さ+10、ライフ+20
  170. // バイアシン2と必中丸でちから+10、ライフ+20
  171. int iPowRem = (999-iPower)/10; // ちから上限直前までのラロックス許容数
  172. int iToughRem = (999 - iTough)/10;// 丈夫さ上限直前までのラロックス許容数
  173. int iRem = iPowRem + iToughRem;
  174.  
  175. // ライフを+980上げるときに、
  176. // ちからと丈夫さは合計+490される
  177. // 基本はiRemの状態からLaroxNum×2を引いて49となるようにラロックス数を調整すれば良いのでここから逆算。
  178. int iLaroxNum = (iRem - 49)/2;
  179.  
  180. // ちから、丈夫さがカンストする場合は直前で止める。
  181. if(iLaroxNum>iPowRem){
  182. iLaroxNum=iPowRem;
  183. }
  184. if(iLaroxNum>iToughRem){
  185. iLaroxNum=iToughRem;
  186. }
  187.  
  188. std::cout<< "★★★★★★★★★★★★" <<std::endl;
  189. std::cout<< "calculated LaroxNum" << iLaroxNum <<std::endl;
  190. std::cout<< "★★★★★★★★★★★★" <<std::endl;
  191. return iLaroxNum;
  192. }
  193.  
  194.  
  195. int main() {
  196. // 空走丸、必中丸で回避命中にステ寄せ。
  197. Consolidate_toAim();
  198. Consolidate_toDodge();
  199.  
  200. // ライフ1カンストのためのラロックス祭
  201. UseLarox(calculateLaroxNum());
  202.  
  203. // ライフちから丈夫さが2つ以上既定越えるまでバランシング
  204. while(bTwoStatusRemain()){
  205. if(!Balancing()){
  206. break;
  207. }
  208. }
  209.  
  210. std::cout<< "★★★ Status ★★★" <<std::endl;
  211. std::cout<< "iLife = " << iLife <<std::endl;
  212. std::cout<< "iPower = " << iPower <<std::endl;
  213. std::cout<< "iTough = " << iTough <<std::endl;
  214. std::cout<< "iAim = " << iAim <<std::endl;
  215. std::cout<< "iDodge = " << iDodge <<std::endl;
  216.  
  217. std::cout<< "★★★ Required Items ★★★" <<std::endl;
  218. std::cout << "iKuso = " << iKusoCount << std::endl;
  219. std::cout << "iHittyu = " << iHittyuCount << std::endl;
  220. std::cout << "iTapa = " << iTapaCount << std::endl;
  221. std::cout << "iBiasine = " << iBiasineCount << std::endl;
  222. std::cout << "iLarox = " << iLaroxCount << std::endl;
  223. int iTotal=iKusoCount+iHittyuCount+iTapaCount+iBiasineCount+iLaroxCount;
  224. std::cout<< "iTotal = " << iTotal <<std::endl;
  225. return 0;
  226. }
Success #stdin #stdout 0s 4404KB
stdin
Standard input is empty
stdout
Using Hittyu
Using Hittyu
Using Hittyu
Using Hittyu
Using Hittyu
Using Hittyu
Using Hittyu
Using Hittyu
Using Hittyu
Using Hittyu
Using Hittyu
Using Hittyu
Using Hittyu
Using Hittyu
Using Hittyu
Using Hittyu
Using Hittyu
Using Hittyu
Using Hittyu
Using Hittyu
Using Hittyu
Using Hittyu
Using Hittyu
Using Hittyu
Using Kuso
Using Kuso
Using Kuso
Using Kuso
Using Kuso
Using Kuso
Using Kuso
Using Kuso
Using Kuso
★★★★★★★★★★★★
calculated LaroxNum66
★★★★★★★★★★★★
Using Larox
Using Larox
Using Larox
Using Larox
Using Larox
Using Larox
Using Larox
Using Larox
Using Larox
Using Larox
Using Larox
Using Larox
Using Larox
Using Larox
Using Larox
Using Larox
Using Larox
Using Larox
Using Larox
Using Larox
Using Larox
Using Larox
Using Larox
Using Larox
Using Larox
Using Larox
Using Larox
Using Larox
Using Larox
Using Larox
Using Larox
Using Larox
Using Larox
Using Larox
Using Larox
Using Larox
Using Larox
Using Larox
Using Larox
Using Larox
Using Larox
Using Larox
Using Larox
Using Larox
Using Larox
Using Larox
Using Larox
Using Larox
Using Larox
Using Larox
Using Larox
Using Larox
Using Larox
Using Larox
Using Larox
Using Larox
Using Larox
Using Larox
Using Larox
Using Larox
Using Larox
Using Larox
Using Larox
Using Larox
Using Larox
Using Larox
Using Tapa
Using Kuso
Using Tapa
Using Tapa
Using Kuso
Using Tapa
Using Tapa
Using Kuso
Using Tapa
Using Tapa
Using Kuso
Using Tapa
Using Tapa
Using Kuso
Using Tapa
Using Tapa
Using Kuso
Using Tapa
Using Tapa
Using Kuso
Using Tapa
Using Tapa
Using Kuso
Using Tapa
Using Tapa
Using Kuso
Using Tapa
Using Tapa
Using Kuso
Using Tapa
Using Tapa
Using Kuso
Using Tapa
Using Tapa
Using Kuso
Using Tapa
Using Tapa
Using Kuso
Using Tapa
Using Tapa
Using Kuso
Using Tapa
Using Tapa
Using Kuso
Using Tapa
Using Tapa
Using Kuso
Using Biasine
Using Hittyu
Using Tapa
Using Tapa
Using Kuso
Using Biasine
Using Biasine
Using Hittyu
Using Tapa
Using Tapa
Using Kuso
Using Biasine
Using Biasine
Using Hittyu
Using Tapa
Using Tapa
Using Kuso
Using Biasine
Using Biasine
Using Hittyu
Using Tapa
Using Tapa
Using Kuso
Using Biasine
Using Biasine
Using Hittyu
Using Tapa
Using Tapa
Using Kuso
Using Biasine
Using Biasine
Using Hittyu
Using Tapa
Using Tapa
Using Kuso
Using Biasine
Using Biasine
Using Hittyu
Using Tapa
Using Tapa
Using Kuso
Using Biasine
Using Biasine
Using Hittyu
Using Tapa
Using Tapa
Using Kuso
Using Biasine
Using Biasine
Using Hittyu
Using Tapa
Using Tapa
Using Kuso
Using Biasine
Using Biasine
Using Hittyu
Using Tapa
Using Tapa
Using Kuso
Using Biasine
Using Biasine
Using Hittyu
Using Tapa
Using Tapa
Using Kuso
Using Biasine
Using Biasine
Using Hittyu
Using Tapa
Using Tapa
Using Kuso
Using Biasine
Using Biasine
Using Hittyu
Using Tapa
Using Tapa
Using Kuso
Using Biasine
Using Biasine
Using Hittyu
Using Tapa
Using Tapa
Using Kuso
Using Biasine
Using Biasine
Using Hittyu
Using Tapa
Using Tapa
Using Kuso
Using Biasine
Using Biasine
Using Hittyu
Using Tapa
Using Tapa
Using Kuso
Using Biasine
Using Biasine
Using Hittyu
Using Tapa
Using Tapa
Using Kuso
Using Biasine
★★★ Status ★★★
iLife = 991
iPower = 990
iTough = 981
iAim = 980
iDodge = 990
★★★ Required Items ★★★
iKuso = 42
iHittyu = 41
iTapa = 65
iBiasine = 34
iLarox = 66
iTotal = 248