
{"id":140,"date":"2019-02-13T21:11:21","date_gmt":"2019-02-13T13:11:21","guid":{"rendered":"http:\/\/www.changxuan.top\/?p=140"},"modified":"2020-10-12T20:06:03","modified_gmt":"2020-10-12T12:06:03","slug":"leetcode-%e7%9a%84-runtime-%e6%8c%87%e6%a0%87%e6%98%af%e5%90%a6%e5%8f%af%e4%bf%a1%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/www.changxuan.top\/?p=140","title":{"rendered":"LeetCode \u7684 Runtime \u6307\u6807\u662f\u5426\u53ef\u4fe1\uff1f"},"content":{"rendered":"\n<p>\u4eca\u5929\u505a\u5b8c \u00a0Roman to Integer \u8fd9\u9053\u9898\u540e\u611f\u89c9\u8fd0\u884c\u65f6\u95f4\u7a0d\u957f\u5c31\u5f00\u59cb\u4e86\u4f18\u5316\u4ee3\u7801\u3002\u7136\u540e\u5c31\u53d1\u73b0\u8d8a\u4f18\u5316\u8d8a\u4e0d\u79d1\u5b66\uff01\u62ff\u6765\u4e2d\u6587\u7248\u7684 leetCode \u7f51\u7ad9\u6765\u8fd0\u884c\u53d1\u73b0\u66f4\u52a0\u795e\u5947\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u9898\u76ee\u8be6\u60c5<\/h3>\n\n\n\n<p>Roman numerals are represented by seven different symbols:&nbsp;<code>I<\/code>,&nbsp;<code>V<\/code>,&nbsp;<code>X<\/code>,&nbsp;<code>L<\/code>,&nbsp;<code>C<\/code>,&nbsp;<code>D<\/code>&nbsp;and&nbsp;<code>M<\/code>.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong>Symbol<\/strong>       <strong>Value<\/strong>\nI             1\nV             5\nX             10\nL             50\nC             100\nD             500\nM             1000<\/pre>\n\n\n\n<p>For example,&nbsp;two is written as&nbsp;<code>II<\/code>&nbsp;in Roman numeral, just two one&#8217;s added together. Twelve is written as,&nbsp;<code>XII<\/code>, which is simply&nbsp;<code>X<\/code>&nbsp;+&nbsp;<code>II<\/code>. The number twenty seven is written as&nbsp;<code>XXVII<\/code>, which is&nbsp;<code>XX<\/code>&nbsp;+&nbsp;<code>V<\/code>&nbsp;+&nbsp;<code>II<\/code>.<\/p>\n\n\n\n<p>Roman numerals are usually written largest to smallest from left to right. However, the numeral for four is not&nbsp;<code>IIII<\/code>. Instead, the number four is written as&nbsp;<code>IV<\/code>. Because the one is before the five we subtract it making four. The same principle applies to the number nine, which is written as&nbsp;<code>IX<\/code>. There are six instances where subtraction is used:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><code>I<\/code>&nbsp;can be placed before&nbsp;<code>V<\/code>&nbsp;(5) and&nbsp;<code>X<\/code>&nbsp;(10) to make 4 and 9.&nbsp;<\/li><li><code>X<\/code>&nbsp;can be placed before&nbsp;<code>L<\/code>&nbsp;(50) and&nbsp;<code>C<\/code>&nbsp;(100) to make 40 and 90.&nbsp;<\/li><li><code>C<\/code>&nbsp;can be placed before&nbsp;<code>D<\/code>&nbsp;(500) and&nbsp;<code>M<\/code>&nbsp;(1000) to make 400 and 900.<\/li><\/ul>\n\n\n\n<p>Given a roman numeral, convert it to an integer. Input is guaranteed to be within the range from 1 to 3999.<\/p>\n\n\n\n<p><strong>Example 1:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong>Input:<\/strong>&nbsp;\"III\"\n<strong>Output:<\/strong> 3<\/pre>\n\n\n\n<p><strong>Example 2:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong>Input:<\/strong>&nbsp;\"IV\"\n<strong>Output:<\/strong> 4<\/pre>\n\n\n\n<p><strong>Example 3:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong>Input:<\/strong>&nbsp;\"IX\"\n<strong>Output:<\/strong> 9<\/pre>\n\n\n\n<p><strong>Example 4:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong>Input:<\/strong>&nbsp;\"LVIII\"\n<strong>Output:<\/strong> 58\n<strong>Explanation:<\/strong> L = 50, V= 5, III = 3.\n<\/pre>\n\n\n\n<p><strong>Example 5:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong>Input:<\/strong>&nbsp;\"MCMXCIV\"\n<strong>Output:<\/strong> 1994\n<strong>Explanation:<\/strong> M = 1000, CM = 900, XC = 90 and IV = 4.<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">\u4e00<\/h3>\n\n\n\n<p>\u4f46\u770b\u5230\u9898\u76ee\u7684\u65f6\u5019\uff0c\u60f3\u5230\u53ef\u4ee5\u7528\u5230\u952e\u503c\u5bf9\u3002\u7136\u540e\u9488\u5bf9\u7279\u6b8a\u7684\u89c4\u5219\uff0c\u5982\u679c\u6ca1\u5230\u6700\u540e\u4e00\u4e2a\u5b57\u6bcd\u5c31\u5224\u65ad\u5f53\u524d\u5b57\u6bcd\u8868\u793a\u7684\u6570\u503c\u662f\u5426\u5c0f\u4e8e\u540e\u4e00\u4e2a\u5b57\u6bcd\u8868\u793a\u7684\u6570\u503c&#8230; &#8230;\u6211\u7684\u7b2c\u4e00\u4e2a\u7248\u672c\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n\n\n\n<p><br><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>public static int getValues(String roman){\n\t\tint values = 0;\n\t\tMap &lt;Character,Integer> map = new HashMap();\n\t\tmap.put('I', 1);\n\t\tmap.put('V', 5);\n\t\tmap.put('X', 10);\n\t\tmap.put('L', 50);\n\t\tmap.put('C', 100);\n\t\tmap.put('D', 500);\n\t\tmap.put('M', 1000);\n\t\t\n\t\tchar[] romanArray = roman.toCharArray();\n\t\t\n\t\tfor(int i = 0; i &lt; romanArray.length; i++){\n\t\t\tif((i != romanArray.length-1)&amp;&amp;(map.get(romanArray[i]) &lt; map.get(romanArray[i+1]))){\n\t\t\t\tvalues = values + (map.get(romanArray[i+1]) - map.get(romanArray[i]));\n\t\t\t\ti++;\n\t\t\t}else{\n\t\t\t\tvalues += map.get(romanArray[i]);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\treturn values;\t\t\n\t}<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Submission Detail<\/h3>\n\n\n\n<table class=\"wp-block-table\"><tbody><tr><td><strong>3999 \/ 3999<\/strong>&nbsp;test cases passed.<\/td><td>Status:&nbsp;Accepted<\/td><\/tr><tr><td>Runtime:&nbsp;<strong>43 ms<\/strong><\/td><td>Submitted:&nbsp;<strong>1&nbsp;hour, 42&nbsp;minutes ago<\/strong><\/td><\/tr><\/tbody><\/table>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p>You are here!\u00a0<br>Your runtime beats <strong>65.95 %<\/strong> of java submissions.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u4e8c<\/h3>\n\n\n\n<p>\u7136\u540e\u60f3\u5230\u53ef\u4ee5\u7528\u7528\u4e00\u4e2a\u51fd\u6570\u6765\u66ff\u4ee3 HashMap \u7684\u4f5c\u7528\u3002\u7b2c\u4e8c\u4e2a\u7248\u672c\u7684\u4ee3\u7801\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>class Solution {\n    public static int val(char rom){\n\t\tint temp = 0;\n\t\tswitch (rom){\n\t\tcase 'I':\n\t\t\ttemp = 1;\n\t\t\tbreak;\n\t\tcase 'V':\n\t\t\ttemp = 5;\n\t\t\tbreak;\n\t\tcase 'X':\n\t\t\ttemp = 10;\n\t\t\tbreak;\n\t\tcase 'L':\n\t\t\ttemp = 50;\n\t\t\tbreak;\n\t\tcase 'C':\n\t\t\ttemp = 100;\n\t\t\tbreak;\n\t\tcase 'D':\n\t\t\ttemp = 500;\n\t\t\tbreak;\n\t\tcase 'M':\n\t\t\ttemp = 1000;\n\t\t}\n\t\treturn temp;\n\t}\n    public int romanToInt(String s) {\n       int values = 0;\n\t\tchar[] romanArray = s.toCharArray();\n\t\tfor(int i = 0; i &lt; romanArray.length; i++){\n\t\t\tif((i != romanArray.length-1)&amp;&amp;(val(romanArray[i]) &lt; val(romanArray[i+1]))){\n\t\t\t\tvalues = values + (val(romanArray[i+1]) - val(romanArray[i]));\n\t\t\t\ti++;\n\t\t\t}else{\n\t\t\t\tvalues += val(romanArray[i]);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\treturn values;\n    }\n}<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Submission Detail<\/h3>\n\n\n\n<table class=\"wp-block-table\"><tbody><tr><td><strong>3999 \/ 3999<\/strong>&nbsp;test cases passed.<\/td><td>Status:&nbsp;Accepted<\/td><\/tr><tr><td>Runtime:&nbsp;<strong>38 ms<\/strong><\/td><td>Submitted:&nbsp;<strong>47&nbsp;minutes ago<\/strong><\/td><\/tr><\/tbody><\/table>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p>You are here!\u00a0<br>Your runtime beats <strong>88.23 %<\/strong> of java submissions.<\/p>\n\n\n\n<p>\u770b\u6765\u662f\u6709\u4e00\u70b9\u8fdb\u6b65\u7684\uff01\u4f46\u662f\u6211\u5b9e\u5728\u60f3\u4e0d\u5230\u5982\u4f55\u7f29\u77ed\u8fd0\u884c\u65f6\u95f4\u4e86\uff0c\u6240\u4ee5\u6211\u53bb\u770b\u522b\u4eba\u7684<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"650\" height=\"587\" src=\"http:\/\/www.changxuan.top\/wp-content\/uploads\/2019\/02\/111.png\" alt=\"\" class=\"wp-image-141\" srcset=\"https:\/\/www.changxuan.top\/wp-content\/uploads\/2019\/02\/111.png 650w, https:\/\/www.changxuan.top\/wp-content\/uploads\/2019\/02\/111-300x271.png 300w\" sizes=\"auto, (max-width: 650px) 100vw, 650px\" \/><figcaption>32 ms\u89e3\u6cd5<\/figcaption><\/figure>\n\n\n\n<p>\u7136\u540e\u6211\u901a\u8fc7 ctrl v + ctrl c\uff0c\u8fd0\u884c\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"680\" height=\"137\" src=\"http:\/\/www.changxuan.top\/wp-content\/uploads\/2019\/02\/222.png\" alt=\"\" class=\"wp-image-142\" srcset=\"https:\/\/www.changxuan.top\/wp-content\/uploads\/2019\/02\/222.png 680w, https:\/\/www.changxuan.top\/wp-content\/uploads\/2019\/02\/222-300x60.png 300w\" sizes=\"auto, (max-width: 680px) 100vw, 680px\" \/><\/figure>\n\n\n\n<p>39 ms &#8230; &#8230;<\/p>\n\n\n\n<p>\u8fd8\u6ca1\u6211\u7684\u4ee3\u7801\u8fd0\u884c\u65f6\u95f4\u77ed\uff01\u7136\u540e\u6211\u6253\u5f00\u4e2d\u6587\u7248\u7684 leetCode \u5c06\u4e0a\u9762\u7684\u7684\u4ee3\u7801\u4f9d\u6b21\u590d\u5236\u8fd0\u884c\uff0c\u8fd0\u884c\u7ed3\u679c\u5982\u4e0b\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"664\" height=\"404\" src=\"http:\/\/www.changxuan.top\/wp-content\/uploads\/2019\/02\/333.png\" alt=\"\" class=\"wp-image-143\" srcset=\"https:\/\/www.changxuan.top\/wp-content\/uploads\/2019\/02\/333.png 664w, https:\/\/www.changxuan.top\/wp-content\/uploads\/2019\/02\/333-300x183.png 300w\" sizes=\"auto, (max-width: 664px) 100vw, 664px\" \/><\/figure>\n\n\n\n<p>\u5176\u4e2d120 ms \u662f\u6211\u4ece\u4e2d\u6587\u7248\u7f51\u7ad9\u4e2d\u627e\u7684\u6700\u4f18\u89e3\u4ee3\u7801&#8230; &#8230;<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u603b\u7ed3<br><\/h3>\n\n\n\n<ul class=\"wp-block-list\"><li>\u8fd9\u662f\u7384\u5b66<\/li><li>\u82f1\u6587\u7248\u7684\u670d\u52a1\u5668\u6bd4\u4e2d\u6587\u7248\u7684\u670d\u52a1\u5668\u597d<\/li><li>\u5c3d\u91cf\u6311\u6ca1\u4eba\u505a\u9898\u7684\u65f6\u5019\u63d0\u4ea4<\/li><li>\u4ee5\u540e\u9664\u975e\u6709\u66f4\u597d\u7684\u601d\u8def\u548c\u65b9\u6cd5\uff0c\u518d\u4e5f\u4e0d\u505a\u4f18\u5316\uff01<\/li><\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u4eca\u5929\u505a\u5b8c \u00a0Roman to Integer \u8fd9\u9053\u9898\u540e\u611f\u89c9\u8fd0\u884c\u65f6\u95f4\u7a0d\u957f\u5c31\u5f00\u59cb\u4e86\u4f18\u5316\u4ee3\u7801\u3002\u7136\u540e\u5c31\u53d1\u73b0\u8d8a\u4f18\u5316\u8d8a\u4e0d\u79d1 &hellip; <a href=\"https:\/\/www.changxuan.top\/?p=140\" class=\"more-link\">\u7ee7\u7eed\u9605\u8bfb<span class=\"screen-reader-text\">LeetCode \u7684 Runtime \u6307\u6807\u662f\u5426\u53ef\u4fe1\uff1f<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[37],"tags":[36],"class_list":["post-140","post","type-post","status-publish","format-standard","hentry","category-tech","tag-leetcode"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>LeetCode \u7684 Runtime \u6307\u6807\u662f\u5426\u53ef\u4fe1\uff1f - \u5e38\u8f69<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.changxuan.top\/?p=140\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"LeetCode \u7684 Runtime \u6307\u6807\u662f\u5426\u53ef\u4fe1\uff1f - \u5e38\u8f69\" \/>\n<meta property=\"og:description\" content=\"\u4eca\u5929\u505a\u5b8c \u00a0Roman to Integer \u8fd9\u9053\u9898\u540e\u611f\u89c9\u8fd0\u884c\u65f6\u95f4\u7a0d\u957f\u5c31\u5f00\u59cb\u4e86\u4f18\u5316\u4ee3\u7801\u3002\u7136\u540e\u5c31\u53d1\u73b0\u8d8a\u4f18\u5316\u8d8a\u4e0d\u79d1 &hellip; \u7ee7\u7eed\u9605\u8bfbLeetCode \u7684 Runtime \u6307\u6807\u662f\u5426\u53ef\u4fe1\uff1f\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.changxuan.top\/?p=140\" \/>\n<meta property=\"og:site_name\" content=\"\u5e38\u8f69\" \/>\n<meta property=\"article:published_time\" content=\"2019-02-13T13:11:21+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-10-12T12:06:03+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/www.changxuan.top\/wp-content\/uploads\/2019\/02\/111.png\" \/>\n<meta name=\"author\" content=\"\u5e38\u8f69\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u5e38\u8f69\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.changxuan.top\\\/?p=140#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.changxuan.top\\\/?p=140\"},\"author\":{\"name\":\"\u5e38\u8f69\",\"@id\":\"https:\\\/\\\/www.changxuan.top\\\/#\\\/schema\\\/person\\\/08c8f0af44536928094dc1b4f88da3bd\"},\"headline\":\"LeetCode \u7684 Runtime \u6307\u6807\u662f\u5426\u53ef\u4fe1\uff1f\",\"datePublished\":\"2019-02-13T13:11:21+00:00\",\"dateModified\":\"2020-10-12T12:06:03+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.changxuan.top\\\/?p=140\"},\"wordCount\":255,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.changxuan.top\\\/#\\\/schema\\\/person\\\/08c8f0af44536928094dc1b4f88da3bd\"},\"image\":{\"@id\":\"https:\\\/\\\/www.changxuan.top\\\/?p=140#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/www.changxuan.top\\\/wp-content\\\/uploads\\\/2019\\\/02\\\/111.png\",\"keywords\":[\"leetCode\"],\"articleSection\":[\"\u6280\u672f\"],\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.changxuan.top\\\/?p=140#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.changxuan.top\\\/?p=140\",\"url\":\"https:\\\/\\\/www.changxuan.top\\\/?p=140\",\"name\":\"LeetCode \u7684 Runtime \u6307\u6807\u662f\u5426\u53ef\u4fe1\uff1f - \u5e38\u8f69\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.changxuan.top\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.changxuan.top\\\/?p=140#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.changxuan.top\\\/?p=140#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/www.changxuan.top\\\/wp-content\\\/uploads\\\/2019\\\/02\\\/111.png\",\"datePublished\":\"2019-02-13T13:11:21+00:00\",\"dateModified\":\"2020-10-12T12:06:03+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.changxuan.top\\\/?p=140#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.changxuan.top\\\/?p=140\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\\\/\\\/www.changxuan.top\\\/?p=140#primaryimage\",\"url\":\"https:\\\/\\\/www.changxuan.top\\\/wp-content\\\/uploads\\\/2019\\\/02\\\/111.png\",\"contentUrl\":\"https:\\\/\\\/www.changxuan.top\\\/wp-content\\\/uploads\\\/2019\\\/02\\\/111.png\",\"width\":650,\"height\":587},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.changxuan.top\\\/?p=140#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\\\/\\\/www.changxuan.top\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"LeetCode \u7684 Runtime \u6307\u6807\u662f\u5426\u53ef\u4fe1\uff1f\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.changxuan.top\\\/#website\",\"url\":\"https:\\\/\\\/www.changxuan.top\\\/\",\"name\":\"\u5e38\u8f69\",\"description\":\"\u95fb\u9053\u6709\u5148\u540e\uff0c\u672f\u4e1a\u6709\u4e13\u653b-\u4e00\u4e8c\u4e09\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.changxuan.top\\\/#\\\/schema\\\/person\\\/08c8f0af44536928094dc1b4f88da3bd\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.changxuan.top\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"zh-Hans\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/www.changxuan.top\\\/#\\\/schema\\\/person\\\/08c8f0af44536928094dc1b4f88da3bd\",\"name\":\"\u5e38\u8f69\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\\\/\\\/www.changxuan.top\\\/wp-content\\\/uploads\\\/2021\\\/04\\\/IMG_008520200606-095631.jpg\",\"url\":\"https:\\\/\\\/www.changxuan.top\\\/wp-content\\\/uploads\\\/2021\\\/04\\\/IMG_008520200606-095631.jpg\",\"contentUrl\":\"https:\\\/\\\/www.changxuan.top\\\/wp-content\\\/uploads\\\/2021\\\/04\\\/IMG_008520200606-095631.jpg\",\"width\":960,\"height\":960,\"caption\":\"\u5e38\u8f69\"},\"logo\":{\"@id\":\"https:\\\/\\\/www.changxuan.top\\\/wp-content\\\/uploads\\\/2021\\\/04\\\/IMG_008520200606-095631.jpg\"},\"description\":\"\u603b\u8981\u505a\u70b9\u4ec0\u4e48\u5427\uff01\",\"sameAs\":[\"https:\\\/\\\/www.changxuan.top\"],\"url\":\"https:\\\/\\\/www.changxuan.top\\\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"LeetCode \u7684 Runtime \u6307\u6807\u662f\u5426\u53ef\u4fe1\uff1f - \u5e38\u8f69","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.changxuan.top\/?p=140","og_locale":"zh_CN","og_type":"article","og_title":"LeetCode \u7684 Runtime \u6307\u6807\u662f\u5426\u53ef\u4fe1\uff1f - \u5e38\u8f69","og_description":"\u4eca\u5929\u505a\u5b8c \u00a0Roman to Integer \u8fd9\u9053\u9898\u540e\u611f\u89c9\u8fd0\u884c\u65f6\u95f4\u7a0d\u957f\u5c31\u5f00\u59cb\u4e86\u4f18\u5316\u4ee3\u7801\u3002\u7136\u540e\u5c31\u53d1\u73b0\u8d8a\u4f18\u5316\u8d8a\u4e0d\u79d1 &hellip; \u7ee7\u7eed\u9605\u8bfbLeetCode \u7684 Runtime \u6307\u6807\u662f\u5426\u53ef\u4fe1\uff1f","og_url":"https:\/\/www.changxuan.top\/?p=140","og_site_name":"\u5e38\u8f69","article_published_time":"2019-02-13T13:11:21+00:00","article_modified_time":"2020-10-12T12:06:03+00:00","og_image":[{"url":"http:\/\/www.changxuan.top\/wp-content\/uploads\/2019\/02\/111.png","type":"","width":"","height":""}],"author":"\u5e38\u8f69","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"\u5e38\u8f69","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"2 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.changxuan.top\/?p=140#article","isPartOf":{"@id":"https:\/\/www.changxuan.top\/?p=140"},"author":{"name":"\u5e38\u8f69","@id":"https:\/\/www.changxuan.top\/#\/schema\/person\/08c8f0af44536928094dc1b4f88da3bd"},"headline":"LeetCode \u7684 Runtime \u6307\u6807\u662f\u5426\u53ef\u4fe1\uff1f","datePublished":"2019-02-13T13:11:21+00:00","dateModified":"2020-10-12T12:06:03+00:00","mainEntityOfPage":{"@id":"https:\/\/www.changxuan.top\/?p=140"},"wordCount":255,"commentCount":0,"publisher":{"@id":"https:\/\/www.changxuan.top\/#\/schema\/person\/08c8f0af44536928094dc1b4f88da3bd"},"image":{"@id":"https:\/\/www.changxuan.top\/?p=140#primaryimage"},"thumbnailUrl":"http:\/\/www.changxuan.top\/wp-content\/uploads\/2019\/02\/111.png","keywords":["leetCode"],"articleSection":["\u6280\u672f"],"inLanguage":"zh-Hans","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.changxuan.top\/?p=140#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.changxuan.top\/?p=140","url":"https:\/\/www.changxuan.top\/?p=140","name":"LeetCode \u7684 Runtime \u6307\u6807\u662f\u5426\u53ef\u4fe1\uff1f - \u5e38\u8f69","isPartOf":{"@id":"https:\/\/www.changxuan.top\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.changxuan.top\/?p=140#primaryimage"},"image":{"@id":"https:\/\/www.changxuan.top\/?p=140#primaryimage"},"thumbnailUrl":"http:\/\/www.changxuan.top\/wp-content\/uploads\/2019\/02\/111.png","datePublished":"2019-02-13T13:11:21+00:00","dateModified":"2020-10-12T12:06:03+00:00","breadcrumb":{"@id":"https:\/\/www.changxuan.top\/?p=140#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.changxuan.top\/?p=140"]}]},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.changxuan.top\/?p=140#primaryimage","url":"https:\/\/www.changxuan.top\/wp-content\/uploads\/2019\/02\/111.png","contentUrl":"https:\/\/www.changxuan.top\/wp-content\/uploads\/2019\/02\/111.png","width":650,"height":587},{"@type":"BreadcrumbList","@id":"https:\/\/www.changxuan.top\/?p=140#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.changxuan.top\/"},{"@type":"ListItem","position":2,"name":"LeetCode \u7684 Runtime \u6307\u6807\u662f\u5426\u53ef\u4fe1\uff1f"}]},{"@type":"WebSite","@id":"https:\/\/www.changxuan.top\/#website","url":"https:\/\/www.changxuan.top\/","name":"\u5e38\u8f69","description":"\u95fb\u9053\u6709\u5148\u540e\uff0c\u672f\u4e1a\u6709\u4e13\u653b-\u4e00\u4e8c\u4e09","publisher":{"@id":"https:\/\/www.changxuan.top\/#\/schema\/person\/08c8f0af44536928094dc1b4f88da3bd"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.changxuan.top\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"zh-Hans"},{"@type":["Person","Organization"],"@id":"https:\/\/www.changxuan.top\/#\/schema\/person\/08c8f0af44536928094dc1b4f88da3bd","name":"\u5e38\u8f69","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.changxuan.top\/wp-content\/uploads\/2021\/04\/IMG_008520200606-095631.jpg","url":"https:\/\/www.changxuan.top\/wp-content\/uploads\/2021\/04\/IMG_008520200606-095631.jpg","contentUrl":"https:\/\/www.changxuan.top\/wp-content\/uploads\/2021\/04\/IMG_008520200606-095631.jpg","width":960,"height":960,"caption":"\u5e38\u8f69"},"logo":{"@id":"https:\/\/www.changxuan.top\/wp-content\/uploads\/2021\/04\/IMG_008520200606-095631.jpg"},"description":"\u603b\u8981\u505a\u70b9\u4ec0\u4e48\u5427\uff01","sameAs":["https:\/\/www.changxuan.top"],"url":"https:\/\/www.changxuan.top\/?author=1"}]}},"views":1866,"_links":{"self":[{"href":"https:\/\/www.changxuan.top\/index.php?rest_route=\/wp\/v2\/posts\/140","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.changxuan.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.changxuan.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.changxuan.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.changxuan.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=140"}],"version-history":[{"count":1,"href":"https:\/\/www.changxuan.top\/index.php?rest_route=\/wp\/v2\/posts\/140\/revisions"}],"predecessor-version":[{"id":144,"href":"https:\/\/www.changxuan.top\/index.php?rest_route=\/wp\/v2\/posts\/140\/revisions\/144"}],"wp:attachment":[{"href":"https:\/\/www.changxuan.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=140"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.changxuan.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=140"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.changxuan.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=140"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}