{"id":11,"date":"2024-04-25T17:21:42","date_gmt":"2024-04-25T09:21:42","guid":{"rendered":"https:\/\/iil.pov.mybluehost.me\/?p=11"},"modified":"2024-06-17T17:02:47","modified_gmt":"2024-06-17T09:02:47","slug":"zerojudge-a148-you-cannot-pass","status":"publish","type":"post","link":"https:\/\/seanxd.com\/en\/zerojudge-a148-you-cannot-pass\/","title":{"rendered":"ZeroJudge A148: You Cannot Pass?!"},"content":{"rendered":"<p>You took N written exams, and each subject has a maximum score of 100. The teacher said that if your average score is greater than 59, you pass.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"\u7bc4\u4f8b\u6e2c\u8cc7\">Sample Inputs\/Outputs<\/h2>\n\n\n\n<figure class=\"wp-block-table nfd-wb-animate nfd-wb-fade-in-bottom-short has-medium-font-size\"><table class=\"has-fixed-layout\"><thead><tr><th class=\"has-text-align-left\" data-align=\"left\">Sample Input(s)<\/th><th class=\"has-text-align-left\" data-align=\"left\">Sample Output(s)<\/th><\/tr><\/thead><tbody><tr><td class=\"has-text-align-left\" data-align=\"left\">EOF input: Each input starts with a number N, followed by N positive integers.<\/td><td class=\"has-text-align-left\" data-align=\"left\">If you fail, output \"yes\"; otherwise, output \"no.\"<\/td><\/tr><tr><td class=\"has-text-align-left\" data-align=\"left\">1 60<br>3 0 80 75<br>5 61 61 61 61 55<\/td><td class=\"has-text-align-left\" data-align=\"left\">no<br>yes<br>no<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"\u89e3\u984c\u601d\u8def\">Thought Process<\/h2>\n\n\n\n<p>The first number on the first line is 1, which means the next input will be 1 number. Since 60 &gt; 59, the output is \"no.\"<\/p>\n\n\n\n<p>On the second line, the first number is 3, indicating the next input will be 3 numbers: 0, 80, and 75. The average of these three numbers is 51.6. Since 51.6 is not greater than 59, the output is \"yes.\"<\/p>\n\n\n\n<p>On the third line, the first number is 5, and the next input will be 5 numbers. The average is 59.8. Since 59.8 &gt; 59, the output is \"no.\"<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"\u7bc4\u4f8b\u7a0b\u5f0f\u78bc\">Sample Code\uff0d<a href=\"https:\/\/zerojudge.tw\/ShowProblem?problemid=a148\" target=\"_blank\" rel=\"noreferrer noopener\">ZeroJudge A148: You Cannot Pass?!<\/a><\/h3>\n\n\n\n<div class=\"hcb_wrap nfd-wb-animate nfd-wb-reveal-right\"><pre class=\"prism line-numbers lang-cpp\" data-lang=\"C++\" data-show-lang=\"1\"><code>#include &lt;iostream&gt;\nusing namespace std;\n\nint main() {\n  float N;\n  while (cin &gt;&gt; N)\n    {\n      float sum = 0;\n      for (int i = 0; i&lt;N; i++)\n        {\n          float tmp;\n          cin &gt;&gt; tmp;\n          sum += tmp;\n        }\n      if (sum\/N &gt; 59) cout &lt;&lt; &quot;no&quot; &lt;&lt; endl;\n      else cout &lt;&lt; &quot;yes&quot; &lt;&lt; endl;\n    }\n}\n\n\/\/ZeroJudge A148\n\/\/Dr. SeanXD<\/code><\/pre><\/div>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>","protected":false},"excerpt":{"rendered":"<p>\u4f60\u8003\u4e86\uff2e\u79d1\u7b46\u8a66\u984c\u76ee\uff0c\u6bcf\u79d1\u7684\u6eff\u5206\u90fd\u662f 100 \u5206\u3002\u8001\u5e2b\u8aaa\uff0c\u5982\u679c\u5e73\u5747\u5927\u65bc 59 \u4f60\u5c31\u904e\u95dc\u4e86\u3002 \u7bc4\u4f8b\u6e2c\u8cc7 \u7bc4\u4f8b\u8f38\u5165  [&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":[6],"tags":[8,7,9],"class_list":["post-11","post","type-post","status-publish","format-standard","hentry","category-6","tag-8","tag-7","tag-9"],"blocksy_meta":[],"_links":{"self":[{"href":"https:\/\/seanxd.com\/en\/wp-json\/wp\/v2\/posts\/11","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/seanxd.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/seanxd.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/seanxd.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/seanxd.com\/en\/wp-json\/wp\/v2\/comments?post=11"}],"version-history":[{"count":8,"href":"https:\/\/seanxd.com\/en\/wp-json\/wp\/v2\/posts\/11\/revisions"}],"predecessor-version":[{"id":939,"href":"https:\/\/seanxd.com\/en\/wp-json\/wp\/v2\/posts\/11\/revisions\/939"}],"wp:attachment":[{"href":"https:\/\/seanxd.com\/en\/wp-json\/wp\/v2\/media?parent=11"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/seanxd.com\/en\/wp-json\/wp\/v2\/categories?post=11"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/seanxd.com\/en\/wp-json\/wp\/v2\/tags?post=11"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}