{"id":342740,"date":"2022-12-15T21:00:32","date_gmt":"2022-12-15T21:00:32","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=342740"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2022-12-15T21:00:32","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=342740","title":{"rendered":"<span>\u0411\u044b\u0441\u0442\u0440\u044b\u0439 \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u044b\u0439 \u0432\u0432\u043e\u0434 \u043d\u0430 .NET<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-1\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0412\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0430, \u043a\u043e\u0433\u0434\u0430 .NET \u0431\u044b\u043b \u0437\u0430\u043a\u0440\u044b\u0442\u043e\u0439 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0435\u0439 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f Windows, \u0437\u0430 \u043d\u0438\u043c \u0438 \u044f\u0437\u044b\u043a\u043e\u043c C# \u0437\u0430\u043a\u0440\u0435\u043f\u0438\u043b\u0430\u0441\u044c \u0440\u0435\u043f\u0443\u0442\u0430\u0446\u0438\u044f \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u0442\u043b\u0438\u0447\u043d\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0431\u0438\u0437\u043d\u0435\u0441-\u0437\u0430\u0434\u0430\u0447, \u043d\u043e \u043d\u0435\u043f\u0440\u0438\u0433\u043e\u0434\u043d\u0430 \u0434\u043b\u044f \u0441\u043e\u0440\u0435\u0432\u043d\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0432\u044b\u0441\u043e\u043a\u043e\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430.<\/p>\n<p>  <\/p>\n<p>\u0427\u0430\u0441\u0442\u043e \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0441\u043b\u044b\u0448\u0430\u0442\u044c, \u0447\u0442\u043e &#171;\u0448\u0430\u0440\u043f\u044b \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u044b\u0435&#187;, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0437\u0430\u0434\u0430\u0447, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0441 <a href=\"http:\/\/timus.online\" rel=\"nofollow noopener noreferrer\">timus.online<\/a> \u0438 <a href=\"https:\/\/codeforces.com\" rel=\"nofollow noopener noreferrer\">codeforces.com<\/a>. \u0418, \u0443\u0432\u044b, \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u043b\u044b\u0448\u0430\u0442\u044c, \u043d\u043e \u0438 \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0441 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u043c\u0438, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u043c\u0438 \u0441 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044f\u043c\u0438 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b, \u043f\u043e\u043b\u0443\u0447\u0430\u044f <em>Wrong Answer, Runtime Error, Memory Limit, Time Limit<\/em> \u043f\u0440\u0438 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u043c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0435.<\/p>\n<p>  <\/p>\n<p>\u0411\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u044d\u0442\u0438\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u043a\u0440\u043e\u0435\u0442\u0441\u044f \u0432 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044f\u0445 \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u0432\u043e\u0434\u0430 \u0438 \u0432\u044b\u0432\u043e\u0434\u0430. \u0414\u0430 \u0438 \u0447\u0430\u0441\u0442\u043e \u043a\u0443\u0434\u0430 \u043f\u0440\u043e\u0449\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c <code>cin >> n<\/code>\u0438\u043b\u0438 <code>sc.nextInt()<\/code>, \u0447\u0435\u043c <code>int.Parse(Console.ReadLine())<\/code> \u0438\u043b\u0438 <code>Console.ReadLine().Split().Select(int.Parse).ToArray()<\/code>, \u0438\u0437-\u0437\u0430 \u0447\u0435\u0433\u043e \u0432\u044b\u0431\u043e\u0440 \u043f\u0430\u0434\u0430\u0435\u0442 \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u0439 \u044f\u0437\u044b\u043a.<\/p>\n<p>  <\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043e \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0451\u043d\u043d\u044b\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u0445 \u0441 \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u044b\u043c \u0432\u0432\u043e\u0434\u043e\u043c-\u0432\u044b\u0432\u043e\u0434\u043e\u043c \u0432 .NET, \u0438 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0432\u0432\u043e\u0434 \u0431\u044b\u0441\u0442\u0440\u044b\u043c \u0438 \u0443\u0434\u043e\u0431\u043d\u044b\u043c.<\/p>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<h2 id=\"plavayuschaya-zapyataya\">\u041f\u043b\u0430\u0432\u0430\u044e\u0449\u0430\u044f \u0437\u0430\u043f\u044f\u0442\u0430\u044f<\/h2>\n<p>  <\/p>\n<p>\u0418\u043d\u043e\u0433\u0434\u0430 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0438\u043b\u0438 \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u0447\u0438\u0441\u043b\u043e \u0441 \u043f\u043b\u0430\u0432\u0430\u044e\u0449\u0435\u0439 \u0442\u043e\u0447\u043a\u043e\u0439. \u041d\u043e \u043b\u0435\u0433\u043a\u043e \u0437\u0430\u0431\u044b\u0442\u044c, \u0447\u0442\u043e \u043f\u043b\u0430\u0432\u0430\u044e\u0449\u0438\u0435 \u0442\u043e\u0447\u043a\u0438 \u0432 .NET \u0431\u044b\u0432\u0430\u044e\u0442 \u0437\u0430\u043f\u044f\u0442\u044b\u043c\u0438, \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043b\u043e\u043a\u0430\u043b\u0438. \u041e\u0431 \u044d\u0442\u043e\u043c \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u043b\u0435\u0433\u043a\u043e \u0437\u0430\u0431\u044b\u0442\u044c, \u0435\u0441\u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u043e\u0439 \u043b\u043e\u043a\u0430\u043b\u044c\u044e \u0432 \u0441\u0432\u043e\u0435\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435.<\/p>\n<p>  <\/p>\n<p>\u0412\u0430\u0440\u0438\u0430\u043d\u0442\u0430 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0434\u0432\u0430:<\/p>\n<p>  <\/p>\n<ul>\n<li>\u0437\u0430\u0434\u0430\u0442\u044c \u043b\u043e\u043a\u0430\u043b\u044c \u043f\u043e\u0442\u043e\u043a\u0430: <code>Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;<\/code><\/li>\n<li>\u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c <code>CultureInfo.InvariantCulture<\/code> \u044f\u0432\u043d\u043e \u0432 \u0442\u0430\u043a\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u044b, \u043a\u0430\u043a <code>(Try)Parse<\/code> \u0438 <code>ToString<\/code><\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0432 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u043c .NET \u0435\u0441\u0442\u044c <a href=\"https:\/\/learn.microsoft.com\/en-us\/dotnet\/core\/runtime-config\/globalization\" rel=\"nofollow noopener noreferrer\">\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0440\u0430\u043d\u0442\u0430\u0439\u043c\u0430<\/a> <code>InvariantGlobalization<\/code>, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439 \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c.<\/p>\n<p>  <\/p>\n<h2 id=\"vvod-i-vyvod\">\u0412\u0432\u043e\u0434 \u0438 \u0432\u044b\u0432\u043e\u0434<\/h2>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043c, \u0447\u0442\u043e \u043d\u0430\u043c \u0434\u0430\u043d\u0430 \u043f\u0440\u043e\u0441\u0442\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430: \u043d\u0443\u0436\u043d\u043e \u0441\u0447\u0438\u0442\u0430\u0442\u044c <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/e05\/84b\/225\/e0584b2254f8fca6c52b04aa1a6c2360.svg\" alt=\"$N (N &lt;= 2*10^5)$\" data-tex=\"inline\"\/> \u0441\u0442\u0440\u043e\u043a \u043f\u043e 4 \u0447\u0438\u0441\u043b\u0430 <code>int<\/code> \u0432 \u043a\u0430\u0436\u0434\u043e\u0439 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/610\/58f\/881\/61058f88127f8c9fef8c507fed913067.svg\" alt=\"$(a_i &lt; 10^6)$\" data-tex=\"inline\"\/>, \u0447\u0438\u0441\u043b\u0430 \u0440\u0430\u0437\u0434\u0435\u043b\u0451\u043d\u044b \u043f\u0440\u043e\u0431\u0435\u043b\u0430\u043c\u0438. \u0422\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u0441\u0443\u043c\u043c\u0443 \u0447\u0438\u0441\u0435\u043b \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438.<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">int n = int.Parse(Console.ReadLine()); for (int i = 0; i &lt; n; ++i) {   var result = Console.ReadLine().Split().Select(int.Parse).Sum();   Console.WriteLine(result); }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041c\u043e\u0436\u0435\u0442 \u043b\u0438 \u0432 \u044d\u0442\u043e\u043c \u043a\u043e\u0434\u0435 \u0447\u0442\u043e-\u0442\u043e \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a \u0432\u0435\u0440\u0434\u0438\u043a\u0442\u0443, \u043e\u0442\u043b\u0438\u0447\u043d\u043e\u043c\u0443 \u043e\u0442 Accepted? \u0417\u0430\u043f\u0440\u043e\u0441\u0442\u043e.<\/p>\n<p>  <\/p>\n<h3 id=\"osobennosti-formatirovaniya\">\u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f<\/h3>\n<p>  <\/p>\n<p>\u0412 \u0443\u0441\u043b\u043e\u0432\u0438\u0438 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0441\u043a\u0430\u0437\u0430\u043d\u043e \u043f\u0440\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0440\u043e\u0431\u0435\u043b\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u044b \u0447\u0438\u0441\u043b\u0430. \u0418 \u0432 \u0438\u0442\u043e\u0433\u0435, \u0435\u0441\u043b\u0438 \u0433\u0434\u0435-\u0442\u043e \u043f\u0440\u043e\u0431\u0435\u043b\u043e\u0432 \u0431\u043e\u043b\u044c\u0448\u0435 \u043e\u0434\u043d\u043e\u0433\u043e, <code>Console.ReadLine().Split()<\/code> \u0432\u0435\u0440\u043d\u0451\u0442 \u043c\u0430\u0441\u0441\u0438\u0432, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 \u043f\u0443\u0441\u0442\u044b\u0435 \u0441\u0442\u0440\u043e\u043a\u0438. \u0410 <code>int.Parse<\/code> \u0443\u043f\u0430\u0434\u0451\u0442 \u0441 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c, \u0447\u0442\u043e \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u0442 \u043a \u0432\u0435\u0440\u0434\u0438\u043a\u0442\u0443 <strong>Runtime Error<\/strong>. \u041c\u043e\u0436\u0435\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0433\u043e \u043d\u0435 \u0431\u044b\u0432\u0430\u0435\u0442 \u043d\u0430 \u043a\u043e\u043d\u0442\u0435\u0441\u0442\u0430\u0445, \u043d\u043e \u0443\u0432\u044b, \u0441\u043b\u0443\u0447\u0430\u0439 \u0432\u043f\u043e\u043b\u043d\u0435 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0439.<\/p>\n<p>  <\/p>\n<p>\u0418\u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u043a\u043e\u0434:<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">int n = int.Parse(Console.ReadLine()); for (int i = 0; i &lt; n; ++i) {   var result = Console.ReadLine()     .Split(' ', StringSplitOptions.RemoveEmptyEntries)     .Select(int.Parse)     .Sum();    Console.WriteLine(result); }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041d\u0435\u043f\u0440\u0438\u044f\u0442\u043d\u044b\u0439 \u043d\u044e\u0430\u043d\u0441, \u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043d\u0430\u0434\u043e \u043f\u043e\u043c\u043d\u0438\u0442\u044c. \u041a\u0441\u0442\u0430\u0442\u0438, \u0435\u0441\u043b\u0438 \u0440\u0430\u043d\u044c\u0448\u0435 \u043a\u043e\u0434 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043b \u0432\u0441\u0435 \u043f\u0440\u043e\u0431\u0435\u043b\u044c\u043d\u044b\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u044b \u043a\u0430\u043a \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u0438, \u0442\u043e \u0442\u0435\u043f\u0435\u0440\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u043e\u0431\u0435\u043b\u044b. \u0418\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043c\u043e\u0436\u043d\u043e, \u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0447\u0443\u0442\u044c \u0434\u043b\u0438\u043d\u043d\u0435\u0435.<\/p>\n<p>  <\/p>\n<p>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438 \u043f\u043e\u0441\u0442\u0440\u043e\u0447\u043d\u043e\u043c \u0447\u0442\u0435\u043d\u0438\u0438 \u0432\u0432\u043e\u0434\u0430. \u0412 \u044f\u0437\u044b\u043a\u0430\u0445, \u0433\u0434\u0435 \u0435\u0441\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u044b\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u0434\u043b\u044f \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u0441 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u0447\u0438\u0441\u0435\u043b (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 <code>int n; cin >> n<\/code>), \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u043d\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u0432\u043e\u043e\u0431\u0449\u0435.<\/p>\n<p>  <\/p>\n<h3 id=\"console-flush\">Console Flush<\/h3>\n<p>  <\/p>\n<p>\u041f\u043e\u0442\u043e\u043a\u0438 \u0432\u0432\u043e\u0434\u0430 \u0438 \u0432\u044b\u0432\u043e\u0434\u0430 stdin\/stdout\/stderr \u0443\u0441\u0442\u0440\u043e\u0435\u043d\u044b \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0431\u0443\u0444\u0435\u0440\u0430 \u0432 \u043f\u0430\u043c\u044f\u0442\u0438, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0434\u0438\u043d \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435, \u0430 \u0434\u0440\u0443\u0433\u043e\u0439 \u2014 \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c. \u041e\u0431\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u043a \u044d\u0442\u043e\u043c\u0443 \u0431\u0443\u0444\u0435\u0440\u0443 \u0440\u0430\u0434\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0431\u0430\u0439\u0442 \u2014 \u0434\u043e\u0440\u043e\u0433\u043e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u043b\u044f \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438 \u043a\u0430\u0436\u0434\u044b\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043c\u043e\u0436\u0435\u0442 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0431\u0443\u0444\u0435\u0440\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u0432\u043e\u0434\/\u0432\u044b\u0432\u043e\u0434. \u041f\u0440\u043e\u0434\u0432\u0438\u0436\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0431\u0443\u0444\u0435\u0440 \u043f\u043e\u0442\u043e\u043a\u0430 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043b\u0438\u0431\u043e \u043f\u0440\u0438 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e, \u043b\u0438\u0431\u043e \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 <code>.Flush()<\/code>.<\/p>\n<p>  <\/p>\n<p>\u0412\u044b\u0437\u043e\u0432 <code>.Flush()<\/code> \u0438\u043c\u0435\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0441\u043c\u044b\u0441\u043b \u0434\u043b\u044f \u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0445 \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u2014 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0432\u044b\u0432\u043e\u0434 \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435 \u0441\u0440\u0430\u0437\u0443, \u0430 \u043d\u0435 \u043a\u043e\u043f\u0438\u0442\u044c \u0435\u0433\u043e \u0432 \u043f\u0430\u043c\u044f\u0442\u0438. \u0411\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u0430\u0434\u0430\u043f\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u043f\u043e\u0434 \u044d\u0442\u043e\u0442 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0439 \u0438 \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0442 <code>.Flush()<\/code> \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u043e\u0441\u043b\u0435 \u043a\u0430\u0436\u0434\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438.<\/p>\n<p>  <\/p>\n<blockquote><p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0431\u044b\u0432\u0430\u044e\u0442 \u0438 \u0437\u0430\u0434\u0430\u0447\u0438, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0439 \u0432\u0432\u043e\u0434-\u0432\u044b\u0432\u043e\u0434 (request-response \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u043a\u0430). \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0437\u0430\u0434\u0430\u0447\u0438, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u044c \u043e\u0442\u0432\u0435\u0442, \u0437\u0430\u0434\u0430\u0432\u0430\u044f &#171;\u0432\u043e\u043f\u0440\u043e\u0441\u044b&#187; \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u044e\u0449\u0435\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 (\u043f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u2014 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430, \u0443\u0433\u0430\u0434\u044b\u0432\u0430\u044e\u0449\u0435\u0435 \u0441\u043b\u043e\u0432\u043e \u0432 \u0443\u0441\u043b\u043e\u0432\u043d\u043e\u043c &#171;\u041f\u043e\u043b\u0435 \u0447\u0443\u0434\u0435\u0441&#187;, &#171;\u043e\u0431\u0449\u0430\u044e\u0449\u0430\u044f\u0441\u044f&#187; \u0441 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043e\u0439-\u0432\u0435\u0434\u0443\u0449\u0438\u043c)<\/p><\/blockquote>\n<p>\u0427\u0442\u043e\u0431\u044b \u0441\u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0442\u044c \u043d\u0430 Flush, \u0432 C++ iostreams \u043f\u0438\u0448\u0443\u0442:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">std::ios::sync_with_stdio(false); std::cin.tie(nullptr);<\/code><\/pre>\n<p>  <\/p>\n<p>\u0410 \u0432 C# \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>StreamWriter<\/code> \u0434\u043b\u044f <code>stdout<\/code> \u0432\u043c\u0435\u0441\u0442\u043e <code>Console<\/code>:<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">const int bufferSize = 16384; using var input = new StreamReader(   Console.OpenStandardInput(), bufferSize: bufferSize); using var output = new StreamWriter(   Console.OpenStandardOutput(), bufferSize: bufferSize);  int n = int.Parse(input.ReadLine()); for (int i = 0; i &lt; n; ++i) {   var result = input.ReadLine()     .Split(' ', StringSplitOptions.RemoveEmptyEntries)     .Select(int.Parse)     .Sum();    output.WriteLine(result); }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u0438\u043c, \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043b\u0438 <code>.Flush()<\/code> \u0432\u043b\u0438\u044f\u043d\u0438\u0435 \u043d\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0437\u0430\u043c\u0435\u0440\u0430\u043c\u0438. \u0412\u0435\u0440\u0441\u0438\u044f \u0441 <code>Console.WriteLine<\/code> \u043e\u0442\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u043d\u0430 \u043c\u043e\u0451\u043c \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0435 \u0437\u0430 <strong>~490ms<\/strong>, \u0430 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c <code>StreamWriter<\/code> \u2014 \u0437\u0430 <strong>105ms<\/strong>. \u0422.\u0435. \u043f\u0440\u0438\u0447\u0438\u043d\u0430 \u043f\u043b\u043e\u0445\u043e\u0439 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043e\u043a\u0430\u0437\u0430\u043b\u0430\u0441\u044c \u0432\u043e\u0432\u0441\u0435 \u043d\u0435 \u0432 LINQ. \u0412 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u044e\u0449\u0435\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 c \u0431\u043e\u043b\u0435\u0435 \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u044b\u043c \u0436\u0435\u043b\u0435\u0437\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c <em>Time Limit Exceed<\/em>, \u0435\u0441\u043b\u0438 \u043d\u0435 \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 <code>.Flush()<\/code>. \u041a\u0441\u0442\u0430\u0442\u0438, \u043d\u0430 \u0437\u0430\u043c\u0435\u0442\u043a\u0443, \u0432 \u044d\u043d\u0442\u0435\u0440\u043f\u0440\u0430\u0439\u0437 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0442\u043e\u0436\u0435 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0435\u0442\u0441\u044f \u2014 \u0432 \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438.<\/p>\n<p>  <\/p>\n<p>\u0417\u0430\u043c\u0435\u0440\u044f\u043b \u043d\u0430 Linux, \u0440\u0430\u043d\u0442\u0430\u0439\u043c .NET 7 NativeAOT \u2014 \u0442\u0430\u043a \u0434\u043e\u0441\u0442\u0438\u0433\u0430\u0435\u0442\u0441\u044f \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u043e\u0432\u0435\u0440\u0445\u0435\u0434 \u043d\u0430 \u0441\u0442\u0430\u0440\u0442\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b, \u043f\u043e\u0440\u044f\u0434\u043a\u0430 1.5 ms. \u041d\u0430 Windows \u043a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u0441\u0442\u0430\u0440\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0431\u044b\u043b \u0431\u044b \u043f\u043e\u0440\u044f\u0434\u043a\u0430 10 ms, \u0434\u0430\u0436\u0435 \u0434\u043b\u044f C++.<\/p>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u0447\u0442\u0435\u043d\u0438\u044f \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>StreamReader<\/code> \u0432\u043c\u0435\u0441\u0442\u043e <code>Console<\/code>. \u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0442\u044c \u043d\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0435, \u043d\u0435 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d \u043b\u0438 <code>Console.In<\/code> \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u043c \u0447\u0442\u0435\u043d\u0438\u0438 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u043d\u044b\u0439 \u0431\u0443\u0444\u0435\u0440, \u043d\u043e \u0432\u044b\u0438\u0433\u0440\u044b\u0448 \u043a\u0443\u0434\u0430 \u043c\u0435\u043d\u0435\u0435 \u0432\u043f\u0435\u0447\u0430\u0442\u043b\u044f\u044e\u0449\u0438\u0439 \u2014 \u0435\u0434\u0438\u043d\u0438\u0446\u044b \u043c\u0438\u043b\u043b\u0438\u0441\u0435\u043a\u0443\u043d\u0434<\/p>\n<p>  <\/p>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0437\u0430\u0434\u0430\u0432\u0430\u0442\u044c \u0440\u0430\u0437\u043c\u0435\u0440 \u0431\u0443\u0444\u0435\u0440\u0430 \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u043e\u043c\u0443 \u0441\u0442\u0440\u0438\u043c\u0443 \u043d\u0435\u0442 \u0441\u043c\u044b\u0441\u043b\u0430 \u2014 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u043f\u043e\u043f\u0440\u043e\u0441\u0442\u0443 \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f<\/p>\n<p>  <\/p>\n<h2 id=\"zadacha-na-vvod-allokacii\">\u0417\u0430\u0434\u0430\u0447\u0430 \u043d\u0430 \u0432\u0432\u043e\u0434: \u0430\u043b\u043b\u043e\u043a\u0430\u0446\u0438\u0438<\/h2>\n<p>  <\/p>\n<p>\u0417\u0430\u0434\u0430\u0447\u0430 <a href=\"https:\/\/timus.online\/problem.aspx?space=1&amp;num=1510&amp;locale=ru\" rel=\"nofollow noopener noreferrer\">1510<\/a> \u0441 \u0422\u0438\u043c\u0443\u0441\u0430. \u0414\u043b\u044f \u044d\u0442\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u0435\u0441\u0442\u044c \u0434\u0432\u0430 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u2014 \u0437\u0430 \u043b\u0438\u043d\u0438\u044e \u0438 \u0441 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u043e\u0439. \u0415\u0451 \u0432\u0441\u0435 \u0441\u0434\u0430\u044e\u0442 \u043b\u0435\u0433\u043a\u043e \u043d\u0430 \u0442\u043e\u043c \u0436\u0435 C++, \u043d\u043e \u043d\u0430 C# \u0434\u0430\u0436\u0435 \u0441 \u0443\u043c\u043d\u044b\u043c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u043c \u0438\u0437-\u0437\u0430 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0435\u0439 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0433\u043e \u0432\u0432\u043e\u0434\u0430 \u0431\u0443\u0434\u0435\u0442 <em>Memory Limit Exceed<\/em>. \u041f\u043e\u0447\u0435\u043c\u0443?<\/p>\n<p>  <\/p>\n<p>\u0412 \u0437\u0430\u0434\u0430\u0447\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d Memory Limit \u0432 16 MB. \u0417\u0430\u0447\u0435\u043c? \u041d\u0435 \u0437\u043d\u0430\u044e, \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0432\u0441\u0435 \u0447\u0438\u0441\u043b\u0430 \u0432 \u043f\u0430\u043c\u044f\u0442\u0438 \u0438 \u043e\u0442\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u043d \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u043c\u0435\u0448\u0430\u0435\u0442, \u0432\u0435\u0434\u044c 500000 \u0447\u0438\u0441\u0435\u043b \u043f\u043e 4 \u0431\u0430\u0439\u0442\u0430 \u2014 \u0432\u0441\u0435\u0433\u043e \u043b\u0438\u0448\u044c 2 MB. \u041d\u043e \u0432 C# \u0447\u0442\u0435\u043d\u0438\u0435 \u0432\u0432\u043e\u0434\u0430 \u0447\u0435\u0440\u0435\u0437 <code>Console.ReadLine<\/code> \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u0430\u043b\u043b\u043e\u043a\u0430\u0446\u0438\u0438 \u0441\u0442\u0440\u043e\u043a. \u0410 <em>\u0441\u0442\u0440\u043e\u043a\u0430<\/em> \u0441 \u0447\u0438\u0441\u043b\u043e\u043c \u0438\u0437 10 \u0446\u0438\u0444\u0440, \u044d\u0442\u043e \u043d\u0435 4 \u0431\u0430\u0439\u0442\u0430, \u0430, \u043a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c:<\/p>\n<p>  <\/p>\n<ul>\n<li>16 \u0431\u0430\u0439\u0442 \u043d\u0430 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0438 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 Method Table<\/li>\n<li>4 \u0431\u0430\u0439\u0442\u0430 \u043d\u0430 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0434\u043b\u0438\u043d\u044b<\/li>\n<li>20 \u0431\u0430\u0439\u0442 \u043d\u0430 10 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u0432 UTF-16<\/li>\n<li>2 \u0431\u0430\u0439\u0442\u0430 \u043d\u0430 null terminator \u0434\u043b\u044f \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u0438 \u0441 \u043d\u0430\u0442\u0438\u0432\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c, \u0435\u0433\u043e \u043e\u0436\u0438\u0434\u0430\u044e\u0449\u0438\u043c<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u0422.\u0435. \u0443\u0436\u0435 42 \u0431\u0430\u0439\u0442\u0430 \u043d\u0430 10 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432. \u0410 500000 \u0440\u0430\u0437 \u043f\u043e 42 \u0431\u0430\u0439\u0442\u0430 \u2014 \u044d\u0442\u043e \u0443\u0436\u0435 21 MB.<\/p>\n<p>  <\/p>\n<p>\u041d\u043e \u043e\u043d\u0438 \u0436\u0435 \u043a\u043e\u0440\u043e\u0442\u043a\u043e\u0436\u0438\u0432\u0443\u0449\u0438\u0435?! \u0427\u0438\u0442\u0430\u0435\u043c \u0441\u0442\u0440\u043e\u043a\u0443, \u0441\u0440\u0430\u0437\u0443 \u043f\u0430\u0440\u0441\u0438\u043c, GC \u043a\u0430\u043a-\u043d\u0438\u0431\u0443\u0434\u044c \u0441\u043e\u0431\u0435\u0440\u0451\u0442. \u041d\u043e \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0435 GC \u2014 \u043d\u0435 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e, \u043e\u0441\u0432\u043e\u0431\u043e\u0436\u0434\u0435\u043d\u0438\u0435 \u043f\u0430\u043c\u044f\u0442\u0438 \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u0432 \u041e\u0421 \u2014 \u0442\u043e\u0436\u0435, \u0430 \u043f\u0440\u0438\u043d\u0443\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0432\u044b\u0437\u043e\u0432 \u0447\u0435\u0440\u0435\u0437 <code>GC.Collect()<\/code> \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u0443\u0436\u0435 \u043a <em>Time Limit Exceed<\/em>.<\/p>\n<p>  <\/p>\n<p>\u041a\u0430\u043a \u0436\u0435 \u0431\u044b\u0442\u044c? \u041f\u0438\u0441\u0430\u0442\u044c \u0432\u0432\u043e\u0434 \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e<\/p>\n<p>  <\/p>\n<h2 id=\"kastomnyy-vvod\">\u041a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0439 \u0432\u0432\u043e\u0434<\/h2>\n<p>  <\/p>\n<h3 id=\"dedovskoe-reshenie\">\u0414\u0435\u0434\u043e\u0432\u0441\u043a\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435<\/h3>\n<p>  <\/p>\n<p>\u041f\u043e <a href=\"https:\/\/habr.com\/ru\/post\/246257\/\">C++<\/a> \u0432\u0441\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0441 <a href=\"https:\/\/codeforces.com\/blog\/entry\/8080?#comment-138179\" rel=\"nofollow noopener noreferrer\">\u043f\u043e\u0441\u0438\u043c\u0432\u043e\u043b\u044c\u043d\u044b\u043c<\/a> <a href=\"https:\/\/www.google.com\/search?q=c%252B%252B+fastscan+getchar_unlocked\" rel=\"nofollow noopener noreferrer\">\u0447\u0442\u0435\u043d\u0438\u0435\u043c<\/a> \u0447\u0438\u0441\u0435\u043b.<\/p>\n<p>  <\/p>\n<p>\u041f\u0435\u0440\u0435\u043f\u0438\u0448\u0435\u043c \u0435\u0433\u043e \u043d\u0430 C# \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c <code>Console.Read()<\/code>, \u0430 \u043b\u0443\u0447\u0448\u0435 \u2014 <code>StreamReader.Read()<\/code>. \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>StreamReader<\/code> \u043e\u043f\u0440\u0430\u0432\u0434\u0430\u043d\u043e, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043e\u0431\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u043a <code>Console<\/code> \u043d\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u0441\u0438\u043c\u0432\u043e\u043b \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0434\u043e\u0440\u043e\u0436\u0435, \u0447\u0435\u043c \u043d\u0430 \u043a\u0430\u0436\u0434\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 <code>ReadLine<\/code>.<\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0437\u0430\u0434\u0430\u0447\u0430 \u043d\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u0438\u043a\u0430\u043a\u043e\u0439 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438. \u041d\u0430 \u043c\u043e\u0451\u043c \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0435 \u043f\u043e\u0441\u0438\u043c\u0432\u043e\u043b\u044c\u043d\u043e\u0435 \u0447\u0442\u0435\u043d\u0438\u0435 \u043e\u0442\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0432 3 \u0440\u0430\u0437\u0430 \u0431\u044b\u0441\u0442\u0440\u0435\u0435, \u0447\u0435\u043c \u0441 <code>Console.ReadLine()<\/code>.<\/p>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">fastscan<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cs\">StreamReader reader = new StreamReader(Console.OpenStandardInput(), bufferSize: 32768);  int fastscan() {     bool negative = false;     bool read_start = false;      int number = 0;      while (true)     {         int c = reader.Read();          if (c=='-')         {             negative = true;             read_start = true;             continue;         }          if (c>47 &amp;&amp; c&lt;58)         {             number = number * 10 + (c - 48);             read_start = true;             continue;         }          if (read_start)             break;     }      if (negative)         number *= -1;     return number; }<\/code><\/pre>\n<\/div><\/div>\n<p>  <\/p>\n<p>\u0420\u0435\u0448\u0435\u043d\u0438\u0435, \u043e\u0434\u043d\u0430\u043a\u043e, \u043d\u0435 \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e. \u042d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f \u0446\u0435\u043b\u044b\u0445 \u0447\u0438\u0441\u0435\u043b, \u0430 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0439 \u043f\u0430\u0440\u0441\u0438\u043d\u0433 \u0447\u0438\u0441\u0435\u043b \u0441 \u043f\u043b\u0430\u0432\u0430\u044e\u0449\u0435\u0439 \u0442\u043e\u0447\u043a\u043e\u0439 \u043d\u0435\u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u043e, \u043b\u0435\u0433\u043a\u043e \u043f\u043e\u043f\u0430\u0441\u0442\u044c \u043d\u0430 \u0433\u0440\u0430\u043d\u0438\u0447\u043d\u044b\u0435 \u0441\u043b\u0443\u0447\u0430\u0438 \u0438 \u043e\u0448\u0438\u0431\u0438\u0442\u044c\u0441\u044f \u0441 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c\u044e. \u0427\u0442\u043e\u0431\u044b \u044d\u0442\u043e \u043f\u043e\u043d\u044f\u0442\u044c, \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c <a href=\"https:\/\/github.com\/dotnet\/runtime\/pull\/62301\" rel=\"nofollow noopener noreferrer\">Pull Request<\/a>.<\/p>\n<p>  <\/p>\n<h3 id=\"tiktokerskoehttpsdotnextrutalks9bdd39ee9a554ce2b76272ac303ae227-reshenie\"><a href=\"https:\/\/dotnext.ru\/talks\/9bdd39ee9a554ce2b76272ac303ae227\/\" rel=\"nofollow noopener noreferrer\">\u0422\u0438\u043a\u0442\u043e\u043a\u0435\u0440\u0441\u043a\u043e\u0435<\/a> \u0440\u0435\u0448\u0435\u043d\u0438\u0435<\/h3>\n<p>  <\/p>\n<p>\u0412 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u043c .NET \u0435\u0441\u0442\u044c \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043a\u0438 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 <code>Parse<\/code> \u0438 <code>TryParse<\/code> \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0449\u0438\u0435 <code>ReadOnlySpan&lt;char><\/code> \u0432\u043c\u0435\u0441\u0442\u043e \u0441\u0442\u0440\u043e\u043a\u0438. \u0412\u043c\u0435\u0441\u0442\u043e \u0440\u0443\u0447\u043d\u043e\u0433\u043e \u043f\u0430\u0440\u0441\u0438\u043d\u0433\u0430 \u0447\u0438\u0441\u0435\u043b, \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u0441 \u0447\u0438\u0441\u043b\u043e\u043c \u0432 \u0431\u0443\u0444\u0435\u0440 \u0438 \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u0434\u043b\u044f \u043f\u0430\u0440\u0441\u0438\u043d\u0433\u0430.<\/p>\n<p>  <\/p>\n<p>\u042d\u0442\u043e \u0440\u0435\u0448\u0438\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0441 \u043f\u0430\u0440\u0441\u0438\u043d\u0433\u043e\u043c \u0447\u0438\u0441\u0435\u043b \u0441 \u043f\u043b\u0430\u0432\u0430\u044e\u0449\u0435\u0439 \u0442\u043e\u0447\u043a\u043e\u0439 &#171;\u0434\u0435\u0434\u043e\u0432\u0441\u043a\u043e\u0433\u043e&#187; \u0440\u0435\u0448\u0435\u043d\u0438\u044f, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0441\u0434\u0435\u043b\u0430\u0435\u0442 \u0432\u0432\u043e\u0434 \u043a\u043e\u0434\u0430 \u0443\u0434\u043e\u0431\u043d\u0435\u0435, \u0438\u0437\u0431\u0430\u0432\u0438\u0432 \u043e\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u0432\u0438\u0434\u0430 <code>Console.ReadLine().Split().Select(int.Parse).ToArray()<\/code>. \u0421\u0430\u043c \u043a\u043e\u0434 \u043d\u0430\u0441\u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u043e\u0441\u0442, \u0447\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043b\u0435\u0433\u043a\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043d \u043f\u0440\u044f\u043c\u043e \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u043e\u043d\u0442\u0435\u0441\u0442\u0430 (\u043d\u043e \u043d\u0435 \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0435\u0440\u0435\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0431\u0443\u0444\u0435\u0440\u0430, \u0435\u0441\u043b\u0438 \u0432\u0430\u043c \u044d\u0442\u043e \u0432\u0430\u0436\u043d\u043e):<\/p>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">SpanScanner<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cs\">class Scanner {   StreamReader input = new(Console.OpenStandardInput(), bufferSize: 16384);   char[] buffer = new char[4096];    public int ReadInt()   {     var length = PrepareToken();     return int.Parse(buffer.AsSpan(0, length));   }    private int PrepareToken()   {     int length = 0;     bool readStart = false;     while (true)     {       int ch = input.Read();       if (ch == -1)         break;        if (char.IsWhiteSpace((char)ch))       {         if (readStart) break;         continue;       }        readStart = true;       buffer[length++] = (char)ch;     }      return length;   } }<\/code><\/pre>\n<\/div><\/div>\n<p>  <\/p>\n<div class=\"scrollable-table\">\n<table>\n<thead>\n<tr>\n<th>Program<\/th>\n<th>Lang<\/th>\n<th>Compiler<\/th>\n<th>Mean (Int)<\/th>\n<th>Mean (Double)<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>fastscan<\/td>\n<td>C++<\/td>\n<td>g++64<\/td>\n<td>14 ms<\/td>\n<td>&#8212;<\/td>\n<\/tr>\n<tr>\n<td>fastscan<\/td>\n<td>C#<\/td>\n<td>NativeAOT<\/td>\n<td>22 ms<\/td>\n<td>&#8212;<\/td>\n<\/tr>\n<tr>\n<td>Span<\/td>\n<td>C#<\/td>\n<td>NativeAOT<\/td>\n<td>38 ms<\/td>\n<td>85 ms<\/td>\n<\/tr>\n<tr>\n<td>cin<\/td>\n<td>C++<\/td>\n<td>g++64<\/td>\n<td>38 ms<\/td>\n<td>101 ms<\/td>\n<\/tr>\n<tr>\n<td>scanf<\/td>\n<td>C++<\/td>\n<td>g++64<\/td>\n<td>44 ms<\/td>\n<td>70 ms<\/td>\n<\/tr>\n<tr>\n<td>Console.ReadLine<\/td>\n<td>C#<\/td>\n<td>NativeAOT<\/td>\n<td>64 ms<\/td>\n<td>117 ms<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>  <\/p>\n<p>\u0414\u0430, \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u0435\u0435 &#171;\u0434\u0435\u0434\u043e\u0432\u0441\u043a\u043e\u0433\u043e&#187; \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430, \u043d\u043e \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u0441 \u043e\u0431\u0449\u0435\u043f\u0440\u0438\u043d\u044f\u0442\u044b\u043c\u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c\u0438 \u0432\u0432\u043e\u0434\u0430, \u043d\u0435 \u0430\u043b\u043b\u043e\u0446\u0438\u0440\u0443\u0435\u0442 memory traffic, \u0438 \u0443\u0436 \u0442\u043e\u0447\u043d\u043e \u043d\u0435 \u0441\u0442\u0430\u043d\u0435\u0442 \u043f\u0440\u0438\u0447\u0438\u043d\u043e\u0439 \u043f\u043e\u043f\u0430\u0434\u0430\u043d\u0438\u044f \u0432 <em>Time<\/em> \u0438\u043b\u0438 <em>Memory<\/em> Limit.<\/p>\n<p>  <\/p>\n<blockquote><p>\u041d\u0430 C++ \u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u044f\u0437\u044b\u043a\u0430\u0445 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0438 <a href=\"https:\/\/habr.com\/ru\/post\/246257\/\">\u0431\u043e\u043b\u0435\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u044b\u0435<\/a> \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u0432\u043e\u0434\u0430. <code>scanf<\/code> \u0438 <code>cin<\/code> \u0432\u0437\u044f\u0442\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u0447\u0442\u0435\u043d\u0438\u044f \u0432\u0432\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0431\u044b\u0447\u043d\u043e \u0443\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0432 \u043f\u0440\u0435\u0434\u0435\u043b\u044b Time Limit<\/p><\/blockquote>\n<p>\u0414\u043b\u044f .NET 7 \u0438 C# 11 \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c generic \u0432\u0435\u0440\u0441\u0438\u044e \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 <code>ISpanParsable&lt;TSelf><\/code>. \u041f\u0440\u0430\u0432\u0434\u0430, \u0432 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u044e\u0449\u0438\u0445 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0445 C# 11 \u0435\u0449\u0451 \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f.<\/p>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">SpanParsableScanner<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cs\">class Scanner {   StreamReader input = new(Console.OpenStandardInput(), bufferSize: 16384);   char[] buffer = new char[4096];    public T Read&lt;T>() where T : ISpanParsable&lt;T>   {     var length = PrepareToken();     return T.Parse(buffer.AsSpan(0, length), CultureInfo.InvariantCulture);   }    private int PrepareToken()   {     int length = 0;     bool readStart = false;     while (true)     {       int ch = input.Read();       if (ch == -1)         break;        if (char.IsWhiteSpace((char)ch))       {         if (readStart) break;         continue;       }        readStart = true;       buffer[length++] = (char)ch;     }      return length;   } }<\/code><\/pre>\n<\/div><\/div>\n<p>  <\/p>\n<p>\u0422\u0430\u043a\u0436\u0435 \u044f \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u043b \u0431\u043e\u043b\u0435\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043a\u043e\u0434\u0430 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 <code>TryParse(ReadOnlySpan&lt;char>)<\/code>, \u043d\u043e \u043e\u043d <a href=\"https:\/\/github.com\/epeshk\/epeshk.text\/blob\/master\/Epeshk.Text\/TextScanner%601.cs\" rel=\"nofollow noopener noreferrer\">\u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0434\u043b\u0438\u043d\u043d\u044b\u0439<\/a>, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c\u0441\u044f \u0437\u0434\u0435\u0441\u044c. \u041e\u043d \u0440\u0430\u0437\u0433\u043e\u043d\u044f\u0435\u0442\u0441\u044f \u0432 \u043c\u043e\u0451\u043c \u0442\u0435\u0441\u0442\u0435 \u0434\u043e 24 \u043c\u0441 \u0437\u0430 \u0441\u0447\u0451\u0442 \u0447\u0442\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0431\u043b\u043e\u043a\u0430\u043c\u0438.<\/p>\n<p>  <\/p>\n<h3 id=\"otkazyvaemsya-ot-streamreader\">\u041e\u0442\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u0441\u044f \u043e\u0442 StreamReader<\/h3>\n<p>  <\/p>\n<p><code>StreamReader<\/code> \u2014 \u043f\u0440\u043e\u0441\u043b\u043e\u0439\u043a\u0430 \u043c\u0435\u0436\u0434\u0443 Console Stream, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0431\u044b\u0447\u043d\u043e \u043f\u043e\u043f\u0430\u0434\u0430\u044e\u0442 ASCII-\u0441\u0438\u043c\u0432\u043e\u043b\u044b \u0438 .NET-\u0441\u0442\u0440\u043e\u043a\u0430\u043c\u0438 \u0432 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u043a\u0435 UTF-16. \u041f\u0435\u0440\u0435\u0434\u0435\u043b\u0430\u0435\u043c \u043a\u043e\u0434 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u043e <code>Stream<\/code> \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e.<\/p>\n<p>  <\/p>\n<p>\u041c\u0435\u0442\u043e\u0434 \u0434\u043b\u044f \u043f\u0430\u0440\u0441\u0438\u043d\u0433\u0430, \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0449\u0438\u0439 <code>ReadOnlySpan&lt;char><\/code> \u0443\u0436\u0435 \u043d\u0435 \u043f\u043e\u0434\u043e\u0439\u0434\u0451\u0442. \u041a \u0441\u0447\u0430\u0441\u0442\u044c\u044e, \u0432 .NET \u0435\u0441\u0442\u044c \u043a\u043b\u0430\u0441\u0441 \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c <code>Utf8Parser<\/code>\u2014 \u043d\u0430\u0441\u043b\u0435\u0434\u0438\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 <code>System.Text.Json<\/code>, \u0440\u0435\u0448\u0430\u044e\u0449\u0435\u0435 \u0442\u0443 \u0436\u0435 \u0437\u0430\u0434\u0430\u0447\u0443 \u0434\u043b\u044f \u0441\u043f\u0430\u043d\u0430 \u0431\u0430\u0439\u0442\u043e\u0432. \u041d\u0435 \u043e\u0431\u043c\u0430\u043d\u044b\u0432\u0430\u0439\u0442\u0435\u0441\u044c \u0442\u0435\u043c, \u0447\u0442\u043e \u0432 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0438 \u0435\u0441\u0442\u044c <code>Utf8<\/code> \u2014 \u043f\u0430\u0440\u0441\u0438\u0442\u044c \u0432\u0441\u0435 <a href=\"https:\/\/en.wikipedia.org\/wiki\/Numerals_in_Unicode\" rel=\"nofollow noopener noreferrer\">100500 \u0446\u0438\u0444\u0440<\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0435\u0441\u0442\u044c \u0432 Unicode \u043e\u043d \u043d\u0435 \u0443\u043c\u0435\u0435\u0442. \u0417\u0430\u0442\u043e \u0441 \u043e\u0431\u044b\u0447\u043d\u044b\u043c\u0438 ASCII-\u0446\u0438\u0444\u0440\u0430\u043c\u0438 \u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u0443\u0440\u0430!<\/p>\n<p>  <\/p>\n<p>\u0414\u043e\u0441\u0442\u043e\u0438\u043d\u0441\u0442\u0432\u043e <code>Utf8Parser.TryParse<\/code> \u0432 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0438 \u0441 <code>T.TryParse<\/code>\u2014 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u0430\u0440\u0441\u0438\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0441 \u043f\u0440\u0435\u0444\u0438\u043a\u0441\u0430, \u0431\u0435\u0437 \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0442\u043e\u043a\u0435\u043d\u0430. \u0421\u0440\u0430\u0432\u043d\u0438\u0442\u0435:<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">bool TryParse(ReadOnlySpan&lt;char> span, out int value, IFormatProvider provider); bool TryParse(ReadOnlySpan&lt;byte> span, out int value, out int bytesConsumed, char format='\\0')<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0435\u0440\u0432\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u0437\u0430\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u0437\u0430\u0433\u043b\u044f\u043d\u0443\u0442\u044c \u0432\u043f\u0435\u0440\u0451\u0434 \u0438 \u043d\u0430\u0439\u0442\u0438 \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044c. \u0417\u0430\u0442\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u0447\u0438\u0442\u0430\u044e\u0442\u0441\u044f \u0441\u043d\u043e\u0432\u0430 \u0434\u043b\u044f \u043f\u0430\u0440\u0441\u0438\u043d\u0433\u0430.<\/p>\n<p>  <\/p>\n<p>\u0412\u0442\u043e\u0440\u043e\u0439 \u0436\u0435 \u0443\u043c\u0435\u0435\u0442 \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u0440\u0438 \u043f\u0430\u0440\u0441\u0438\u043d\u0433\u0435 \u0442\u043e\u043a\u0435\u043d\u0430 \u0441\u0430\u043c, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044f \u0440\u0430\u0441\u043f\u0430\u0440\u0441\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0437\u0430 \u043e\u0434\u0438\u043d \u043f\u0440\u043e\u0445\u043e\u0434 \u043f\u043e \u0431\u0443\u0444\u0435\u0440\u0443.<\/p>\n<p>  <\/p>\n<p>\u0422.\u043a. <code>Utf8Parser<\/code> \u2014 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0443\u0437\u043a\u043e\u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441, \u043e\u043d \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 <code>IFormatProvider<\/code> \u0438 \u043b\u043e\u043a\u0430\u043b\u0438. \u041d\u043e \u043d\u0430\u043c \u044d\u0442\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0440\u0430\u0434\u043e\u0441\u0442\u044c \u2014 \u0434\u0435\u0441\u044f\u0442\u0438\u0447\u043d\u0430\u044f \u0437\u0430\u043f\u044f\u0442\u0430\u044f \u043d\u0430\u043c \u0437\u0434\u0435\u0441\u044c \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u043f\u043e\u043c\u0435\u0448\u0430\u0435\u0442.<\/p>\n<p>  <\/p>\n<p>\u041f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 <code>Utf8Parser<\/code> \u043d\u0443\u0436\u043d\u043e \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0431\u0443\u0444\u0435\u0440\u0435 \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u043c\u0430\u043b\u043e \u2014 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043c\u043e\u0436\u0435\u0442 \u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u043d\u0435\u0432\u0435\u0440\u043d\u044b\u043c. \u0415\u0441\u043b\u0438 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u0438\u0437 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0445 \u0442\u043e\u043a\u0435\u043d\u043e\u0432 \u0440\u0430\u0437\u043e\u0431\u044c\u0451\u0442\u0441\u044f \u043d\u0430 \u0434\u0432\u0430 \u0440\u0430\u0437\u043d\u044b\u0445 \u0447\u0442\u0435\u043d\u0438\u044f \u0438\u0437 \u043f\u043e\u0442\u043e\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 <code>[.........12][34...........]<\/code>, \u0442\u043e <code>Utf8Parser<\/code> \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0435\u0442 \u044d\u0442\u043e\u0442 \u0442\u043e\u043a\u0435\u043d \u043a\u0430\u043a \u0434\u0432\u0430 \u0440\u0430\u0437\u043d\u044b\u0445 \u0447\u0438\u0441\u043b\u0430 \u2014 12 \u0438 34. \u0418\u043b\u0438 \u0436\u0435 \u0434\u043b\u044f <code>[........1e][7.......]<\/code> \u0432\u0435\u0440\u043d\u0451\u0442\u0441\u044f <code>false<\/code> \u0434\u043b\u044f <code>1e<\/code>, \u0438 \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u0434\u0435\u043b\u0430\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443: \u0438\u043b\u0438 \u044d\u0442\u043e \u043d\u0435\u0432\u0430\u043b\u0438\u0434\u043d\u044b\u0439 <code>double<\/code> \u0438\u043b\u0438 \u0436\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0435 \u0445\u0432\u0430\u0442\u0438\u043b\u043e \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u0438\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438, \u0431\u0443\u0434\u0443 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u043b\u0438\u0447\u0438\u044f \u0432 \u0431\u0443\u0444\u0435\u0440\u0435 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u043b\u0438 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0430 \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u044f \u043f\u043e\u0442\u043e\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445. \u0421\u0430\u043c \u043a\u043e\u0434 \u0442\u043e\u0436\u0435 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442 \u0438 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u043f\u043e\u0442\u043e\u043a\u0430 \u0438 \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u043e\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u0437\u0434\u0435\u0441\u044c \u0441\u0447\u0438\u0442\u0430\u044e\u0442\u0441\u044f \u0432\u0441\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u044b \u043f\u043e \u043f\u0440\u043e\u0431\u0435\u043b \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e. \u041f\u043e \u0436\u0435\u043b\u0430\u043d\u0438\u044e \u043c\u043e\u0436\u043d\u043e \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0441\u0438\u043c\u0432\u043e\u043b\u044b, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441 \u043a\u043e\u0434\u0430\u043c\u0438 <code>>= 128<\/code>, \u043d\u0430 \u0441\u043b\u0443\u0447\u0430\u0439 \u0435\u0441\u043b\u0438 \u0432 \u043f\u043e\u0442\u043e\u043a \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e\u043f\u0430\u0434\u0451\u0442 \u043c\u0443\u0441\u043e\u0440.<\/p>\n<p>  <\/p>\n<p>\u041d\u043e \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u043e\u043d\u0442\u0435\u0441\u0442\u0430 \u044f \u0431\u044b \u043b\u0443\u0447\u0448\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 <code>StreamReader<\/code> \u0438 <code>Span<\/code> \u2014 \u043e\u043d \u0432\u0441\u0451 \u0436\u0435 \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u043f\u0440\u043e\u0449\u0435<\/p>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">AsciiScanner<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cs\">class Scanner {     private const int MaxTokenLength = 1200;      Stream? input = Console.OpenStandardInput();     byte[] buffer = new byte[32768];     Span&lt;byte> Fragment => buffer.AsSpan(offset, length - offset);      int offset;     int length;      public int ReadInt()     {         while (input != null &amp;&amp; length - offset &lt; MaxTokenLength)         {             if (offset != 0)             {                 var remaining = Fragment.Length;                 Fragment.CopyTo(buffer);                 offset = 0;                 length = remaining;             }              var count = input.Read(buffer, length, buffer.Length - length);             if (count &lt;= 0)             {                 input = null;                 break;             }              length += count;             while (offset &lt; length &amp;&amp; buffer[offset] &lt;= ' ') offset++;         }         while (offset &lt; length &amp;&amp; buffer[offset] &lt;= ' ') offset++;          var parsed = Utf8Parser.TryParse(Fragment, out int value, out int bytesConsumed);         if (!parsed)             Throw();         offset += bytesConsumed;         return value;     }      void Throw() => throw new Exception(); }<\/code><\/pre>\n<\/div><\/div>\n<p>  <\/p>\n<h2 id=\"zamery\">\u0417\u0430\u043c\u0435\u0440\u044b<\/h2>\n<p>  <\/p>\n<div class=\"scrollable-table\">\n<table>\n<thead>\n<tr>\n<th>Program<\/th>\n<th>Lang<\/th>\n<th>Compiler<\/th>\n<th>Mean (Int)<\/th>\n<th>Mean (Double)<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Utf8Parser<\/td>\n<td>C#<\/td>\n<td>NativeAOT<\/td>\n<td>10 ms<\/td>\n<td>40 ms<\/td>\n<\/tr>\n<tr>\n<td>fastscan<\/td>\n<td>C++<\/td>\n<td>g++64<\/td>\n<td>14 ms<\/td>\n<td>&#8212;<\/td>\n<\/tr>\n<tr>\n<td>fastscan<\/td>\n<td>C#<\/td>\n<td>NativeAOT<\/td>\n<td>22 ms<\/td>\n<td>&#8212;<\/td>\n<\/tr>\n<tr>\n<td>SpanBlock<\/td>\n<td>C#<\/td>\n<td>NativeAOT<\/td>\n<td>24 ms<\/td>\n<td>72 ms<\/td>\n<\/tr>\n<tr>\n<td>Span<\/td>\n<td>C#<\/td>\n<td>NativeAOT<\/td>\n<td>38 ms<\/td>\n<td>85 ms<\/td>\n<\/tr>\n<tr>\n<td>cin<\/td>\n<td>C++<\/td>\n<td>g++64<\/td>\n<td>38 ms<\/td>\n<td>101 ms<\/td>\n<\/tr>\n<tr>\n<td>scanf<\/td>\n<td>C++<\/td>\n<td>g++64<\/td>\n<td>44 ms<\/td>\n<td>70 ms<\/td>\n<\/tr>\n<tr>\n<td>Console.ReadLine<\/td>\n<td>C#<\/td>\n<td>NativeAOT<\/td>\n<td>64 ms<\/td>\n<td>117 ms<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>  <\/p>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0441\u044f \u0444\u0430\u0439\u043b \u0441 200000 \u0441\u0442\u0440\u043e\u043a\u0430\u043c\u0438 \u0448\u0435\u0441\u0442\u0438\u0437\u043d\u0430\u0447\u043d\u044b\u0445 \u0447\u0438\u0441\u0435\u043b \u043f\u043e 4 \u0447\u0438\u0441\u043b\u0430 \u0432 \u043a\u0430\u0436\u0434\u043e\u0439 (~5MB). \u041a\u0430\u0436\u0434\u0430\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0441\u0447\u0438\u0442\u0430\u043b\u0430 XOR \u043a\u0430\u0436\u0434\u043e\u0439 \u0438\u0437 \u043a\u043e\u043b\u043e\u043d\u043e\u043a \u0438 \u0432\u044b\u0432\u043e\u0434\u0438\u043b\u0430 \u043e\u0442\u0432\u0435\u0442 \u0432 \u043a\u043e\u043d\u0446\u0435. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043b\u0430\u0441\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0432\u0432\u043e\u0434\u0430 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u043d\u044b\u043c\u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c\u0438, \u0441 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438. \u0412\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u043b\u0438\u0441\u044c \u0432 \u043f\u0430\u043c\u044f\u0442\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b, \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u044f\u0449\u0435\u0439 \u0437\u0430\u043f\u0443\u0441\u043a \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c \u0438 \u043f\u043e\u0434\u0430\u0432\u0430\u043b\u0438\u0441\u044c \u043d\u0430 stdin.<\/p>\n<p>  <\/p>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0440\u0430\u043d\u0442\u0430\u0439\u043c\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0441\u044f .NET 7 NativeAOT \u043d\u0430 Linux. \u042d\u0442\u043e\u0442 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0434\u0430\u0451\u0442 \u043c\u0435\u043d\u044c\u0448\u0435 \u0432\u0441\u0435\u0433\u043e \u043e\u0432\u0435\u0440\u0445\u0435\u0434\u0430 \u043d\u0430 \u0441\u0442\u0430\u0440\u0442\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b. C JIT \u043d\u0430 Windows \u043e\u0432\u0435\u0440\u0445\u0435\u0434 \u0441\u043e\u0441\u0442\u0430\u0432\u0438\u043b ~36 \u043c\u0441, \u043d\u0430 Linux \u2014 ~70. \u041e\u0447\u0435\u0440\u0451\u0434\u043d\u043e\u0441\u0442\u044c \u043f\u043e \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0434\u043b\u044f .NET-\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c \u043d\u0430 Windows \u043d\u0435 \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f.<\/p>\n<p>  <\/p>\n<p>\u0422\u0435\u0441\u0442 \u043d\u0435 \u043f\u0440\u0435\u0442\u0435\u043d\u0434\u0443\u0435\u0442 \u043d\u0430 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u0443\u044e \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0441\u0442\u044c, \u0441\u0442\u0430\u0432\u0438\u043b\u0430\u0441\u044c \u043b\u0438\u0448\u044c \u0446\u0435\u043b\u044c \u043e\u0446\u0435\u043d\u0438\u0442\u044c \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0440\u0430\u0437\u043d\u0438\u0446\u044b \u043c\u0435\u0436\u0434\u0443 \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c\u0438 \u0447\u0442\u0435\u043d\u0438\u044f \u0432\u0432\u043e\u0434\u0430.<\/p>\n<p>  <\/p>\n<h2 id=\"vyvody\">\u0412\u044b\u0432\u043e\u0434\u044b<\/h2>\n<p>  <\/p>\n<ul>\n<li>\u041d\u0430 .NET \u043c\u043e\u0436\u043d\u043e \u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0441 \u0438\u043d\u0442\u0435\u043d\u0441\u0438\u0432\u043d\u044b\u043c \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u044b\u043c IO.<\/li>\n<li>\u0414\u043b\u044f \u0434\u043e\u0441\u0442\u0438\u0436\u0435\u043d\u0438\u044f \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f:<br \/> \n<ul>\n<li>\u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u044b <code>Console.Write\/WriteLine<\/code>, \u0430 \u043f\u0438\u0441\u0430\u0442\u044c \u0432 <code>stdout<\/code> \u0447\u0435\u0440\u0435\u0437 <code>StreamWriter<\/code><\/li>\n<li>\u0434\u043b\u044f \u0447\u0442\u0435\u043d\u0438\u044f \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0447\u0438\u0441\u0435\u043b \u0441 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 (\u0438\u043b\u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u0434\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043a\u043e\u0434\u0430) \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u044b: \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0441 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u0431\u0443\u0444\u0435\u0440\u043e\u043c \u0438 \u043d\u0435\u0430\u043b\u043b\u043e\u0446\u0438\u0440\u0443\u044e\u0449\u0438\u043c <code>TryParse(ReadOnlySpan&lt;char>)<\/code><\/li>\n<li>\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u043e\u0446\u0435\u043d\u0438\u0432\u0430\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0443 \u0438 \u043d\u0435 \u043f\u0435\u0440\u0435\u0443\u0441\u043b\u043e\u0436\u043d\u044f\u0442\u044c \u043a\u043e\u0434 \u0431\u0435\u0437 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>  <\/p>\n<h2 id=\"ssylki\">\u0421\u0441\u044b\u043b\u043a\u0438<\/h2>\n<p>  <\/p>\n<ul>\n<li><a href=\"https:\/\/github.com\/dotnet\/runtime\/issues\/64621\" rel=\"nofollow noopener noreferrer\">API Proposal<\/a> \u043e \u043d\u043e\u0432\u043e\u043c \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u043e\u043c \u0432\u0432\u043e\u0434\u0435<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<\/div>\n<p> <!----> <!----><\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/705834\/\"> https:\/\/habr.com\/ru\/post\/705834\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-1\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0412\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0430, \u043a\u043e\u0433\u0434\u0430 .NET \u0431\u044b\u043b \u0437\u0430\u043a\u0440\u044b\u0442\u043e\u0439 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0435\u0439 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f Windows, \u0437\u0430 \u043d\u0438\u043c \u0438 \u044f\u0437\u044b\u043a\u043e\u043c C# \u0437\u0430\u043a\u0440\u0435\u043f\u0438\u043b\u0430\u0441\u044c \u0440\u0435\u043f\u0443\u0442\u0430\u0446\u0438\u044f \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u0442\u043b\u0438\u0447\u043d\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0431\u0438\u0437\u043d\u0435\u0441-\u0437\u0430\u0434\u0430\u0447, \u043d\u043e \u043d\u0435\u043f\u0440\u0438\u0433\u043e\u0434\u043d\u0430 \u0434\u043b\u044f \u0441\u043e\u0440\u0435\u0432\u043d\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0432\u044b\u0441\u043e\u043a\u043e\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430.<\/p>\n<p>  <\/p>\n<p>\u0427\u0430\u0441\u0442\u043e \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0441\u043b\u044b\u0448\u0430\u0442\u044c, \u0447\u0442\u043e &#171;\u0448\u0430\u0440\u043f\u044b \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u044b\u0435&#187;, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0437\u0430\u0434\u0430\u0447, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0441 <a href=\"http:\/\/timus.online\" rel=\"nofollow noopener noreferrer\">timus.online<\/a> \u0438 <a href=\"https:\/\/codeforces.com\" rel=\"nofollow noopener noreferrer\">codeforces.com<\/a>. \u0418, \u0443\u0432\u044b, \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u043b\u044b\u0448\u0430\u0442\u044c, \u043d\u043e \u0438 \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0441 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u043c\u0438, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u043c\u0438 \u0441 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044f\u043c\u0438 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b, \u043f\u043e\u043b\u0443\u0447\u0430\u044f <em>Wrong Answer, Runtime Error, Memory Limit, Time Limit<\/em> \u043f\u0440\u0438 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u043c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0435.<\/p>\n<p>  <\/p>\n<p>\u0411\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u044d\u0442\u0438\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u043a\u0440\u043e\u0435\u0442\u0441\u044f \u0432 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044f\u0445 \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u0432\u043e\u0434\u0430 \u0438 \u0432\u044b\u0432\u043e\u0434\u0430. \u0414\u0430 \u0438 \u0447\u0430\u0441\u0442\u043e \u043a\u0443\u0434\u0430 \u043f\u0440\u043e\u0449\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c <code>cin >> n<\/code>\u0438\u043b\u0438 <code>sc.nextInt()<\/code>, \u0447\u0435\u043c <code>int.Parse(Console.ReadLine())<\/code> \u0438\u043b\u0438 <code>Console.ReadLine().Split().Select(int.Parse).ToArray()<\/code>, \u0438\u0437-\u0437\u0430 \u0447\u0435\u0433\u043e \u0432\u044b\u0431\u043e\u0440 \u043f\u0430\u0434\u0430\u0435\u0442 \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u0439 \u044f\u0437\u044b\u043a.<\/p>\n<p>  <\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043e \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0451\u043d\u043d\u044b\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u0445 \u0441 \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u044b\u043c \u0432\u0432\u043e\u0434\u043e\u043c-\u0432\u044b\u0432\u043e\u0434\u043e\u043c \u0432 .NET, \u0438 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0432\u0432\u043e\u0434 \u0431\u044b\u0441\u0442\u0440\u044b\u043c \u0438 \u0443\u0434\u043e\u0431\u043d\u044b\u043c.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-342740","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/342740","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=342740"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/342740\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=342740"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=342740"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=342740"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}