<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>ACM on shift&#39;s Blog</title>
    <link>/posts/acm/</link>
    <description>Recent content in ACM on shift&#39;s Blog</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>zh</language>
    <lastBuildDate>Tue, 19 Mar 2024 22:40:39 +0800</lastBuildDate>
    <atom:link href="/posts/acm/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>CSUST ACMore Evening training 2024.3.19</title>
      <link>/posts/acm/1/</link>
      <pubDate>Tue, 19 Mar 2024 22:40:39 +0800</pubDate>
      <guid>/posts/acm/1/</guid>
      <description>CSUST ACMore Evening training 2024.3.19 Problem1 我们可以推一下这个式子就可以发现题目要我们求啥，目要去掉俩个数后算术平均数相等，那我们就选俩个去掉假设为 $a_x, a_y$ $\frac{Sum}{n} = \frac{Sum - a_x-a_y}{n - 2}$ $得到： 2 \times Sum = (a_x + a_y) \times n $ 我们会发现如果 $2 \times Sum \equiv 0 (\bmod n)$ 才可能存在有解，然后就是需要存在 $(a_x+a_y) = \frac{2\times Sum}{n}$ ，令 $w = \frac{2\times Sum}{n}$，假设 $x &amp;lt; y$ 要求的就是对</description>
    </item>
    <item>
      <title>Codeforces Round 929 (Div. 3)</title>
      <link>/posts/acm/codeforces-round-929-div.-3/</link>
      <pubDate>Wed, 28 Feb 2024 12:45:36 +0800</pubDate>
      <guid>/posts/acm/codeforces-round-929-div.-3/</guid>
      <description>A. Turtle Puzzle: Rearrange and Negate 因为可以任意排列这个数组，并将一段区间内的数乘 $-1$，我们可以排序后把所有负数变为正数，即可 $code:$ void solve() { int n; std::cin &amp;gt;&amp;gt; n; int ans = 0; for(int i = 0, x; i &amp;lt; n; i ++ ) { std::cin &amp;gt;&amp;gt; x; ans += std::abs(x); } std::cout &amp;lt;&amp;lt; ans &amp;lt;&amp;lt; &amp;#39;\n&amp;#39;; } B. Turtle Math: Fast Three Task 分类讨论，$\sum_{i=1}^na_i\mod 3$ 等于 $0$ 的话不需要操作，等于 $1$ 就看有</description>
    </item>
    <item>
      <title>牛客周赛Round32</title>
      <link>/posts/acm/%E7%89%9B%E5%AE%A2%E5%91%A8%E8%B5%9Bround32/</link>
      <pubDate>Mon, 12 Feb 2024 11:45:24 +0800</pubDate>
      <guid>/posts/acm/%E7%89%9B%E5%AE%A2%E5%91%A8%E8%B5%9Bround32/</guid>
      <description>A.小红的 01 背包 能装多少装多少就行 $code:$ void solve() { int v, x, y; std::cin &amp;gt;&amp;gt; v &amp;gt;&amp;gt; x &amp;gt;&amp;gt; y; std::cout &amp;lt;&amp;lt; v / x * y &amp;lt;&amp;lt; &amp;#39;\n&amp;#39;; } B.小红的 dfs 枚举每一行，然后对于第一行为 $dfs$ 的情况, 只存在第一列也为 $dfs$ 满足，其他行同理枚举一遍即可 void solve() { char g[3][3]; for(int i = 0; i &amp;lt; 3; i ++) { for(int j = 0; j &amp;lt; 3; j ++ ) { std::cin &amp;gt;&amp;gt; g[i][j]; } } int ans = 9, v = 0; if(g[0][0] != &amp;#39;d&amp;#39;) v ++; if(g[0][1] != &amp;#39;f&amp;#39;) v ++; if(g[0][2] !=</description>
    </item>
    <item>
      <title>Educational Codeforces Round 161 (Rated for Div. 2) A-E</title>
      <link>/posts/acm/educational-codeforces-round-161-rated-for-div.-2/</link>
      <pubDate>Tue, 06 Feb 2024 10:07:37 +0800</pubDate>
      <guid>/posts/acm/educational-codeforces-round-161-rated-for-div.-2/</guid>
      <description>A. Tricky Template 我们对每个位置 $i$ 来看,只要 $a_i == c_i \ or \ b_i == c_i$​ ,那么就会使其不成立, 如果是整个字符串呢，那么就是，那么就需要每个位置都成立才能使其不成立，于是遍历判断一下即可 $code:$ void solve() { int n; std::cin &amp;gt;&amp;gt; n; std::string a, b, c; std::cin &amp;gt;&amp;gt; a &amp;gt;&amp;gt; b &amp;gt;&amp;gt; c; int ok = 0; for(int i = 0; i &amp;lt; n; i ++ ) { if(a[i] != c[i] &amp;amp;&amp;amp; b[i] != c[i]) { ok = 1; } } std::cout &amp;lt;&amp;lt; (ok ? &amp;#34;YES&amp;#34; : &amp;#34;NO&amp;#34;)</description>
    </item>
    <item>
      <title>牛客周赛Round31</title>
      <link>/posts/acm/%E7%89%9B%E5%AE%A2%E5%91%A8%E8%B5%9Bround31/</link>
      <pubDate>Mon, 05 Feb 2024 12:14:11 +0800</pubDate>
      <guid>/posts/acm/%E7%89%9B%E5%AE%A2%E5%91%A8%E8%B5%9Bround31/</guid>
      <description>牛客周赛Round31 A.小红小紫替换 判断即可 $code:$ void solve() { std::string s; std::cin &amp;gt;&amp;gt; s; std::cout &amp;lt;&amp;lt; (s == &amp;#34;kou&amp;#34; ? &amp;#34;yukari&amp;#34; : s) &amp;lt;&amp;lt; &amp;#39;\n&amp;#39;; } B.小红的因子数 看到数据范围为 $1e13$，$\sqrt{1e13} \approx 3e6$ 所以直接枚举根号以内的素因子即可 复杂度 $O(\sqrt{n})$ $code:$ void solve() { i64 x; std::cin &amp;gt;&amp;gt; x; int ans = 0; for(int i = 2; i &amp;lt;= x / i; i ++ ) { if(x % i == 0) { while(x % i == 0) { x /=</description>
    </item>
    <item>
      <title>组合数学</title>
      <link>/posts/acm/%E7%BB%84%E5%90%88%E6%95%B0%E5%AD%A6/</link>
      <pubDate>Sun, 04 Feb 2024 23:26:13 +0800</pubDate>
      <guid>/posts/acm/%E7%BB%84%E5%90%88%E6%95%B0%E5%AD%A6/</guid>
      <description>组合数学 排列与组合 1.帕斯卡公式 $$ 对于所有满足 1\le k \le n-1的整数 n 和 k,有 \newline \tbinom{n}{k} = \tbinom{n - 1}{k} + \tbinom{n - 1}{k - 1} $$ 2.定理 $$ 1. 设多重集合S，有k种类型对象，每一种类型的有限出现次数时n_1,n_2,&amp;hellip;,n_k,设S的大小为 n, S的排列数为 \newline \frac{n!}{n_1!n_2!&amp;hellip;n_k!} \newline 2.设S为有k种类型的多重集合,每种元</description>
    </item>
    <item>
      <title>Blog</title>
      <link>/posts/acm/blog/</link>
      <pubDate>Thu, 05 May 2022 00:18:23 +0800</pubDate>
      <guid>/posts/acm/blog/</guid>
      <description>hello $$ \frac{a_i^{j}}{n} $$</description>
    </item>
  </channel>
</rss>
