{"id":671,"date":"2020-03-12T20:08:48","date_gmt":"2020-03-12T12:08:48","guid":{"rendered":"http:\/\/kylelv.com\/?p=671"},"modified":"2020-03-13T15:05:40","modified_gmt":"2020-03-13T07:05:40","slug":"%e9%ad%94%e5%85%bd%e4%b8%96%e7%95%8c%e4%b8%89%e5%bc%80%e6%88%98","status":"publish","type":"post","link":"https:\/\/blog.kylelv.com\/?p=671","title":{"rendered":"\u9b54\u517d\u4e16\u754c\u4e09(\u5f00\u6218)"},"content":{"rendered":"\n<h2 class=\"has-text-align-center wp-block-heading\">\u9b54\u517d\u4e16\u754c\u4e09(\u5f00\u6218)<\/h2>\n\n\n\n<p class=\"has-text-align-center\">\u603b\u65f6\u95f4\u9650\u5236:&nbsp;2000ms&nbsp;\u5185\u5b58\u9650\u5236:&nbsp;65536kB<\/p>\n\n\n\n<p>\u63cf\u8ff0<\/p>\n\n\n\n<p>\u9b54\u517d\u4e16\u754c\u7684\u897f\u9762\u662f\u7ea2\u9b54\u519b\u7684\u53f8\u4ee4\u90e8\uff0c\u4e1c\u9762\u662f\u84dd\u9b54\u519b\u7684\u53f8\u4ee4\u90e8\u3002\u4e24\u4e2a\u53f8\u4ee4\u90e8\u4e4b\u95f4\u662f\u4f9d\u6b21\u6392\u5217\u7684\u82e5\u5e72\u57ce\u5e02\uff0c\u57ce\u5e02\u4ece\u897f\u5411\u4e1c\u4f9d\u6b21\u7f16\u53f7\u4e3a1,2,3 &#8230;. N ( N &lt;= 20)\u3002\u7ea2\u9b54\u519b\u7684\u53f8\u4ee4\u90e8\u7b97\u4f5c\u7f16\u53f7\u4e3a0\u7684\u57ce\u5e02\uff0c\u84dd\u9b54\u519b\u7684\u53f8\u4ee4\u90e8\u7b97\u4f5c\u7f16\u53f7\u4e3aN+1\u7684\u57ce\u5e02\u3002\u53f8\u4ee4\u90e8\u6709\u751f\u547d\u5143\uff0c\u7528\u4e8e\u5236\u9020\u6b66\u58eb\u3002<\/p>\n\n\n\n<p>\u4e24\u519b\u7684\u53f8\u4ee4\u90e8\u90fd\u4f1a\u5236\u9020\u6b66\u58eb\u3002\u6b66\u58eb\u4e00\u5171\u6709dragon&nbsp;\u3001ninja\u3001iceman\u3001lion\u3001wolf&nbsp;\u4e94\u79cd\u3002\u6bcf\u79cd\u6b66\u58eb\u90fd\u6709\u7f16\u53f7\u3001\u751f\u547d\u503c\u3001\u653b\u51fb\u529b\u8fd9\u4e09\u79cd\u5c5e\u6027\u3002<\/p>\n\n\n\n<p>\u53cc\u65b9\u7684\u6b66\u58eb\u7f16\u53f7\u90fd\u662f\u4ece1\u5f00\u59cb\u8ba1\u7b97\u3002\u7ea2\u65b9\u5236\u9020\u51fa\u6765\u7684\u7b2cn&nbsp;\u4e2a\u6b66\u58eb\uff0c\u7f16\u53f7\u5c31\u662fn\u3002\u540c\u6837\uff0c\u84dd\u65b9\u5236\u9020\u51fa\u6765\u7684\u7b2cn&nbsp;\u4e2a\u6b66\u58eb\uff0c\u7f16\u53f7\u4e5f\u662fn\u3002<\/p>\n\n\n\n<p>\u6b66\u58eb\u5728\u521a\u964d\u751f\u7684\u65f6\u5019\u6709\u4e00\u4e2a\u521d\u59cb\u7684\u751f\u547d\u503c\uff0c\u751f\u547d\u503c\u5728\u6218\u6597\u4e2d\u4f1a\u53d1\u751f\u53d8\u5316\uff0c\u5982\u679c\u751f\u547d\u503c\u51cf\u5c11\u52300\uff08\u751f\u547d\u503c\u53d8\u4e3a\u8d1f\u6570\u65f6\u5e94\u5f53\u505a\u53d8\u4e3a0\u5904\u7406\uff09\uff0c\u5219\u6b66\u58eb\u6b7b\u4ea1\uff08\u6d88\u5931\uff09\u3002<\/p>\n\n\n\n<p>\u6b66\u58eb\u53ef\u4ee5\u62e5\u6709\u6b66\u5668\u3002\u6b66\u5668\u6709\u4e09\u79cd\uff0csword, bomb,\u548carrow\uff0c\u7f16\u53f7\u5206\u522b\u4e3a0,1,2\u3002<\/p>\n\n\n\n<p>sword\u7684\u653b\u51fb\u529b\u662f\u4f7f\u7528\u8005\u5f53\u524d\u653b\u51fb\u529b\u768420%(\u53bb\u5c3e\u53d6\u6574)\u3002<\/p>\n\n\n\n<p>bomb\u7684\u653b\u51fb\u529b\u662f\u4f7f\u7528\u8005\u5f53\u524d\u653b\u51fb\u529b\u768440%(\u53bb\u5c3e\u53d6\u6574)\uff0c\u4f46\u662f\u4e5f\u4f1a\u5bfc\u81f4\u4f7f\u7528\u8005\u53d7\u5230\u653b\u51fb\uff0c\u5bf9\u4f7f\u7528\u8005\u7684\u653b\u51fb\u529b\u662f\u5bf9\u654c\u4eba\u53d6\u6574\u540e\u7684\u653b\u51fb\u529b\u76841\/2(\u53bb\u5c3e\u53d6\u6574)\u3002Bomb\u4e00\u65e6\u4f7f\u7528\u5c31\u6ca1\u4e86\u3002<\/p>\n\n\n\n<p>arrow\u7684\u653b\u51fb\u529b\u662f\u4f7f\u7528\u8005\u5f53\u524d\u653b\u51fb\u529b\u768430%(\u53bb\u5c3e\u53d6\u6574)\u3002\u4e00\u4e2aarrow\u7528\u4e24\u6b21\u5c31\u6ca1\u4e86\u3002<\/p>\n\n\n\n<p>\u6b66\u58eb\u964d\u751f\u540e\u5c31\u671d\u5bf9\u65b9\u53f8\u4ee4\u90e8\u8d70\uff0c\u5728\u7ecf\u8fc7\u7684\u57ce\u5e02\u5982\u679c\u9047\u5230\u654c\u4eba\uff08\u540c\u4e00\u65f6\u523b\u6bcf\u4e2a\u57ce\u5e02\u6700\u591a\u53ea\u53ef\u80fd\u67091\u4e2a\u84dd\u6b66\u58eb\u548c\u4e00\u4e2a\u7ea2\u6b66\u58eb\uff09\uff0c\u5c31\u4f1a\u53d1\u751f\u6218\u6597\u3002\u6218\u6597\u7684\u89c4\u5219\u662f\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>\u5728\u5947\u6570\u7f16\u53f7\u57ce\u5e02\uff0c\u7ea2\u6b66\u58eb\u5148\u53d1\u8d77\u653b\u51fb<\/li><li>\u5728\u5076\u6570\u7f16\u53f7\u57ce\u5e02\uff0c\u84dd\u6b66\u58eb\u5148\u53d1\u8d77\u653b\u51fb<\/li><li>\u6218\u6597\u5f00\u59cb\u524d\uff0c\u53cc\u65b9\u5148\u5bf9\u81ea\u5df1\u7684\u6b66\u5668\u6392\u597d\u4f7f\u7528\u987a\u5e8f\uff0c\u7136\u540e\u518d\u4e00\u4ef6\u4e00\u4ef6\u5730\u6309\u987a\u5e8f\u4f7f\u7528\u3002\u7f16\u53f7\u5c0f\u7684\u6b66\u5668\uff0c\u6392\u5728\u524d\u9762\u3002\u82e5\u6709\u591a\u652farrow\uff0c\u7528\u8fc7\u7684\u6392\u5728\u524d\u9762\u3002\u6392\u597d\u5e8f\u540e\uff0c\u653b\u51fb\u8005\u6309\u6b64\u6392\u5e8f\u4f9d\u6b21\u5bf9\u654c\u4eba\u4e00\u4ef6\u4e00\u4ef6\u5730\u4f7f\u7528\u6b66\u5668\u3002\u5982\u679c\u4e00\u79cd\u6b66\u5668\u6709\u591a\u4ef6\uff0c\u90a3\u5c31\u90fd\u8981\u7528\u4e0a\u3002\u6bcf\u4f7f\u7528\u4e00\u4ef6\u6b66\u5668\uff0c\u88ab\u653b\u51fb\u8005\u751f\u547d\u503c\u8981\u51cf\u53bb\u6b66\u5668\u653b\u51fb\u529b\u3002\u5982\u679c\u4efb\u4f55\u4e00\u65b9\u751f\u547d\u503c\u51cf\u4e3a0\u6216\u5c0f\u4e8e0\u5373\u4e3a\u6b7b\u53bb\u3002\u6709\u4e00\u65b9\u6b7b\u53bb\uff0c\u5219\u6218\u6597\u7ed3\u675f\u3002<\/li><li>\u53cc\u65b9\u8f6e\u6d41\u4f7f\u7528\u6b66\u5668\uff0c\u7532\u7528\u8fc7\u4e00\u4ef6\uff0c\u5c31\u8f6e\u5230\u4e59\u7528\u3002\u67d0\u4e00\u65b9\u628a\u81ea\u5df1\u6240\u6709\u7684\u6b66\u5668\u90fd\u7528\u8fc7\u4e00\u8f6e\u540e\uff0c\u5c31\u4ece\u5934\u5f00\u59cb\u518d\u7528\u4e00\u8f6e\u3002\u5982\u679c\u67d0\u4e00\u65b9\u6ca1\u6709\u6b66\u5668\u4e86\uff0c\u90a3\u5c31\u6328\u6253\u76f4\u5230\u6b7b\u53bb\u6216\u654c\u4eba\u6b66\u5668\u7528\u5b8c\u3002\u6b66\u5668\u6392\u5e8f\u53ea\u5728\u6218\u6597\u524d\u8fdb\u884c\uff0c\u6218\u6597\u4e2d\u4e0d\u4f1a\u91cd\u65b0\u6392\u5e8f\u3002<\/li><li>\u5982\u679c\u53cc\u65b9\u6b66\u5668\u90fd\u7528\u5b8c\u4e14\u90fd\u8fd8\u6d3b\u7740\uff0c\u5219\u6218\u6597\u4ee5\u5e73\u5c40\u7ed3\u675f\u3002\u5982\u679c\u53cc\u65b9\u90fd\u6b7b\u4e86\uff0c\u4e5f\u7b97\u5e73\u5c40\u3002<\/li><li>\u6709\u53ef\u80fd\u7531\u4e8e\u6b66\u58eb\u81ea\u8eab\u653b\u51fb\u529b\u592a\u4f4e\uff0c\u800c\u5bfc\u81f4\u6b66\u5668\u653b\u51fb\u529b\u4e3a0\u3002\u653b\u51fb\u529b\u4e3a0\u7684\u6b66\u5668\u4e5f\u8981\u4f7f\u7528\u3002\u5982\u679c\u6218\u6597\u4e2d\u53cc\u65b9\u7684\u751f\u547d\u503c\u548c\u6b66\u5668\u7684\u72b6\u6001\u90fd\u4e0d\u518d\u53d1\u751f\u53d8\u5316\uff0c\u5219\u6218\u6597\u7ed3\u675f\uff0c\u7b97\u5e73\u5c40\u3002<\/li><li>\u6218\u6597\u7684\u80dc\u65b9\u83b7\u5f97\u5bf9\u65b9\u624b\u91cc\u7684\u6b66\u5668\u3002\u6b66\u58eb\u624b\u91cc\u6b66\u5668\u603b\u6570\u4e0d\u8d85\u8fc710\u4ef6\u3002\u7f34\u83b7\u6b66\u5668\u65f6\uff0c\u6309\u7167\u6b66\u5668\u79cd\u7c7b\u7f16\u53f7\u4ece\u5c0f\u5230\u5927\u7f34\u83b7\u3002\u5982\u679c\u6709\u591a\u4ef6arrow\uff0c\u4f18\u5148\u7f34\u83b7\u6ca1\u7528\u8fc7\u7684\u3002<\/li><li>\u5982\u679c\u6218\u6597\u5f00\u59cb\u524d\u53cc\u65b9\u90fd\u6ca1\u6709\u6b66\u5668\uff0c\u5219\u6218\u6597\u89c6\u4e3a\u5e73\u5c40\u3002\u5982\u679c\u5148\u653b\u51fb\u65b9\u6ca1\u6709\u6b66\u5668\uff0c\u5219\u7531\u540e\u653b\u51fb\u65b9\u653b\u51fb\u3002<\/li><\/ol>\n\n\n\n<p>\u4e0d\u540c\u7684\u6b66\u58eb\u6709\u4e0d\u540c\u7684\u7279\u70b9\u3002<\/p>\n\n\n\n<p>\u7f16\u53f7\u4e3an\u7684dragon\u964d\u751f\u65f6\u5373\u83b7\u5f97\u7f16\u53f7\u4e3an%3&nbsp;\u7684\u6b66\u5668\u3002dragon\u5728\u6218\u6597\u7ed3\u675f\u540e\uff0c\u5982\u679c\u8fd8\u6ca1\u6709\u6218\u6b7b\uff0c\u5c31\u4f1a\u6b22\u547c\u3002<\/p>\n\n\n\n<p>\u7f16\u53f7\u4e3an\u7684ninjia\u964d\u751f\u65f6\u5373\u83b7\u5f97\u7f16\u53f7\u4e3an%3&nbsp;\u548c(n+1)%3\u7684\u6b66\u5668\u3002ninja&nbsp;\u4f7f\u7528bomb\u4e0d\u4f1a\u8ba9\u81ea\u5df1\u53d7\u4f24\u3002<\/p>\n\n\n\n<p>\u7f16\u53f7\u4e3an\u7684iceman\u964d\u751f\u65f6\u5373\u83b7\u5f97\u7f16\u53f7\u4e3an%3&nbsp;\u7684\u6b66\u5668\u3002iceman\u6bcf\u524d\u8fdb\u4e00\u6b65\uff0c\u751f\u547d\u503c\u51cf\u5c1110%(\u51cf\u5c11\u7684\u91cf\u8981\u53bb\u5c3e\u53d6\u6574)\u3002<\/p>\n\n\n\n<p>\u7f16\u53f7\u4e3an\u7684lion\u964d\u751f\u65f6\u5373\u83b7\u5f97\u7f16\u53f7\u4e3an%3&nbsp;\u7684\u6b66\u5668\u3002lion&nbsp;\u6709\u201c\u5fe0\u8bda\u5ea6\u201d\u8fd9\u4e2a\u5c5e\u6027\uff0c\u5176\u521d\u59cb\u503c\u7b49\u4e8e\u5b83\u964d\u751f\u4e4b\u540e\u5176\u53f8\u4ee4\u90e8\u5269\u4f59\u751f\u547d\u5143\u7684\u6570\u76ee\u3002\u6bcf\u524d\u8fdb\u4e00\u6b65\u5fe0\u8bda\u5ea6\u5c31\u964d\u4f4eK\u3002\u5fe0\u8bda\u5ea6\u964d\u81f30\u62160\u4ee5\u4e0b\uff0c\u5219\u8be5lion\u9003\u79bb\u6218\u573a,\u6c38\u8fdc\u6d88\u5931\u3002\u4f46\u662f\u5df2\u7ecf\u5230\u8fbe\u654c\u4eba\u53f8\u4ee4\u90e8\u7684lion\u4e0d\u4f1a\u9003\u8dd1\u3002lion\u5728\u5df1\u65b9\u53f8\u4ee4\u90e8\u53ef\u80fd\u9003\u8dd1\u3002<\/p>\n\n\n\n<p>wolf\u964d\u751f\u65f6\u6ca1\u6709\u6b66\u5668\uff0c\u4f46\u662f\u5728\u6218\u6597\u5f00\u59cb\u524d\u4f1a\u62a2\u5230\u654c\u4eba\u7f16\u53f7\u6700\u5c0f\u7684\u90a3\u79cd\u6b66\u5668\u3002\u5982\u679c\u654c\u4eba\u6709\u591a\u4ef6\u8fd9\u6837\u7684\u6b66\u5668\uff0c\u5219\u5168\u90e8\u62a2\u6765\u3002Wolf\u624b\u91cc\u6b66\u5668\u4e5f\u4e0d\u80fd\u8d85\u8fc710\u4ef6\u3002\u5982\u679c\u654c\u4ebaarrow\u592a\u591a\u6ca1\u6cd5\u90fd\u62a2\u6765\uff0c\u90a3\u5c31\u5148\u62a2\u6ca1\u7528\u8fc7\u7684\u3002\u5982\u679c\u654c\u4eba\u4e5f\u662fwolf\uff0c\u5219\u4e0d\u62a2\u6b66\u5668\u3002<\/p>\n\n\n\n<p>\u4ee5\u4e0b\u662f\u4e0d\u540c\u65f6\u95f4\u4f1a\u53d1\u751f\u7684\u4e0d\u540c\u4e8b\u4ef6\uff1a<\/p>\n\n\n\n<p>\u5728\u6bcf\u4e2a\u6574\u70b9\uff0c\u5373\u6bcf\u4e2a\u5c0f\u65f6\u7684\u7b2c0\u5206\uff0c \u53cc\u65b9\u7684\u53f8\u4ee4\u90e8\u4e2d\u5404\u6709\u4e00\u4e2a\u6b66\u58eb\u964d\u751f\u3002<\/p>\n\n\n\n<p>\u7ea2\u65b9\u53f8\u4ee4\u90e8\u6309\u7167iceman\u3001lion\u3001wolf\u3001ninja\u3001dragon&nbsp;\u7684\u987a\u5e8f\u5236\u9020\u6b66\u58eb\u3002<\/p>\n\n\n\n<p>\u84dd\u65b9\u53f8\u4ee4\u90e8\u6309\u7167lion\u3001dragon\u3001ninja\u3001iceman\u3001wolf&nbsp;\u7684\u987a\u5e8f\u5236\u9020\u6b66\u58eb\u3002<\/p>\n\n\n\n<p>\u5236\u9020\u6b66\u58eb\u9700\u8981\u751f\u547d\u5143\u3002<\/p>\n\n\n\n<p>\u5236\u9020\u4e00\u4e2a\u521d\u59cb\u751f\u547d\u503c\u4e3am&nbsp;\u7684\u6b66\u58eb\uff0c\u53f8\u4ee4\u90e8\u4e2d\u7684\u751f\u547d\u5143\u5c31\u8981\u51cf\u5c11m&nbsp;\u4e2a\u3002<\/p>\n\n\n\n<p>\u5982\u679c\u53f8\u4ee4\u90e8\u4e2d\u7684\u751f\u547d\u5143\u4e0d\u8db3\u4ee5\u5236\u9020\u67d0\u672c\u8be5\u9020\u7684\u6b66\u58eb\uff0c\u90a3\u5c31\u4ece\u6b64\u505c\u6b62\u5236\u9020\u6b66\u58eb\u3002<\/p>\n\n\n\n<p>\u5728\u6bcf\u4e2a\u5c0f\u65f6\u7684\u7b2c5\u5206\uff0c\u8be5\u9003\u8dd1\u7684lion\u5c31\u5728\u8fd9\u4e00\u65f6\u523b\u9003\u8dd1\u4e86\u3002<\/p>\n\n\n\n<p>\u5728\u6bcf\u4e2a\u5c0f\u65f6\u7684\u7b2c10\u5206\uff1a\u6240\u6709\u7684\u6b66\u58eb\u671d\u654c\u4eba\u53f8\u4ee4\u90e8\u65b9\u5411\u524d\u8fdb\u4e00\u6b65\u3002\u5373\u4ece\u5df1\u65b9\u53f8\u4ee4\u90e8\u8d70\u5230\u76f8\u90bb\u57ce\u5e02\uff0c\u6216\u4ece\u4e00\u4e2a\u57ce\u5e02\u8d70\u5230\u4e0b\u4e00\u4e2a\u57ce\u5e02\u3002\u6216\u4ece\u548c\u654c\u519b\u53f8\u4ee4\u90e8\u76f8\u90bb\u7684\u57ce\u5e02\u5230\u8fbe\u654c\u519b\u53f8\u4ee4\u90e8\u3002<\/p>\n\n\n\n<p>\u5728\u6bcf\u4e2a\u5c0f\u65f6\u7684\u7b2c35\u5206\uff1a\u5728\u6709wolf\u53ca\u5176\u654c\u4eba\u7684\u57ce\u5e02\uff0cwolf\u8981\u62a2\u593a\u5bf9\u65b9\u7684\u6b66\u5668\u3002<\/p>\n\n\n\n<p>\u5728\u6bcf\u4e2a\u5c0f\u65f6\u7684\u7b2c40\u5206\uff1a\u5728\u6709\u4e24\u4e2a\u6b66\u58eb\u7684\u57ce\u5e02\uff0c\u4f1a\u53d1\u751f\u6218\u6597\u3002<\/p>\n\n\n\n<p>\u5728\u6bcf\u4e2a\u5c0f\u65f6\u7684\u7b2c50\u5206\uff0c\u53f8\u4ee4\u90e8\u62a5\u544a\u5b83\u62e5\u6709\u7684\u751f\u547d\u5143\u6570\u91cf\u3002<\/p>\n\n\n\n<p>\u5728\u6bcf\u4e2a\u5c0f\u65f6\u7684\u7b2c55\u5206\uff0c\u6bcf\u4e2a\u6b66\u58eb\u62a5\u544a\u5176\u62e5\u6709\u7684\u6b66\u5668\u60c5\u51b5\u3002<\/p>\n\n\n\n<p>\u6b66\u58eb\u5230\u8fbe\u5bf9\u65b9\u53f8\u4ee4\u90e8\u540e\u5c31\u7b97\u5b8c\u6210\u4efb\u52a1\u4e86\uff0c\u4ece\u6b64\u5c31\u5446\u5728\u90a3\u91cc\u65e0\u6240\u4e8b\u4e8b\u3002<\/p>\n\n\n\n<p>\u4efb\u4f55\u4e00\u65b9\u7684\u53f8\u4ee4\u90e8\u91cc\u82e5\u662f\u51fa\u73b0\u4e86\u654c\u4eba\uff0c\u5219\u8ba4\u4e3a\u8be5\u53f8\u4ee4\u90e8\u5df2\u88ab\u654c\u4eba\u5360\u9886\u3002<\/p>\n\n\n\n<p>\u4efb\u4f55\u4e00\u65b9\u7684\u53f8\u4ee4\u90e8\u88ab\u654c\u4eba\u5360\u9886\uff0c\u5219\u6218\u4e89\u7ed3\u675f\u3002\u6218\u4e89\u7ed3\u675f\u4e4b\u540e\u5c31\u4e0d\u4f1a\u53d1\u751f\u4efb\u4f55\u4e8b\u60c5\u4e86\u3002<\/p>\n\n\n\n<p>\u7ed9\u5b9a\u4e00\u4e2a\u65f6\u95f4\uff0c\u8981\u6c42\u4f60\u5c06\u4ece0\u70b90\u5206\u5f00\u59cb\u5230\u6b64\u65f6\u95f4\u4e3a\u6b62\u7684\u6240\u6709\u4e8b\u4ef6\u6309\u987a\u5e8f\u8f93\u51fa\u3002\u4e8b\u4ef6\u53ca\u5176\u5bf9\u5e94\u7684\u8f93\u51fa\u6837\u4f8b\u5982\u4e0b\uff1a<\/p>\n\n\n\n<p>1)&nbsp;\u6b66\u58eb\u964d\u751f<\/p>\n\n\n\n<p>\u8f93\u51fa\u6837\u4f8b\uff1a000:00 blue dragon 1 born<\/p>\n\n\n\n<p>\u8868\u793a\u57280\u70b90\u5206\uff0c\u7f16\u53f7\u4e3a1\u7684\u84dd\u9b54dragon\u6b66\u58eb\u964d\u751f<\/p>\n\n\n\n<p>\u5982\u679c\u9020\u51fa\u7684\u662flion\uff0c\u90a3\u4e48\u8fd8\u8981\u591a\u8f93\u51fa\u4e00\u884c\uff0c\u4f8b:<\/p>\n\n\n\n<p>000:00 blue lion 1 born<\/p>\n\n\n\n<p>Its loyalty is 24<\/p>\n\n\n\n<p>\u8868\u793a\u8be5lion\u964d\u751f\u65f6\u7684\u5fe0\u8bda\u5ea6\u662f24<\/p>\n\n\n\n<p>2) lion\u9003\u8dd1<\/p>\n\n\n\n<p>\u8f93\u51fa\u6837\u4f8b\uff1a000:05 blue lion 1 ran away<\/p>\n\n\n\n<p>\u8868\u793a\u57280\u70b95\u5206\uff0c\u7f16\u53f7\u4e3a1\u7684\u84dd\u9b54lion\u6b66\u58eb\u9003\u8d70<\/p>\n\n\n\n<p>3)&nbsp;\u6b66\u58eb\u524d\u8fdb\u5230\u67d0\u4e00\u57ce\u5e02<\/p>\n\n\n\n<p>\u8f93\u51fa\u6837\u4f8b\uff1a<\/p>\n\n\n\n<p>000:10 red iceman 1 marched to city 1 with 20 elements and force 30<\/p>\n\n\n\n<p>\u8868\u793a\u57280\u70b910\u5206\uff0c\u7ea2\u9b541\u53f7\u6b66\u58ebiceman\u524d\u8fdb\u52301\u53f7\u57ce\u5e02\uff0c\u6b64\u65f6\u4ed6\u751f\u547d\u503c\u4e3a20,\u653b\u51fb\u529b\u4e3a30<\/p>\n\n\n\n<p>\u5bf9\u4e8eiceman,\u8f93\u51fa\u7684\u751f\u547d\u503c\u5e94\u8be5\u662f\u53d8\u5316\u540e\u7684\u6570\u503c<\/p>\n\n\n\n<p>4) wolf\u62a2\u654c\u4eba\u7684\u6b66\u5668<\/p>\n\n\n\n<p>000:35 blue wolf 2 took 3 bomb from red dragon 2 in city 4<\/p>\n\n\n\n<p>\u8868\u793a\u57280\u70b935\u5206\uff0c4\u53f7\u57ce\u5e02\u4e2d\uff0c\u7ea2\u9b541\u53f7\u6b66\u58ebwolf&nbsp;\u62a2\u8d70\u84dd\u9b542\u53f7\u6b66\u58ebdragon 3\u4e2abomb\u3002\u4e3a\u7b80\u5355\u8d77\u89c1\uff0c\u6b66\u5668\u4e0d\u5199\u590d\u6570\u5f62\u5f0f<\/p>\n\n\n\n<p>5)&nbsp;\u62a5\u544a\u6218\u6597\u60c5\u51b5<\/p>\n\n\n\n<p>\u6218\u6597\u53ea\u67093\u79cd\u53ef\u80fd\u7684\u8f93\u51fa\u7ed3\u679c\uff1a<\/p>\n\n\n\n<p>000:40 red iceman 1 killed blue lion 12 in city 2 remaining 20 elements<\/p>\n\n\n\n<p>\u8868\u793a\u57280\u70b940\u5206\uff0c1\u53f7\u57ce\u5e02\u4e2d\uff0c\u7ea2\u9b541\u53f7\u6b66\u58ebiceman&nbsp;\u6740\u6b7b\u84dd\u9b5412\u53f7\u6b66\u58eblion\u540e\uff0c\u5269\u4e0b\u751f\u547d\u503c20<\/p>\n\n\n\n<p>000:40 both red iceman 1 and blue lion 12 died in city 2<\/p>\n\n\n\n<p>\u6ce8\u610f\uff0c\u628a\u7ea2\u6b66\u58eb\u5199\u524d\u9762<\/p>\n\n\n\n<p>000:40&nbsp;both red iceman 1 and blue lion 12 were alive in city 2<\/p>\n\n\n\n<p>\u6ce8\u610f\uff0c\u628a\u7ea2\u6b66\u58eb\u5199\u524d\u9762<\/p>\n\n\n\n<p>6)&nbsp;\u6b66\u58eb\u6b22\u547c<\/p>\n\n\n\n<p>\u8f93\u51fa\u6837\u4f8b\uff1a003:40 blue dragon 2 yelled in city 4<\/p>\n\n\n\n<p>7)&nbsp;\u6b66\u58eb\u62b5\u8fbe\u654c\u519b\u53f8\u4ee4\u90e8<\/p>\n\n\n\n<p>\u8f93\u51fa\u6837\u4f8b\uff1a001:10 red iceman 1 reached blue headquarter with 20 elements and force 30<\/p>\n\n\n\n<p>\uff08\u6b64\u65f6\u4ed6\u751f\u547d\u503c\u4e3a20,\u653b\u51fb\u529b\u4e3a30\uff09\u5bf9\u4e8eiceman,\u8f93\u51fa\u7684\u751f\u547d\u503c\u548c\u653b\u51fb\u529b\u5e94\u8be5\u662f\u53d8\u5316\u540e\u7684\u6570\u503c<\/p>\n\n\n\n<p>8)&nbsp;\u53f8\u4ee4\u90e8\u88ab\u5360\u9886<\/p>\n\n\n\n<p>\u8f93\u51fa\u6837\u4f8b\uff1a003:10 blue headquarter was taken<\/p>\n\n\n\n<p>9)\u53f8\u4ee4\u90e8\u62a5\u544a\u751f\u547d\u5143\u6570\u91cf<\/p>\n\n\n\n<p>000:50 100 elements in red headquarter<\/p>\n\n\n\n<p>000:50 120 elements in blue headquarter<\/p>\n\n\n\n<p>\u8868\u793a\u57280\u70b950\u5206\uff0c\u7ea2\u65b9\u53f8\u4ee4\u90e8\u6709100\u4e2a\u751f\u547d\u5143\uff0c\u84dd\u65b9\u6709120\u4e2a<\/p>\n\n\n\n<p>10)\u6b66\u58eb\u62a5\u544a\u60c5\u51b5<\/p>\n\n\n\n<p>000:55 blue wolf 2 has 2 sword 3 bomb 0 arrow and 7 elements<\/p>\n\n\n\n<p>\u4e3a\u7b80\u5355\u8d77\u89c1\uff0c\u6b66\u5668\u90fd\u4e0d\u5199\u590d\u6570\u5f62\u5f0f\u3002elements\u4e00\u5f8b\u5199\u590d\u6570\uff0c\u54ea\u6015\u53ea\u67091\u4e2a<\/p>\n\n\n\n<p>\u4ea4\u4ee3\u6b66\u5668\u60c5\u51b5\u65f6\uff0c\u6b21\u5e8f\u4f9d\u6b21\u662f\uff1asword,bomb, arrow\u3002<\/p>\n\n\n\n<p>\u8f93\u51fa\u4e8b\u4ef6\u65f6\uff1a<\/p>\n\n\n\n<p>\u9996\u5148\u6309\u65f6\u95f4\u987a\u5e8f\u8f93\u51fa\uff1b<\/p>\n\n\n\n<p>\u540c\u4e00\u65f6\u95f4\u53d1\u751f\u7684\u4e8b\u4ef6\uff0c\u6309\u53d1\u751f\u5730\u70b9\u4ece\u897f\u5411\u4e1c\u4f9d\u6b21\u8f93\u51fa.&nbsp;\u6b66\u58eb\u524d\u8fdb\u7684\u4e8b\u4ef6,&nbsp;\u7b97\u662f\u53d1\u751f\u5728\u76ee\u7684\u5730\u3002<\/p>\n\n\n\n<p>\u5728\u4e00\u6b21\u6218\u6597\u4e2d\u6709\u53ef\u80fd\u53d1\u751f\u4e0a\u9762\u7684&nbsp;5&nbsp;\u81f3&nbsp;6&nbsp;\u53f7\u4e8b\u4ef6\u3002\u8fd9\u4e9b\u4e8b\u4ef6\u90fd\u7b97\u540c\u65f6\u53d1\u751f\uff0c\u5176\u65f6\u95f4\u5c31\u662f\u6218\u6597\u5f00\u59cb\u65f6\u95f4\u3002\u4e00\u6b21\u6218\u6597\u4e2d\u7684\u8fd9\u4e9b\u4e8b\u4ef6\uff0c\u5e8f\u53f7\u5c0f\u7684\u5e94\u8be5\u5148\u8f93\u51fa\u3002<\/p>\n\n\n\n<p>\u4e24\u4e2a\u6b66\u58eb\u540c\u65f6\u62b5\u8fbe\u540c\u4e00\u57ce\u5e02\uff0c\u5219\u5148\u8f93\u51fa\u7ea2\u6b66\u58eb\u7684\u524d\u8fdb\u4e8b\u4ef6\uff0c\u540e\u8f93\u51fa\u84dd\u6b66\u58eb\u7684\u3002<\/p>\n\n\n\n<p>\u5bf9\u4e8e\u540c\u4e00\u57ce\u5e02\uff0c\u540c\u4e00\u65f6\u95f4\u53d1\u751f\u7684\u4e8b\u60c5\uff0c\u5148\u8f93\u51fa\u7ea2\u65b9\u7684\uff0c\u540e\u8f93\u51fa\u84dd\u65b9\u7684\u3002<\/p>\n\n\n\n<p>\u663e\u7136\uff0c8\u53f7\u4e8b\u4ef6\u53d1\u751f\u4e4b\u524d\u7684\u4e00\u77ac\u95f4\u4e00\u5b9a\u53d1\u751f\u4e867\u53f7\u4e8b\u4ef6\u3002\u8f93\u51fa\u65f6\uff0c\u8fd9\u4e24\u4ef6\u4e8b\u7b97\u540c\u4e00\u65f6\u95f4\u53d1\u751f\uff0c\u4f46\u662f\u5e94\u5148\u8f93\u51fa7\u53f7\u4e8b\u4ef6<\/p>\n\n\n\n<p>\u867d\u7136\u4efb\u4f55\u4e00\u65b9\u7684\u53f8\u4ee4\u90e8\u88ab\u5360\u9886\u4e4b\u540e\uff0c\u5c31\u4e0d\u4f1a\u6709\u4efb\u4f55\u4e8b\u60c5\u53d1\u751f\u4e86\u3002\u4f46\u548c\u53f8\u4ee4\u90e8\u88ab\u5360\u9886\u540c\u65f6\u53d1\u751f\u7684\u4e8b\u4ef6\uff0c\u5168\u90fd\u8981\u8f93\u51fa\u3002<\/p>\n\n\n\n<p>\u8f93\u5165<\/p>\n\n\n\n<p>\u7b2c\u4e00\u884c\u662ft,\u4ee3\u8868\u6d4b\u8bd5\u6570\u636e\u7ec4\u6570<\/p>\n\n\n\n<p>\u6bcf\u7ec4\u6837\u4f8b\u5171\u4e09\u884c\u3002<\/p>\n\n\n\n<p>\u7b2c\u4e00\u884c\uff0c4\u4e2a\u6574\u6570 M,N,K, T\u3002\u5176\u542b\u4e49\u4e3a\uff1a<br>\u6bcf\u4e2a\u53f8\u4ee4\u90e8\u4e00\u5f00\u59cb\u90fd\u6709M\u4e2a\u751f\u547d\u5143( 1 &lt;= M &lt;= 100000)<br>\u4e24\u4e2a\u53f8\u4ee4\u90e8\u4e4b\u95f4\u4e00\u5171\u6709N\u4e2a\u57ce\u5e02( 1 &lt;= N &lt;= 20 )<br>lion\u6bcf\u524d\u8fdb\u4e00\u6b65\uff0c\u5fe0\u8bda\u5ea6\u5c31\u964d\u4f4eK\u3002(0&lt;=K&lt;=100)<br>\u8981\u6c42\u8f93\u51fa\u4ece0\u65f60\u5206\u5f00\u59cb\uff0c\u5230\u65f6\u95f4T\u4e3a\u6b62(\u5305\u62ecT) \u7684\u6240\u6709\u4e8b\u4ef6\u3002T\u4ee5\u5206\u949f\u4e3a\u5355\u4f4d\uff0c0 &lt;= T &lt;= 6000<\/p>\n\n\n\n<p>\u7b2c\u4e8c\u884c\uff1a\u4e94\u4e2a\u6574\u6570\uff0c\u4f9d\u6b21\u662f dragon \u3001ninja\u3001iceman\u3001lion\u3001wolf \u7684\u521d\u59cb\u751f\u547d\u503c\u3002\u5b83\u4eec\u90fd\u5927\u4e8e0\u5c0f\u4e8e\u7b49\u4e8e200<\/p>\n\n\n\n<p>\u7b2c\u4e09\u884c\uff1a\u4e94\u4e2a\u6574\u6570\uff0c\u4f9d\u6b21\u662f dragon \u3001ninja\u3001iceman\u3001lion\u3001wolf \u7684\u653b\u51fb\u529b\u3002\u5b83\u4eec\u90fd\u5927\u4e8e0\u5c0f\u4e8e\u7b49\u4e8e200<\/p>\n\n\n\n<p>\u8f93\u51fa<\/p>\n\n\n\n<p>\u5bf9\u6bcf\u7ec4\u6570\u636e\uff0c\u5148\u8f93\u51fa\u4e00\u884c\uff1a<\/p>\n\n\n\n<p>Case n:<\/p>\n\n\n\n<p>\u5982\u5bf9\u7b2c\u4e00\u7ec4\u6570\u636e\u5c31\u8f93\u51fa Case 1:<\/p>\n\n\n\n<p>\u7136\u540e\u6309\u6070\u5f53\u7684\u987a\u5e8f\u548c\u683c\u5f0f\u8f93\u51fa\u5230\u65f6\u95f4T\u4e3a\u6b62\u53d1\u751f\u7684\u6240\u6709\u4e8b\u4ef6\u3002\u6bcf\u4e2a\u4e8b\u4ef6\u90fd\u4ee5\u4e8b\u4ef6\u53d1\u751f\u7684\u65f6\u95f4\u5f00\u5934\uff0c\u65f6\u95f4\u683c\u5f0f\u662f\u201c\u65f6: \u5206\u201d\uff0c\u201c\u65f6\u201d\u6709\u4e09\u4f4d\uff0c\u201c\u5206\u201d\u6709\u4e24\u4f4d\u3002<\/p>\n\n\n\n<p>\u6837\u4f8b\u8f93\u5165<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">1\n20 1 10 400\n20 20 30 10 20\n5 5 5 5 5<\/pre>\n\n\n\n<p>\u6837\u4f8b\u8f93\u51fa<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Case 1:\n000:00 blue lion 1 born\nIts loyalty is 10\n000:10 blue lion 1 marched to city 1 with 10 elements and force 5\n000:50 20 elements in red headquarter\n000:50 10 elements in blue headquarter\n000:55 blue lion 1 has 0 sword 1 bomb 0 arrow and 10 elements\n001:05 blue lion 1 ran away\n001:50 20 elements in red headquarter\n001:50 10 elements in blue headquarter\n002:50 20 elements in red headquarter\n002:50 10 elements in blue headquarter\n003:50 20 elements in red headquarter\n003:50 10 elements in blue headquarter\n004:50 20 elements in red headquarter\n004:50 10 elements in blue headquarter\n005:50 20 elements in red headquarter\n005:50 10 elements in blue headquarter\n<\/pre>\n\n\n\n<p>\u63d0\u793a<\/p>\n\n\n\n<p>\u8bf7\u6ce8\u610f\u6d6e\u70b9\u6570\u7cbe\u5ea6\u8bef\u5dee\u95ee\u9898\u3002OJ\u4e0a\u7684\u7f16\u8bd1\u5668\u7f16\u8bd1\u51fa\u6765\u7684\u53ef\u6267\u884c\u7a0b\u5e8f\uff0c\u5728\u8fd9\u65b9\u9762\u548c\u4f60\u7535\u8111\u4e0a\u6267\u884c\u7684\u7a0b\u5e8f\u5f88\u53ef\u80fd\u4f1a\u4e0d\u4e00\u81f4\u30025 * 0.3 \u7684\u7ed3\u679c\uff0c\u6709\u7684\u673a\u5668\u4e0a\u53ef\u80fd\u662f 15.00000001\uff0c\u53bb\u5c3e\u53d6\u6574\u5f97\u523015,\u6709\u7684\u673a\u5668\u4e0a\u53ef\u80fd\u662f14.9999999\uff0c\u53bb\u5c3e\u53d6\u6574\u540e\u5c31\u53d8\u621014\u3002\u56e0\u6b64,\u672c\u9898\u4e0d\u8981\u5199 5 * 0.3\uff0c\u8981\u5199 5 * 3 \/ 10\u3002<\/p>\n\n\n\n<p>\u6765\u6e90Guo Wei<\/p>\n\n\n\n<p class=\"has-text-align-center\"> <\/p>\n\n\n\n<div class=\"wp-block-group\"><div class=\"wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow\">\n<hr class=\"wp-block-separator is-style-wide\"\/>\n<\/div><\/div>\n\n\n\n<p class=\"has-text-align-center\"> <\/p>\n\n\n\n<p>\u554a\u554a\u554a\u5199\u4e86\u4e00\u5929\u7ec8\u4e8eA\u4e86\uff0c\u611f\u89c9\u8bed\u6587\u9605\u8bfb\u7406\u89e3\u9898\uff0c\u8bfb\u9898\u4e00\u5c0f\u65f6\uff0c\u8fd8\u8d85\u591a\u7ec6\u8282<br>\u7b80\u5355\u8bf4\u51e0\u4e2a\u5751\u70b9<br>1. \u7b2c40\u5206\u949fyell\u662f\u5728\u5f53\u573a\u6218\u6597\u4e4b\u540e\u7d27\u63a5\u7740\u8f93\u51fa\uff0c\u5373\u5bf9\u6bcf\u4e00\u4e2acity\u8f93\u51fa\u6218\u4e89\u7ed3\u679c\u5e76\u8f93\u51fayell\uff0c\u518d\u7ee7\u7eed\u5224\u65ad\u4e0b\u4e00\u4e2acity<br>2. \u53cc\u65b9\u6b66\u58eb\u7684\u6b66\u5668\u90fd\u6ca1\u6709\u653b\u51fb\u529b\u65f6\u9700\u8981\u628abomb\uff0carrow\u6d88\u8017\u6389\u518d\u505c\u6b62<br>3. \u9898\u76ee\u63cf\u8ff0\u4f3c\u4e4e\u548c\u201c\u9b54\u517d2\u201d\u6709\u4e86\u7565\u5fae\u53d8\u52a8\uff0c\u6bd4\u5982\u6b66\u58eb\u7279\u70b9\uff0c\u6bd4\u5982\u505c\u6b62\u5236\u9020\u6b66\u58eb\u6761\u4ef6\uff0c\u6bd4\u5982\u8f93\u51faCase n:\u548cIts\uff08\u4e0d\u662f\u9b54\u517d2\u4e2d\u7684It&#8217;s\uff09<br>4. \u6d89\u53ca\u7f13\u5b58\u6570\u636e\u7684\uff0c\u5efa\u8bae\u591a\u66f4\u65b0\u51e0\u6b21\uff08\u53cd\u6b63\u65f6\u9650\u591f\u7528\uff08x<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#include&lt;map>\n#include&lt;cmath>\n#include&lt;queue>\n#include&lt;cstdio>\n#include&lt;string>\n#include&lt;vector>\n#include&lt;cstring>\n#include&lt;iostream>\n#include&lt;algorithm>\nusing namespace std;\n#define inf 1000000007\n#define ll long long\n#define N 100010\n#define db double\ninline int rd()\n{\n\tint x=0,f=1;char ch=getchar();\n\twhile(ch&lt;'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}\n\twhile(ch>='0'&amp;&amp;ch&lt;='9'){x=x*10+ch-'0';ch=getchar();}\n\treturn x*f;\n}\nchar name[5][10]={\"dragon\",\"ninja\",\"iceman\",\"lion\",\"wolf\"};\nchar wp_name[3][6]={\"sword\",\"bomb\",\"arrow\"};\nint ord[2][5]={{2,3,4,1,0},{3,0,1,2,4}};\nint Case,M,v[10],n,k,T,w[10];\nint Tim,s[2][10];\nclass weapons{\n\tint id;\n\tint rem;\npublic:\n\tvoid Init(int _id){\n\t\tid=_id;\n\t\trem=(_id==1?1:2);\n\t}\n\tfriend bool operator ==(const weapons &amp;a,const weapons &amp;b){return a.id==b.id;}\n\tfriend class warriors;\n\tvoid del(){id=999;}\n\tchar* getname(){return wp_name[id];}\n\tfriend bool cmp1(const weapons &amp;a,const weapons &amp;b);\n\tfriend bool cmp2(const weapons &amp;a,const weapons &amp;b);\n};\nbool cmp1(const weapons &amp;a,const weapons &amp;b){\n\tif(a.id==b.id) return a.rem>b.rem;\n\treturn a.id&lt;b.id;\n}\nbool cmp2(const weapons &amp;a,const weapons &amp;b){\n\tif(a.id==b.id) return a.rem&lt;b.rem;\n\treturn a.id&lt;b.id;\n}\nclass warriors{\n\t#define COL (color?\"blue\":\"red\")\n\t#define COL_T (color?\"red\":\"blue\")\n\t#define WP weapons\n\tint ID; \/\/realID\n\tint id,hp;\/\/nameID\n\tint loyalty,atk;\n\tbool color;\n\tint city;\n\tdb morale;\npublic:\n\tWP wp[11];\n\tint wp_num;\n\tqueue&lt;WP>wp_Q;\n\twarriors(){}\n\twarriors(int _ID,int _id,bool _col,int rm):ID(_ID),id(_id),color(_col){\n\t\twp_num=0;loyalty=0;morale=0;hp=v[_id];atk=w[_id];\n\t\tcity=_col?n+1:0;\n\t\tswitch(_id){\n\t\tcase 0:\n\t\t\twp_num=1;\n\t\t\twp[0].Init(_ID%3);\n\t\t\t\/\/morale=rm*1.0\/hp;\n\t\t\t\/\/printf(\"It has a %s,and it's morale is %.2lf\\n\",wp_name[wp[0].id],morale);\n\t\t\tbreak;\n\t\tcase 1:\n\t\t\twp_num=2;\n\t\t\twp[0].Init(_ID%3);wp[1].Init((_ID+1)%3);\n\t\t\t\/\/printf(\"It has a %s and a %s\\n\",wp_name[wp[0].id],wp_name[wp[1].id]);\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\twp_num=1;\n\t\t\twp[0].Init(_ID%3);\n\t\t\t\/\/printf(\"It has a %s\\n\",wp_name[wp[0].id]);\n\t\t\tbreak;\n\t\tcase 3:\n\t\t\twp_num=1;\n\t\t\twp[0].Init(_ID%3);\n\t\t\tloyalty=rm;\n\t\t\tprintf(\"Its loyalty is %d\\n\",rm);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\t}\n\tvoid upd(int x){city=x;}\n\tint getID(){return ID;}\n\tchar* getname(){return name[id];}\n\tint getHP(){return hp;}\n\tbool runaway(){\n\t\tif(id==3&amp;&amp;loyalty&lt;=0){\n\t\t\tprintf(\"%03d:05 %s lion %d ran away\\n\",Tim,COL,ID);\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\tbool move(){\n\t\tif(id==2) hp-=hp\/10;\n\t\tif(!color){\n\t\t\tif(city==n+1){\n\t\t\t\tprintf(\"%03d:10 %s %s %d reached %s headquarter with %d elements and force %d\\n\",Tim,COL,name[id],ID,COL_T,hp,atk);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\t\/\/++city;\n\t\t\tprintf(\"%03d:10 %s %s %d marched to city %d with %d elements and force %d\\n\",Tim,COL,name[id],ID,city,hp,atk);\n\t\t\tif(id==3) loyalty-=k;\n\t\t\treturn false;\n\t\t}else{\n\t\t\tif(!city){\n\t\t\t\tprintf(\"%03d:10 %s %s %d reached %s headquarter with %d elements and force %d\\n\",Tim,COL,name[id],ID,COL_T,hp,atk);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\t\/\/--city;\n\t\t\tprintf(\"%03d:10 %s %s %d marched to city %d with %d elements and force %d\\n\",Tim,COL,name[id],ID,city,hp,atk);\n\t\t\tif(id==3) loyalty-=k;\n\t\t\treturn false;\n\t\t}\n\t}\n\tbool is_wolf(){return id==4;}\n\tbool is_dragon(){return id==0;}\n\tvoid sort1(){\n\t\tsort(wp,wp+wp_num,cmp1);\n\t}\n\tvoid sort2(){\n\t\tsort(wp,wp+wp_num,cmp2);\n\t\twhile(!wp_Q.empty()) wp_Q.pop();\n\t\tfor(int i=0;i&lt;wp_num;++i) wp_Q.push(wp[i]);\n\t}\n\tbool is_dead(){return hp&lt;=0;}\n\tbool fight(warriors &amp;b){\n\t\tif(wp_Q.empty()) return false;\n\t\tWP tmp=wp_Q.front();wp_Q.pop();\n\t\tswitch(tmp.id){\n\t\tcase 0:\/\/sword\n\t\t\tb.hp-=atk*2\/10;\n\t\t\tbreak;\n\t\tcase 1:\/\/bomb\n\t\t\tb.hp-=atk*4\/10;\n\t\t\tif(id^1) hp-=(atk*4\/10)\/2;\n\t\t\ttmp.rem=0;\n\t\t\tbreak;\n\t\tcase 2:\/\/arrow\n\t\t\tb.hp-=atk*3\/10;\n\t\t\t--tmp.rem;\n\t\t\tbreak;\n\t\tdefault:break;\n\t\t}\n\t\tif(tmp.rem) wp_Q.push(tmp);\n\t\treturn (hp&lt;=0)||(b.hp&lt;=0);\n\t}\n\tbool unchanged(){\n\t\tqueue&lt;WP>tQ;tQ=wp_Q;\n\t\tWP tmp;\n\t\twhile(!tQ.empty()){\n\t\t\ttmp=tQ.front();tQ.pop();\n\t\t\tif(tmp.id>0||atk*2\/10) return false;\n\t\t}\n\t\treturn true;\n\t}\n\tvoid upd_wp(){\n\t\twp_num=0;\n\t\twhile(!wp_Q.empty()){\n\t\t\twp[wp_num++]=wp_Q.front();\n\t\t\twp_Q.pop();\n\t\t}\n\t}\n\tvoid pick_wp(warriors &amp;b){\n\t\tb.sort1();\n\t\tint tp=0;\n\t\twhile(tp&lt;b.wp_num&amp;&amp;wp_num&lt;10)\n\t\t\twp[wp_num++]=b.wp[tp++];\n\t}\n\tvoid report(){\n\t\tint t1=0,t2=0,t3=0;\n\t\tfor(int i=0;i&lt;wp_num;++i){\n\t\t\tif(wp[i].id==0) ++t1;\n\t\t\telse if(wp[i].id==1) ++t2;\n\t\t\telse ++t3;\n\t\t}\n\t\tprintf(\"%s %d has %d sword %d bomb %d arrow and %d elements\\n\",name[id],ID,t1,t2,t3,hp);\n\t}\n};\nclass citys{\nprotected:\n\tint id;\n\twarriors wr[2],tp_wr[2];\n\tbool R,B,tR,tB;\npublic:\n\tvoid Init(int _id){id=_id;tR=R=tB=B=0;}\n\tbool update(){\n\t\tR=tR;B=tB;\n\t\tbool tp=0;\n\t\tif(R){\n\t\t\twr[0]=tp_wr[0];\n\t\t\twr[0].upd(id);\n\t\t\ttp|=wr[0].move();\n\t\t}\n\t\tif(B){\n\t\t\twr[1]=tp_wr[1];\n\t\t\twr[1].upd(id);\n\t\t\ttp|=wr[1].move();\n\t\t}\n\t\ttR=tB=0;\n\t\treturn tp;\n\t}\n\tvoid ck_lion(){\n\t\tif(R&amp;&amp;wr[0].runaway()) R=0;\n\t\tif(B&amp;&amp;wr[1].runaway()) B=0;\n\t}\n\tvoid move_upd(const warriors &amp;a,bool col){\n\t\tif(col) tp_wr[1]=a,tB=1;\n\t\telse tp_wr[0]=a,tR=1;\n\t}\n\tfriend void move(const citys &amp;a,int id);\n\tvoid rob(){\n\t\tif(R&amp;&amp;wr[0].is_wolf()){\n\t\t\tif(!B||wr[1].is_wolf()||!wr[1].wp_num) return;\n\t\t\twr[1].sort1();\n\t\t\tint tp=0;\n\t\t\twhile(tp&lt;wr[1].wp_num&amp;&amp;wr[0].wp_num&lt;10&amp;&amp;wr[1].wp[tp]==wr[1].wp[0])\n\t\t\t\twr[0].wp[wr[0].wp_num++]=wr[1].wp[tp++];\n\t\t\tprintf(\"%03d:35 red wolf %d took %d %s from blue %s %d in city %d\\n\",Tim,wr[0].getID(),tp,wr[1].wp[0].getname(),wr[1].getname(),wr[1].getID(),id);\n\t\t\tfor(int i=0;i&lt;tp;++i) wr[1].wp[i].del();\n\t\t\twr[1].sort1();\n\t\t\twr[1].wp_num-=tp;\n\t\t}\n\t\tif(B&amp;&amp;wr[1].is_wolf()){\n\t\t\tif(!R||wr[0].is_wolf()||!wr[0].wp_num) return;\n\t\t\twr[0].sort1();\n\t\t\tint tp=0;\n\t\t\twhile(tp&lt;wr[0].wp_num&amp;&amp;wr[1].wp_num&lt;10&amp;&amp;wr[0].wp[tp]==wr[0].wp[0])\n\t\t\t\twr[1].wp[wr[1].wp_num++]=wr[0].wp[tp++];\n\t\t\tprintf(\"%03d:35 blue wolf %d took %d %s from red %s %d in city %d\\n\",Tim,wr[1].getID(),tp,wr[0].wp[0].getname(),wr[0].getname(),wr[0].getID(),id);\n\t\t\tfor(int i=0;i&lt;tp;++i) wr[0].wp[i].del();\n\t\t\twr[0].sort1();\n\t\t\twr[0].wp_num-=tp;\n\t\t}\n\t}\n\tvoid fight(){\n\t\tif(!R||!B) return;\n\t\tif(id&amp;1) swap(wr[1],wr[0]);\n\t\twr[0].sort2();wr[1].sort2();\n\t\twhile(true){\n\t\t\tif(wr[0].wp_Q.empty()&amp;&amp;wr[1].wp_Q.empty()) break;\n\t\t\tif(wr[1].fight(wr[0])) break;\n\t\t\tif(wr[0].fight(wr[1])) break;\n\t\t\tif(wr[0].unchanged()&amp;&amp;wr[1].unchanged()) break;\n\t\t}\n\t\tif(id&amp;1) swap(wr[1],wr[0]);\n\t\twr[0].upd_wp();wr[1].upd_wp();\n\t\tif(wr[0].is_dead()) R=0;\n\t\tif(wr[1].is_dead()) B=0;\n\t\tif(R&amp;&amp;!B){\n\t\t\tprintf(\"%03d:40 red %s %d killed blue %s %d in city %d remaining %d elements\\n\",Tim,wr[0].getname(),wr[0].getID(),wr[1].getname(),wr[1].getID(),id,wr[0].getHP());\n\t\t\twr[0].pick_wp(wr[1]);\n\t\t}else if(!R&amp;&amp;B){\n\t\t\tprintf(\"%03d:40 blue %s %d killed red %s %d in city %d remaining %d elements\\n\",Tim,wr[1].getname(),wr[1].getID(),wr[0].getname(),wr[0].getID(),id,wr[1].getHP());\n\t\t\twr[1].pick_wp(wr[0]);\n\t\t}else if(R&amp;&amp;B){\n\t\t\tprintf(\"%03d:40 both red %s %d and blue %s %d were alive in city %d\\n\",Tim,wr[0].getname(),wr[0].getID(),wr[1].getname(),wr[1].getID(),id);\n\t\t}else{\n\t\t\tprintf(\"%03d:40 both red %s %d and blue %s %d died in city %d\\n\",Tim,wr[0].getname(),wr[0].getID(),wr[1].getname(),wr[1].getID(),id);\n\t\t}\n\t\tif(R&amp;&amp;wr[0].is_dragon()) printf(\"%03d:40 red dragon %d yelled in city %d\\n\",Tim,wr[0].getID(),id);\n\t\tif(B&amp;&amp;wr[1].is_dragon()) printf(\"%03d:40 blue dragon %d yelled in city %d\\n\",Tim,wr[1].getID(),id);\n\t}\n\tvoid report(){\n\t\tif(R) printf(\"%03d:55 red \",Tim),wr[0].report();\n\t\tif(B) printf(\"%03d:55 blue \",Tim),wr[1].report();\n\t}\n}C[22];\nvoid move(const citys &amp;a,int id){\n\tif(a.R) C[id+1].move_upd(a.wr[0],0);\n\tif(a.B) C[id-1].move_upd(a.wr[1],1);\n}\nclass qaz:public citys{\n\tbool avl;\n\tchar nam[5];\n\tint ID,rem_hp;\n\tint tp,wr_sz[5],tot;\n\t\/\/vector&lt;warriors>wrs;\npublic:\n\tqaz(int M,const char *s,int _id){\n\t\tInit(_id?n+1:0);\n\t\trem_hp=M;avl=1;tot=tp=0;ID=_id;\n\t\tmemcpy(nam,s,5);\n\t\tmemset(wr_sz,0,sizeof(wr_sz));\n\t}\n\tbool if_avl(){return avl;}\n\tvoid ck(){\n\t\tR=B=0;\n\t\t\/\/for(int i=0;i&lt;5;i++){\n\t\t\tint i=0;\n\t\t\tif(v[ord[ID][(i+tp)%5]]&lt;=rem_hp){\n\t\t\t\ttp=(i+tp)%5;++wr_sz[tp];++tot;\n\t\t\t\trem_hp-=v[ord[ID][tp]];\n\t\t\t\tprintf(\"%03d:00 %s %s %d born\\n\",Tim,nam,name[ord[ID][tp]],tot);\n\t\t\t\t\/\/printf(\"%d %s in %s headquarter\\n\",wr_sz[tp],name[ord[ID][tp]],nam);\n\t\t\t\twarriors tmp(tot,ord[ID][tp],ID,rem_hp);\n\t\t\t\tif(ID) B=1,wr[1]=tmp;\n\t\t\t\telse R=1,wr[0]=tmp;\n\t\t\t\t++tp;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\/\/}\n\t\t\/\/printf(\"%03d %s headquarter stops making warriors\\n\",Tim,nam);\n\t\tavl=0;\n\t}\n\tvoid report(){\n\t\tprintf(\"%03d:50 %d elements in %s headquarter\\n\",Tim,rem_hp,nam);\n\t}\n};\nvoid Init(){\n\tTim=0;\n}\nvoid work(){\n\tbool End=0;\n\tqaz A(M,\"red\",0);\n\tqaz B(M,\"blue\",1);\n\tfor(int i=1;i&lt;=n;i++) C[i].Init(i);\n\twhile(Tim*60&lt;=T){\n\t\tif(A.if_avl()) A.ck();\n\t\tif(B.if_avl()) B.ck();\n\t\tC[0]=A;C[n+1]=B;\n\t\tif(Tim*60+5&lt;=T)\n\t\t\tfor(int i=0;i&lt;=n+1;++i) C[i].ck_lion();\n\t\tif(Tim*60+10&lt;=T){\n\t\t\tfor(int i=0;i&lt;=n+1;++i) move(C[i],i);\n\t\t\tfor(int i=0;i&lt;=n+1;++i)\n\t\t\t\tif(C[i].update()){\n\t\t\t\t\tif(i) printf(\"%03d:10 blue headquarter was taken\\n\",Tim);\n\t\t\t\t\telse printf(\"%03d:10 red headquarter was taken\\n\",Tim);\n\t\t\t\t\tEnd=1;\n\t\t\t\t}\n\t\t\tif(End) break;\n\t\t}\n\t\tif(Tim*60+35&lt;=T)\n\t\t\tfor(int i=1;i&lt;=n;++i) C[i].rob();\n\t\tif(Tim*60+40&lt;=T)\n\t\t\tfor(int i=1;i&lt;=n;++i) C[i].fight();\n\t\tif(Tim*60+50&lt;=T){\n\t\t\tA.report();\n\t\t\tB.report();\n\t\t}\n\t\tif(Tim*60+55&lt;=T)\n\t\t\tfor(int i=1;i&lt;=n;++i) C[i].report();\n\t\t++Tim;\n\t}\n}\nint main(){\n\tCase=rd();\n\tfor(int _c=1;_c&lt;=Case;_c++){\n\t\tprintf(\"Case %d:\\n\",_c);\n\t\tM=rd();n=rd();k=rd();T=rd();\n\t\tfor(int i=0;i&lt;5;i++) v[i]=rd();\n\t\tfor(int i=0;i&lt;5;i++) w[i]=rd();\n\t\tInit();\n\t\twork();\n\t}\n\treturn 0;\n}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u9b54\u517d\u4e16\u754c\u4e09(\u5f00\u6218) \u603b\u65f6\u95f4\u9650\u5236:&nbsp;2000ms&nbsp;\u5185\u5b58\u9650\u5236:&nbsp;65536kB \u63cf\u8ff0 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[70],"tags":[],"class_list":["post-671","post","type-post","status-publish","format-standard","hentry","category-70"],"_links":{"self":[{"href":"https:\/\/blog.kylelv.com\/index.php?rest_route=\/wp\/v2\/posts\/671","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.kylelv.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.kylelv.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.kylelv.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.kylelv.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=671"}],"version-history":[{"count":5,"href":"https:\/\/blog.kylelv.com\/index.php?rest_route=\/wp\/v2\/posts\/671\/revisions"}],"predecessor-version":[{"id":676,"href":"https:\/\/blog.kylelv.com\/index.php?rest_route=\/wp\/v2\/posts\/671\/revisions\/676"}],"wp:attachment":[{"href":"https:\/\/blog.kylelv.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=671"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.kylelv.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=671"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.kylelv.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=671"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}