{"id":217392,"date":"2020-12-03T08:29:19","date_gmt":"2020-12-03T00:29:19","guid":{"rendered":"http:\/\/4563.org\/?p=217392"},"modified":"2020-12-03T08:29:19","modified_gmt":"2020-12-03T00:29:19","slug":"%e4%bb%8a%e6%99%9a%e4%b8%8a%e7%94%b5%e9%9d%a2%e8%85%be%e8%ae%af%e7%9a%84%e4%b8%80%e9%81%93%e7%ae%97%e6%b3%95%e9%a2%98%e6%b1%82%e8%a7%a3","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=217392","title":{"rendered":"\u4eca\u665a\u4e0a\u7535\u9762\u817e\u8baf\u7684\u4e00\u9053\u7b97\u6cd5\u9898,\u6c42\u89e3"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u4eca\u665a\u4e0a\u7535\u9762\u817e\u8baf\u7684\u4e00\u9053\u7b97\u6cd5\u9898,\u6c42\u89e3               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : dwadewyp <\/span>  <span><i><\/i> 4<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u6709 1000 \u4e2a.txt \u6587\u4ef6\uff0c\u5927\u5c0f\u5747\u4e3a 1G,\u6bcf\u4e2a\u6587\u4ef6\u6bcf\u884c\u4e3a\u4e00\u4e2a\u6d6e\u70b9\u6570; \u8981\u6c42: \u5c06 1000 \u4e2a\u6587\u4ef6\u4e2d\u6240\u6709\u7684\u6d6e\u70b9\u6570\u6309\u4ece\u5c0f\u5230\u5927\u7684\u987a\u5e8f\u6392\u597d\uff0c\u653e\u7f6e\u5728\u4e00\u4e2a\u6587\u4ef6\u4e2d;<\/p>\n<p>\u8bf4\u601d\u8def<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>19<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"4420125\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : murmur <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5982\u679c\u662f utf-8 \u5b57\u7b26\u4e32\u8868\u793a\u7684\u6d6e\u70b9\u6570\uff0c\u90a3\u4e48\u5982\u679c\u5168\u88c5\u8fdb\u5185\u5b58\u6709\u6ca1\u6709\u53ef\u80fd\u52a0\u8d77\u6765\u5c0f\u4e8e 1t\uff0c\u5df2\u77e5\u5e02\u9762\u4e0a\u6bd4\u8f83\u597d\u4e70\u7684\u5185\u5b58\u6700\u5927\u662f\u5355\u6761 128g\uff0c\u8fd9\u6837\u4e00\u53f0 epyc \u6216\u8005\u767d\u91d1\u81f3\u5f3a\u670d\u52a1\u5668\u5e26\u8d77 1t \u5185\u5b58\u5c31\u53ef\u4ee5\u8fdb\u884c\u5185\u5b58\u6392\u5e8f<\/p>\n<p>\u817e\u8baf\u4e48\uff0c\u4e0d\u5dee\u94b1                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4420126\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : liukrystal <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4e2a\u4eba\u63d0\u4f9b\u4e00\u79cd\u601d\u8def\uff0c\u5047\u8bbe\u53ef\u7528\u5185\u5b58\u4e3a 1G\uff0c\u90a3\u5148\u5bf9\u4f9d\u6b21\u5bf9\u6bcf\u4e2a 1G \u6587\u4ef6\u5185\u7684\u6d6e\u70b9\u6570\u8fdb\u884c\u5feb\u6392\uff0c\u8fd9\u6837\u5f97\u5230 1000 \u4e2a\u5df2\u7ecf\u6392\u5e8f\u7684\u5927\u5c0f\u4e3a 1G \u7684\u6587\u4ef6\u3002\u7136\u540e\u4f9d\u6b21\u626b\u63cf\u6bcf\u4e2a\u5df2\u7ecf\u6392\u5e8f\u7684\u6587\u4ef6\uff0c\u6bcf\u4e2a\u6587\u4ef6\u53d6\u51fa 1M \u7684\u5185\u5bb9\uff0c\u8fd9\u6837\u5408\u8d77\u6765\u5927\u6982\u662f 1G\uff0c\u518d\u5bf9\u8fd9\u4e9b\u5185\u5bb9\u8fdb\u884c\u5f52\u5e76\u6392\u5e8f\uff0c\u7ed3\u679c\u5199\u5165\u786c\u76d8\uff0c\u8fd9\u6837\u4f9d\u6b21\u8fdb\u884c\uff0c\u5176\u5b9e\u662f\u4e00\u79cd\u5916\u6392\u5e8f\u7684\u601d\u8def\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4420127\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : jinhao7773 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5148\u5bf9\u6bcf\u4e2a\u6587\u4ef6\u6392\u5e8f\uff0c\u518d\u8bfb\u53d6\u6bcf\u4e2a\u6587\u4ef6\u7684\u7b2c\u4e00\u884c\uff0c\u5bf9\u8fd9 1000 \u4e2a\u6570\u5b57\u8fdb\u884c\u6392\u5e8f\uff0c\u628a\u6700\u5c0f\u7684\u90a3\u4e2a\u6570\u5b57\u8fdb\u884c pop\uff0c\u518d\u7ee7\u7eed\u8bfb\u53d6 pop \u51fa\u6765\u7684\u6570\u5b57\u7684\u90a3\u4e2a\u6587\u4ef6\u4e0b\u4e00\u884c\u653e\u5230\u90a3 1000 \u4e2a\u6570\u5b57\u91cc\uff0c\u7ee7\u7eed pop\uff0c\u5982\u6b64\u5faa\u73af\uff0c\u6bcf\u6b21 pop \u51fa\u6765\u7684\u6570\u5b57\u5199\u5230\u8f93\u51fa\u6587\u4ef6\u91cc\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4420128\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : iConnect <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u8fd9\u4e2a\u95ee\u9898\u7684\u7ed3\u679c\u4f1a\u751f\u6210\u4e00\u4e2a 1T \u7684 .txt \u6587\u4ef6\uff1f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4420129\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : across <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5927\u6982\u60f3\u4e00\u4e0b\uff0c\u5e94\u8be5\u8981\u5148\u4f30\u7b97\u6570\u91cf\u3002<br \/>float 32 \u4f4d\uff0c\u6700\u591a 4294967296(2^32)\u4e2a\u6570\u5b57\uff0c\u5efa\u7acb\u4e00\u4e2a unint32 \u7684\u6570\u7ec4\uff08\u8ba1\u6570\u4e0a\u9650\u4e0d\u80fd\u4f4e\u4e8e 2^32 \uff09\uff0c\u8fd9\u6837\u5185\u5b58\u5360\u7528 4294967296 * 4byte = 16G\uff0c\u8fd9\u6837\u5c31\u4e0d\u7528\u5199\u51fa\u5199\u5165\u4e86\u3002<br \/>\u6bd4\u8f83 float \u65f6\uff0c\u76f4\u63a5\u8fdb\u884c\u4f4d\u6bd4\u8f83\uff0c\u60f3\u7b49\u7684\u8bdd\u5bf9\u5e94\u4f4d\u6570\u5b57++\uff0c\u6700\u540e\u5b8c\u6210\u6392\u5e8f\u540e\u53ef\u4ee5\uff0c\u6309\u5bf9\u5e94\u6570\u5b57\u8f93\u51fa\u4e00\u8fb9\u00b7\u00b7\u00b7\u00b7\u00b7 \u5c31\u597d\u4e86\uff1f \u7ec6\u8282\u5b9e\u73b0\u53ef\u80fd\u6709\u95ee\u9898\uff0cIEEE \u5177\u4f53\u90fd\u5fd8\u4e86\u00b7\u00b7\u00b7                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4420130\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : across <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @across <br \/>\u8fd9\u6837\u95ee\u9898\u53ef\u4ee5\u8f6c\u5316\u6210\uff0c\u5c06\u6240\u6709 float \u6570\u5b57\u6309\u987a\u5e8f\u4e00\u8fb9\u5427\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4420131\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Mohanson <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u770b\u9898\u76ee\u5c31\u662f\u5916\u5f52\u5e76\u4e86\uff0c\u53cd\u6b63\u4e07\u80fd\u7b97\u6cd5\uff1a\u4e0d\u8bba\u5927\u6587\u4ef6\u53bb\u91cd\u8fd8\u662f\u6392\u5e8f\uff0c\u7b54\u6848\u90fd\u662f\u5916\u5f52\u5e76                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4420132\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : lithbitren <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5916\u6392\u5e8f\uff0c\u4e00\u822c\u6807\u7b54\u90fd\u662f\u7eaf\u5f52\u5e76\uff0c\u6587\u4ef6\u6570\u4e0d\u591a\u7684\u60c5\u51b5\u4e0b\u4e5f\u53ef\u4ee5\u4e5f\u53ef\u4ee5\u57fa\u4e8e\u5806\u505a\u5916\u6392\u5e8f\u7684\u5f52\u5e76\uff0c1000 \u8fd8\u662f\u6ca1\u95ee\u9898\u7684\uff0c\u55ef\u5927\u6982\u5c31\u662f 3 \u90a3\u4e2a\u610f\u601d\uff0c\u4e0d\u8fc7\u7528\u5806\u6bd4\u6709\u5e8f\u6570\u7ec4\u66f4\u6b63\u7edf\uff0c3 \u76f8\u5f53\u4e8e\u63d2\u5165\u6392\u5e8f\u4e86\uff0c\u590d\u6742\u5ea6\u8fd8\u662f\u6709\u533a\u522b\u7684\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4420133\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : xupefei <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @jinhao7773 \u4f60\u8fd9\u65b9\u6cd5\u590d\u6742\u5ea6\u7206\u8868\u4e86\uff0c\u56e0\u4e3a\u201c\u5bf9\u8fd9 1000 \u4e2a\u6570\u5b57\u8fdb\u884c\u6392\u5e8f\u201d\u91cd\u590d\u4e86 n\/1000 \u6b21\u3002\u6574\u4f53\u590d\u6742\u5ea6\u662f n^2 \u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4420134\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : wellsc <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u8d31\u6307 offer \u8c8c\u4f3c\u6709\u8fd9\u9898                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4420135\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : fline <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @xupefei \u4f46\u6574\u4f53\u4e0d\u8fd8\u662f nlogn \u4e48\u2026\u2026                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4420136\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : xupefei <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @fline \u5c31\u7b97 1000 \u4e2a\u6587\u4ef6\u662f\u6392\u8fc7\u5e8f\u7684\uff0c\u628a\u4ed6\u4eec merge \u8d77\u6765\u5df2\u7ecf\u662f nlogn \u4e86\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4420137\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : xupefei <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @xupefei \u4ed4\u7ec6\u60f3\u4e86\u60f3\uff0c3L \u5982\u679c\u662f\u7528\u6700\u5c0f\u5806\u8fdb\u884c merge \u7684\u65f6\u5019\uff0c\u6700\u540e\u7684\u590d\u6742\u5ea6\u662f 2*nlogn\uff0c\u7684\u786e\u662f nlogn \u590d\u6742\u5ea6\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4420138\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : binux <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @xupefei \u4f46\u662f\u6bcf\u6b21 pop add \u4e00\u4e2a\u662f\u63d2\u5165\u6392\u5e8f logn \u6574\u4f53\u4f9d\u65e7\u662f nlogn                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4420139\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : yzbythesea <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u8fd9\u4e0d\u662f\u7ecf\u5178\u7684 merge sort \u5417                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4420140\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : raaaaaar <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6628\u5929\u624d\u770b\u7684\u6392\u5e8f\uff0c\u548b\u4eca\u5929\u5c31\u6709\u9898\u4e86\u3002\u5178\u578b\u7684\u5916\u6392\u5e8f\uff0c\u5f52\u5e76\u7b97\u6cd5                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4420141\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : jinhao7773 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @xupefei 1000 \u4e2a\u6570\u5b57\u53ea\u9700\u8981\u521a\u8bfb\u51fa\u6765\u7684\u6392\u4e00\u6b21\u5c31\u884c\uff0c\u540e\u9762 pop \u4e4b\u540e\u4f9d\u7136\u662f\u6709\u5e8f\u7684\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4420142\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : rioshikelong121 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u7ecf\u5178\u7684\u5916\u90e8\u6392\u5e8f\u95ee\u9898\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4420143\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : netnr <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u628a\u6240\u6709\u884c\u5199\u5165\u6570\u636e\u5e93(sqlite \uff09\uff0c\u6392\u5e8f\u5bfc\u51fa\uff0c\u6839\u636e\u5b9e\u9645\u60c5\u51b5\u5206\u6279\u5904\u7406                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u4eca\u665a\u4e0a\u7535\u9762\u817e\u8baf\u7684\u4e00\u9053\u7b97\u6cd5\u9898,\u6c42\u89e3 &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/217392"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=217392"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/217392\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=217392"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=217392"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=217392"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}