{"id":434590,"date":"2021-04-18T17:56:15","date_gmt":"2021-04-18T09:56:15","guid":{"rendered":"http:\/\/4563.org\/?p=434590"},"modified":"2021-04-18T17:56:15","modified_gmt":"2021-04-18T09:56:15","slug":"roblox-%e9%9d%a2%e8%af%95%e9%a2%98%ef%bc%9a%e4%ba%ae%e8%b5%b7%e6%97%b6%e9%97%b4%e6%9c%80%e9%95%bf%e7%9a%84%e7%81%af","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=434590","title":{"rendered":"Roblox \u9762\u8bd5\u9898\uff1a\u4eae\u8d77\u65f6\u95f4\u6700\u957f\u7684\u706f"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  Roblox \u9762\u8bd5\u9898\uff1a\u4eae\u8d77\u65f6\u95f4\u6700\u957f\u7684\u706f               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : zzzrf <\/span>  <span><i><\/i> 5<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<h3>\u63cf\u8ff0<\/h3>\n<p>\u6709\u4e00\u6392 26 \u4e2a\u5f69\u706f\uff0c\u7f16\u53f7\u4ece 0 \u5230 25\uff0c\u73b0\u5728\u7ed9\u51fa\u4e86\u4e00\u7cfb\u5217\u63a7\u5236\u6307\u4ee4\u6765\u63a7\u5236\u8fd9\u4e9b\u5f69\u706f\u7684\u5f00\u5173\u3002<\/p>\n<p><strong>\u4e00\u5f00\u59cb\u8fd9\u4e9b\u5f69\u706f\u90fd\u662f\u5173\u95ed\u7684\uff0c\u7136\u540e\u6307\u4ee4\u5c06\u9010\u6761\u53d1\u51fa\u3002<\/strong> <\/p>\n<p>\u5728\u6bcf\u6761\u6307\u4ee4 operation[i]\u4e2d\u542b\u6709\u4e24\u4e2a\u6574\u6570 operation[i][0], operation[i][1]\u3002<\/p>\n<p>\u5728\u63a5\u6536\u5230\u4e00\u6761\u6307\u4ee4\u65f6\uff0c\u6807\u53f7\u4e3a operation[i][0] \u7684\u5f69\u706f\u4f1a\u4eae\u8d77\uff0c\u76f4\u5230\u7b2c operation[i][1] \u79d2\u7684\u65f6\u5019\u7184\u706d\u3002<\/p>\n<p>\u5f53\u706f\u7184\u706d\u540e\uff0c\u4e0b\u4e00\u6761\u6307\u4ee4\u5c06\u4f1a\u53d1\u51fa\u3002<\/p>\n<p><strong>\u5176\u4e2d\u7b2c\u4e00\u6761\u6307\u4ee4\u5c06\u5728\u7b2c 0 \u79d2\u7684\u65f6\u5019\u53d1\u51fa\uff0c\u5e76\u88ab\u7acb\u523b\u6267\u884c\u3002<\/strong><\/p>\n<p>\u4f60\u7684\u4efb\u52a1\u662f\u627e\u5230\u54ea\u4e2a\u5f69\u706f\u5355\u6b21\u4eae\u8d77\u7684\u65f6\u95f4\u6700\u957f\u3002<\/p>\n<p>1\u2264n\u22641051\u2264n\u2264105<\/p>\n<p>0\u2264keyTimes[i][0]\u226425(0\u2264i&lt;n)0\u2264keyTimes[i][0]\u226425(0\u2264i&lt;n)<\/p>\n<p>0\u2264keyTimes[i][1]\u2264108(0\u2264i&lt;n)0\u2264keyTimes[i][1]\u2264108(0\u2264i&lt;n)<\/p>\n<p>\u4fdd\u8bc1\u81f3\u5c11\u6709\u4e00\u4e2a\u6309\u952e.<\/p>\n<p>\u4fdd\u8bc1 keyTimes \u662f\u6309\u7167 keyTimes[i][1] \u5347\u5e8f\u6392\u5e8f\u7684.<\/p>\n<p>[\u5728\u7ebf\u8bc4\u6d4b\u5730\u5740] <\/p>\n<h3>\u6837\u4f8b 1<\/h3>\n<pre><code>\u8f93\u5165\uff1a [[0,2],[1,5],[0,9],[2,15]] \u8f93\u51fa\uff1a 'c' \u8bf4\u660e\uff1a operation = `[[0, 2], [1, 5], [0, 9], [2, 15]]` \u5728\u7b2c 0 \u79d2\u7684\u65f6\u5019\uff0c\u63a5\u6536\u5230\u6307\u4ee4`[0, 2]`\uff0c\u6b64\u65f6\u6807\u53f7\u4e3a 0 \u7684\u706f\u4eae\u8d77\uff0c\u7b2c 2 \u79d2\u7684\u65f6\u5019\u7184\u706d\u3002\u6b64\u65f6 0 \u53f7\u706f \u7684\u5355\u6b21\u4eae\u8d77\u65f6\u95f4\u4e3a`2-0 = 2` \u79d2\u3002 \u5728\u7b2c 2 \u79d2\u7684\u65f6\u5019\uff0c\u63a5\u6536\u5230\u6307\u4ee4`[1, 5]`\uff0c\u6b64\u65f6\u6807\u53f7\u4e3a 1 \u7684\u706f\u4eae\u8d77\uff0c\u7b2c 5 \u79d2\u7684\u65f6\u5019\u7184\u706d\u3002\u6b64\u65f6 1 \u53f7\u706f \u7684\u5355\u6b21\u4eae\u8d77\u65f6\u95f4\u4e3a `5-2 = 3` \u79d2\u3002 \u5728\u7b2c 5 \u79d2\u7684\u65f6\u5019\uff0c\u63a5\u6536\u5230\u6307\u4ee4`[0, 9]`\uff0c\u6b64\u65f6\u6807\u53f7\u4e3a 0 \u7684\u706f\u4eae\u8d77\uff0c\u7b2c 9 \u79d2\u7684\u65f6\u5019\u7184\u706d\u3002\u6b64\u65f6 0 \u53f7\u706f \u7684\u5355\u6b21\u4eae\u8d77\u65f6\u95f4\u4e3a `9-5 = 4` \u79d2\u3002 \u5728\u7b2c 9 \u79d2\u7684\u65f6\u5019\uff0c\u63a5\u6536\u5230\u6307\u4ee4`[2, 15]`\uff0c\u6b64\u65f6\u6807\u53f7\u4e3a 2 \u7684\u706f\u4eae\u8d77\uff0c\u7b2c 15 \u79d2\u7684\u65f6\u5019\u7184\u706d\u3002\u6b64\u65f6 2 \u53f7\u706f \u7684\u5355\u6b21\u4eae\u8d77\u65f6\u95f4\u4e3a `15-9 = 6` \u79d2\u3002 \u6240\u4ee5\u5355\u6b21\u4eae\u8d77\u7684\u6700\u957f\u65f6\u95f4\u4e3a `max(2, 3, 4, 6) = 6` \u79d2\uff0c\u662f\u6807\u53f7\u4e3a `2` \u7684\u5f69\u706f\u3002  **\u4f60\u9700\u8981\u8fd4\u56de\u4e00\u4e2a\u5c0f\u5199\u82f1\u6587\u5b57\u6bcd\u4ee3\u8868\u8fd9\u4e2a\u7f16\u53f7\u3002`\u5982 'a' \u4ee3\u8868 0\uff0c'b' \u4ee3\u8868 1\uff0c'c' \u4ee3\u8868 2 ... 'z' \u4ee3\u8868 25 \u3002`** \u6240\u4ee5\u4f60\u7684\u7b54\u6848\u5e94\u8be5\u662f`'c'` <\/code><\/pre>\n<h2>\u7b97\u6cd5\uff1a\u6a21\u62df<\/h2>\n<h3>\u89e3\u9898\u601d\u8def\uff1a<\/h3>\n<p>\u6a21\u62df\u8def\u706f\u5f00\u5173\u7684\u8fc7\u7a0b\uff0c\u5e76\u8bb0\u5f55\u6700\u957f\u7684\u706f\u4eae\u7684\u65f6\u95f4\uff0c\u4ee5\u53ca\u5f53\u524d\u4eae\u8d77\u65f6\u95f4\u6700\u957f\u7684\u706f\u3002<\/p>\n<h3>\u590d\u6742\u5ea6\u5206\u6790\uff1a<\/h3>\n<p>\u65f6\u95f4\u590d\u6742\u5ea6\uff1aO(n) n \u4e3a\u6570\u7ec4\u7684\u957f\u5ea6\u3002 \u7a7a\u95f4\u590d\u6742\u5ea6\uff1aO \uff08 1 \uff09<\/p>\n<h2>\u4ee3\u7801\uff1a<\/h2>\n<pre><code>public class Solution {     \/**      * @param operation: A list of operations.      * @return: The lamp has the longest liighting time.      *\/     public char longestLightingTime(List&lt;List&lt;Integer&gt;&gt; operation) {         int maxTime = operation.get(0).get(1);         char answer = (char)('a' + operation.get(0).get(0));         int n = operation.size();          for (int i = 0; i &lt; n - 1; i++) {             List&lt;Integer&gt; next = operation.get(i + 1);             List&lt;Integer&gt; current = operation.get(i);             int time = next.get(1) - current.get(1);             if (time &gt; maxTime) {                 maxTime = time;                 answer = (char)(next.get(0) + 'a');             }         }         return answer;     } } <\/code><\/pre>\n<p>[\u66f4\u591a\u9898\u89e3\u53c2\u8003] <\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>0<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>Roblox \u9762\u8bd5\u9898\uff1a\u4eae\u8d77\u65f6\u95f4\u6700\u957f&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\/434590"}],"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=434590"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/434590\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=434590"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=434590"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=434590"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}