{"id":2259,"date":"2025-01-08T11:07:09","date_gmt":"2025-01-08T03:07:09","guid":{"rendered":"https:\/\/guapicoding.com\/?p=2259"},"modified":"2025-01-14T16:05:57","modified_gmt":"2025-01-14T08:05:57","slug":"%e5%8a%9b%e6%89%a3%e9%a2%98%e8%ae%b0%e4%b9%8b%e8%b4%aa%e5%bf%83","status":"publish","type":"post","link":"https:\/\/guapicoding.com\/?p=2259","title":{"rendered":"\u529b\u6263\u9898\u8bb0\u4e4b\u8d2a\u5fc3"},"content":{"rendered":"\n<p class=\"has-text-align-center\"><em><strong>More content<\/strong><\/em><strong><em>\uff1a<\/em><\/strong><a href=\"https:\/\/guapicoding.com\/?p=2257\"><\/a><a href=\"https:\/\/guapicoding.com\/?p=2257\">LeetCode hot100@\u8d2a\u5fc3<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><a href=\"https:\/\/leetcode.cn\/problems\/jump-game\/\">55. \u8df3\u8dc3\u6e38\u620f<\/a>\u274c<\/h2>\n\n\n\n<p><em><strong>\u4e00\u5f00\u59cb\u60f3\u7684\u662f\u8df3\u5411\u6700\u5927\u957f\u5ea6\u4e4b\u95f4\u4e2d\u4e0b\u6807\u6700\u5927\u7684\uff0c\u53d1\u73b0\u4e0d\u884c<\/strong><\/em><\/p>\n\n\n\n<p><em><strong>\u4e0d\u8981\u62d8\u6ce5\u4e8e\u8df3\u5230\u54ea\uff0c\u800c\u662f\u80fd\u8df3\u5230\u54ea\uff0c\u5373\u5173\u6ce8\u80fd\u8df3\u5230\u7684\u8303\u56f4<\/strong><\/em><\/p>\n\n\n\n<p><strong>\u8d2a\u5fc3\u7b97\u6cd5\u5c40\u90e8\u6700\u4f18\u89e3\uff1a\u6bcf\u6b21\u53d6\u6700\u5927\u8df3\u8dc3\u6b65\u6570\uff08\u53d6\u6700\u5927\u8986\u76d6\u8303\u56f4\uff09<\/strong><\/p>\n\n\n\n<p><strong>\u6574\u4f53\u6700\u4f18\u89e3\uff1a\u6700\u540e\u5f97\u5230\u6574\u4f53\u6700\u5927\u8986\u76d6\u8303\u56f4\uff0c\u770b\u662f\u5426\u80fd\u5230\u7ec8\u70b9<\/strong> <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>class Solution {\npublic:\n    bool canJump(vector&lt;int&gt;&amp; nums) {\n        int dest = nums.size() - 1;\n        \/\/\u770b\u8df3\u8dc3\u8986\u76d6\u8303\u56f4\u53ef\u4e0d\u53ef\u4ee5\u8986\u76d6\u5230\u7ec8\u70b9\n        int cover = 0;\n        for(int i = 0; i &lt;= dest; i++) {\n            if(cover &lt; i) return false; \/\/\u9047\u52300\u8df3\u4e0d\u5230\uff0c\u4e2d\u65ad\u4e86\n            for(int j = 1; j &lt;= nums&#91;i] &amp;&amp; j + i &lt;= dest; j++) {\n                cover = max(cover, i + j + nums&#91;i+j]);\n            }\n            if(cover &gt;= dest) return true;\n        }\n        return false;\n    }\n};<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n","protected":false},"excerpt":{"rendered":"<p>More content\uff1aLeetCode hot100@\u8d2a\u5fc3 55. \u8df3\u8dc3\u6e38\u620f\u274c \u4e00\u5f00\u59cb\u60f3\u7684\u662f\u8df3\u5411\u6700\u5927\u957f\u5ea6\u4e4b [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[18,19,78],"class_list":["post-2259","post","type-post","status-publish","format-standard","hentry","category-suanfa","tag-leetcode","tag-19","tag-78"],"_links":{"self":[{"href":"https:\/\/guapicoding.com\/index.php?rest_route=\/wp\/v2\/posts\/2259","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/guapicoding.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/guapicoding.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/guapicoding.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/guapicoding.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2259"}],"version-history":[{"count":4,"href":"https:\/\/guapicoding.com\/index.php?rest_route=\/wp\/v2\/posts\/2259\/revisions"}],"predecessor-version":[{"id":2341,"href":"https:\/\/guapicoding.com\/index.php?rest_route=\/wp\/v2\/posts\/2259\/revisions\/2341"}],"wp:attachment":[{"href":"https:\/\/guapicoding.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2259"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/guapicoding.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2259"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/guapicoding.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2259"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}