{"id":569,"date":"2024-06-12T09:00:00","date_gmt":"2024-06-12T01:00:00","guid":{"rendered":"https:\/\/seanxd.com\/?p=569"},"modified":"2024-06-11T03:50:47","modified_gmt":"2024-06-10T19:50:47","slug":"zerojudge-e505","status":"publish","type":"post","link":"https:\/\/seanxd.com\/zh\/zerojudge-e505\/","title":{"rendered":"ZeroJudge E505: Nice Licence Plates"},"content":{"rendered":"\n\n\n<h4 class=\"wp-block-heading\">\u540c\u984c\uff1aUVa 12602 &#8211; Nice Licence Plates<\/h4>\n\n\n\n<p>Alberta \u7684\u8eca\u724c\u7576\u524d\u683c\u5f0f\u70ba ABC-0123 (\u4e09\u500b\u5b57\u6bcd\u5f8c\u8ddf\u8457\u56db\u500b\u6578\u5b57)\u3002<br>\u5982\u679c\u7b2c\u4e00\u90e8\u5206\u7684\u503c\u548c\u7b2c\u4e8c\u90e8\u5206\u7684\u503c\u4e4b\u9593\u7684\u7d55\u5c0d\u5dee\u6700\u5927\u70ba100\uff0c\u5247\u6b64\u8eca\u724c\u662f\u300cnice\u300d\u3002<br>\u7b2c\u4e00\u90e8\u5206\u7684\u503c\u8a08\u7b97\u70ba\u4ee5 26 \u70ba\u5e95\u7684\u6578\u5b57(\u5176\u4e2d [A\uff5eZ] \u4e2d\u7684\u6578\u5b57) \u7684\u503c\u3002<br>\u4f8b\u5982\uff0c\u5982\u679c\u7b2c\u4e00\u90e8\u5206\u662f\u300cABC\u300d\uff0c\u5247\u5176\u503c\u70ba 28 (0 * (26^2)) + (1 * (26^1)) + (2 * (26^0))\u3002<br>\u56e0\u6b64\uff0c\u300cABC-0123\u300d\u8eca\u724c\u5f88\u597d\uff0c\u56e0\u70ba |28-123| \u2264 100\u3002<br>\u6211\u5011\u5c07\u6703\u7d66\u5b9a\u8eca\u724c\u865f\u78bc\u5217\u8868\uff0c\u60a8\u7684\u7a0b\u5f0f\u8981\u78ba\u8a8d\u8eca\u724c\u662f\u5426\u300cnice\u300d\u6216\u8005\u300cnot nice\u300d\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u7bc4\u4f8b\u6e2c\u8cc7<\/h2>\n\n\n\n<figure class=\"wp-block-table nfd-wb-animate nfd-wb-fade-in-bottom-short\"><table class=\"has-fixed-layout\"><thead><tr><th>\u7bc4\u4f8b\u8f38\u5165<\/th><th>\u7bc4\u4f8b\u8f38\u51fa<\/th><\/tr><\/thead><tbody><tr><td>\u8f38\u5165\u7684\u7b2c\u4e00\u884c\u5305\u542b\u6574\u6578 N (1 \u2264 N \u2264 100)\uff0c\u5373\u8eca\u724c\u7684\u6578\u91cf\u3002<br>\u63a5\u4e0b\u4f86 N \u884c\uff0c\u6bcf\u884c\u5305\u542b\u4e00\u500b\u8eca\u724c\uff0c\u683c\u5f0f\u70ba\u300cLLL-DDDD\u300d\u3002<\/td><td>\u5c0d\u65bc\u6bcf\u500b\u8eca\u724c\uff0c\u8f38\u51fa\u300cnice\u300d\u6216\u8005\u300cnot nice\u300d\u3002<\/td><\/tr><tr><td>2<br>ABC-0123<br>AAA-9999<\/td><td>nice<br>not nice<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">\u89e3\u984c\u601d\u8def<\/h2>\n\n\n\n<p>\u5c07\u524d\u6bb5\u8ddf\u5f8c\u6bb5\u7684\u6578\u5b57\u8a2d\u5b9a\u70ba\u4e0d\u540c\u8b8a\u6578\u3002\u4f7f\u7528 For\u8ff4\u5708 \u5c07\u82f1\u6587\u5b57\u6bcd\u7684\u90a3\u4e00\u6bb5\u9032\u884c\u76f8\u52a0\uff0c\u9019\u908a\u8981\u6ce8\u610f\u662f\u300c\u82f1\u6587\u5b57\u6bcd\u9806\u5e8f\uff0a(26^\u4f4d\u6578\u5012\u8f49)\u300d\uff0c\u984c\u76ee\u6c92\u6709\u5beb\u7684\u5f88\u6e05\u695a\u8981\u6ce8\u610f\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u7bc4\u4f8b\u7a0b\u5f0f\u78bc\uff0d<a href=\"https:\/\/zerojudge.tw\/ShowProblem?problemid=e505\" target=\"_blank\" rel=\"noreferrer noopener\">ZeroJudge E505: Nice Licence Plates<\/a><\/h3>\n\n\n\n<div class=\"hcb_wrap nfd-wb-animate nfd-wb-reveal-right nfd-delay-50\"><pre class=\"prism line-numbers lang-cpp\" data-lang=\"C++\"><code>#include &lt;iostream&gt;\n#include &lt;math.h&gt;\nusing namespace std;\n\nint main() {\n    cin.sync_with_stdio(0);\n    cin.tie(0);\n    int N;\n    cin &gt;&gt; N;\n    for (int i = 0; i&lt;N; i++)\n    {\n        string str;\n        cin &gt;&gt; str;\n        int one = 0, two, count = 2;\n        for (int i = 0; i&lt;3; i++)\n        {\n            one += int(str[i] - &#39;A&#39;) * pow(26, count);\n            count--;\n        }\n        two = stoi(str.substr(4, str.length()));\n        if (abs(one - two) &lt;= 100)\n        {\n            cout &lt;&lt; &quot;nice\\n&quot;;\n            continue;\n        }\n        cout &lt;&lt; &quot;not nice\\n&quot;;\n    }\n}\n\n\/\/ZeroJudge E505\n\/\/Dr. SeanXD<\/code><\/pre><\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u540c\u984c\uff1aUVa 12602 &#8211; Nice Licence Plates Alberta \u7684\u8eca\u724c\u7576\u524d\u683c [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"nf_dc_page":"","footnotes":""},"categories":[18],"tags":[8,11,13,9],"class_list":["post-569","post","type-post","status-publish","format-standard","hentry","category-uva","tag-8","tag-11","tag-13","tag-9"],"blocksy_meta":[],"_links":{"self":[{"href":"https:\/\/seanxd.com\/zh\/wp-json\/wp\/v2\/posts\/569","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/seanxd.com\/zh\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/seanxd.com\/zh\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/seanxd.com\/zh\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/seanxd.com\/zh\/wp-json\/wp\/v2\/comments?post=569"}],"version-history":[{"count":2,"href":"https:\/\/seanxd.com\/zh\/wp-json\/wp\/v2\/posts\/569\/revisions"}],"predecessor-version":[{"id":887,"href":"https:\/\/seanxd.com\/zh\/wp-json\/wp\/v2\/posts\/569\/revisions\/887"}],"wp:attachment":[{"href":"https:\/\/seanxd.com\/zh\/wp-json\/wp\/v2\/media?parent=569"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/seanxd.com\/zh\/wp-json\/wp\/v2\/categories?post=569"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/seanxd.com\/zh\/wp-json\/wp\/v2\/tags?post=569"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}