<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
  <title>Kalorona</title>
  <link href="https://kalorona.com/index.en"/>
  <link rel="self" href="https://kalorona.com/feed.en.xml"/>
  <id>https://kalorona.com/index.en</id>
  <updated>2023-02-20T22:04:12Z</updated>
  <author><name>Kalorona</name></author>
  <entry>
    <title>Programming on the RISC-V Platform (Part 1)</title>
    <link href="https://kalorona.com/posts/2023/3013-risc-v-1/index.en"/>
    <id>https://kalorona.com/posts/2023/3013-risc-v-1/index.en</id>
    <published>2023-02-20T22:04:12Z</published>
    <updated>2023-02-20T22:04:12Z</updated>
    <category term="Computer Science"/>
    <summary type="html">&lt;blockquote&gt;
&lt;p&gt;The authors of RISC-V aim to provide several CPU designs that can be used freely under the &lt;a href=&quot;https://zh.wikipedia.org/wiki/BSD%E8%AE%B8%E5%8F%AF%E8%AF%81&quot;&gt;BSD license&lt;/a&gt;; the license allows derivative works such as RISC-V chip designs to be open and freely distributed like RISC-V itself, or to be closed-source or proprietary.&lt;/p&gt;
&lt;p&gt;RISC-V - Wikipedia&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Over the past few decades of the open-source software movement, a whole series of open-source software, represented by GNU/Linux and others, has become indispensable infrastructure in the tech industry, benefiting every individual and group that uses open-source software equally. Beyond open-source operating systems, the open-source movement has never stopped in other areas either. All kinds of software development frameworks and system software are embracing open source (for example, Microsoft, which once called Linux a “cancer”, is now also actively contributing to the open-source community).&lt;/p&gt;</summary>
  </entry>
  <entry>
    <title>Memoirs of Competitive Programming</title>
    <link href="https://kalorona.com/posts/2022/2956-goodbye-my-youth/index.en"/>
    <id>https://kalorona.com/posts/2022/2956-goodbye-my-youth/index.en</id>
    <published>2022-07-27T19:10:44Z</published>
    <updated>2022-07-27T19:10:44Z</updated>
    <category term="Things"/>
    <summary type="html">&lt;p&gt;It is now the early hours of July 28, 2022, and I have just finished CCPC Final 2021. &lt;span class=&quot;slang&quot; data-zh=&quot;打铁&quot; data-gloss=&quot;dǎtiě, “to forge iron”. Getting an “iron medal”, i.e. no award at all: bombing a contest.&quot;&gt;Taking home an iron medal&lt;/span&gt; was never in doubt, and we only went to the Final for a laugh anyway, but this contest was, I guess, extremely important to my competitive programming journey.&lt;/p&gt;
&lt;p&gt;It marks the end of my four-year competitive programming career. Thinking back on the contest a few hours ago, I remember I was still discussing SG functions, meet-in-middle, linear bases and Gaussian elimination with my teammates. “How is it actually implemented? And how did this idea come about?” Even though I had decided weeks ago that I would &lt;span class=&quot;slang&quot; data-zh=&quot;退役&quot; data-gloss=&quot;tuìyì, “retire from service”. Quitting competitive programming, usually after one's last contest.&quot;&gt;retire&lt;/span&gt; once this season was over, in the last contest before I &lt;span class=&quot;slang&quot; data-zh=&quot;退役&quot; data-gloss=&quot;tuìyì, “retire from service”. Quitting competitive programming, usually after one's last contest.&quot;&gt;retired&lt;/span&gt;, knowing full well I might never think about these things again, I still kept on thinking. Now, sitting alone on my bed typing, I think it over carefully and finally understand: I have been in competitive programming for too long, and this kind of thinking has become an everyday habit of mine.&lt;/p&gt;</summary>
  </entry>
  <entry>
    <title>First Undergraduate Semester Summary</title>
    <link href="https://kalorona.com/posts/2022/2918-undergraduate-semester-1-summary/index.en"/>
    <id>https://kalorona.com/posts/2022/2918-undergraduate-semester-1-summary/index.en</id>
    <published>2022-01-16T09:54:06Z</published>
    <updated>2022-01-16T09:54:06Z</updated>
    <category term="Things"/>
    <summary type="html">&lt;p&gt;I'm in university now, and a lot of things have become quite different. As is customary, I'll write a semester summary to talk about how I've been this semester and what I've been thinking.&lt;/p&gt;</summary>
  </entry>
  <entry>
    <title>[2021 CCPC Guilin] J - Suffix Automaton</title>
    <link href="https://kalorona.com/posts/2021/2902-2021-ccpc-guilin-j-suffix-automaton/index.en"/>
    <id>https://kalorona.com/posts/2021/2902-2021-ccpc-guilin-j-suffix-automaton/index.en</id>
    <published>2021-11-15T13:26:36Z</published>
    <updated>2021-11-15T13:26:36Z</updated>
    <category term="Olympiad in Informatics"/>
    <summary type="html">&lt;p&gt;Given a string \(S\). Define an ordering on the distinct substrings of this string:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;When the lengths differ, the shorter one goes in the lower position.&lt;/li&gt;
&lt;li&gt;When the lengths are equal, sort lexicographically.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Simply put, length is the first key and lexicographic order is the second key. Now you are given \(Q\) queries; each query asks for the first occurrence position of the substring ranked \(k\) under this ordering.&lt;/p&gt;</summary>
  </entry>
  <entry>
    <title>Codeforces Round #747 (Div. 2) - Problem-Solving Report</title>
    <link href="https://kalorona.com/posts/2021/2883-cf-1594/index.en"/>
    <id>https://kalorona.com/posts/2021/2883-cf-1594/index.en</id>
    <published>2021-10-11T14:10:04Z</published>
    <updated>2021-10-11T14:10:04Z</updated>
    <category term="Olympiad in Informatics"/>
    <summary type="html">&lt;p&gt;A &lt;span class=&quot;slang&quot; data-zh=&quot;思博&quot; data-gloss=&quot;sībó, a homophone of SB, i.e. 傻逼 (shǎbī), “idiot”. Here: dead simple, dumb.&quot;&gt;brain-dead&lt;/span&gt; problem, nothing much to say.&lt;/p&gt;</summary>
  </entry>
  <entry>
    <title>Configuring the C/C++ Extension in VSCode (macOS)</title>
    <link href="https://kalorona.com/posts/2021/2855-vscode-cpptool-single-file-config/index.en"/>
    <id>https://kalorona.com/posts/2021/2855-vscode-cpptool-single-file-config/index.en</id>
    <published>2021-08-21T07:36:19Z</published>
    <updated>2021-08-21T07:36:19Z</updated>
    <category term="Computer Science"/>
    <summary type="html">&lt;p&gt;After the &lt;span class=&quot;slang&quot; data-zh=&quot;高考&quot; data-gloss=&quot;gāokǎo, “higher exam”. China's national college entrance exam, taken at the end of high school.&quot;&gt;college entrance exam&lt;/span&gt; ended, some classmates around me who are headed for computer science departments were getting ready to start &lt;span class=&quot;slang&quot; data-zh=&quot;卷&quot; data-gloss=&quot;juǎn, “to roll”, short for 内卷 (nèijuǎn, “involution”). Grinding hard at something, often in an arms race with one's peers.&quot;&gt;grinding away at&lt;/span&gt; C/C++, and they ran into configuration problems while using VSCode on macOS. I'm writing a short article here to record the process.&lt;/p&gt;</summary>
  </entry>
  <entry>
    <title>Written Before the College Entrance Exam</title>
    <link href="https://kalorona.com/posts/2021/2813-before-ncee-2021/index.en"/>
    <id>https://kalorona.com/posts/2021/2813-before-ncee-2021/index.en</id>
    <published>2021-05-16T09:48:43Z</published>
    <updated>2021-05-16T09:48:43Z</updated>
    <category term="Things"/>
    <summary type="html">&lt;p&gt;“Do good, and ask not about what lies ahead.” After &lt;span class=&quot;slang&quot; data-zh=&quot;跪烂&quot; data-gloss=&quot;guì làn, “kneel till broken”. 跪 (guì, “to kneel”) is slang for failing; 跪烂 means failing miserably.&quot;&gt;bombing horribly&lt;/span&gt; at the national contest, whenever I got restless and anxious over silly mistakes in exams and less-than-ideal academic grades, I would consciously take a deep breath and then silently repeat this line. You could say this was my senior year.&lt;/p&gt;</summary>
  </entry>
  <entry>
    <title>AFO</title>
    <link href="https://kalorona.com/posts/2020/2741-afo/index.en"/>
    <id>https://kalorona.com/posts/2020/2741-afo/index.en</id>
    <published>2020-08-20T12:26:23Z</published>
    <updated>2020-08-20T12:26:23Z</updated>
    <category term="Things"/>
    <summary type="html">&lt;p&gt;&lt;span class=&quot;slang&quot; data-zh=&quot;退役&quot; data-gloss=&quot;tuìyì, “retire from service”. Quitting competitive programming, usually after one's last contest.&quot;&gt;Retired&lt;/span&gt; with nothing at all.&lt;/p&gt;</summary>
  </entry>
  <entry>
    <title>[GDOI2020 Mock 02.05] Spanning Tree - Solution</title>
    <link href="https://kalorona.com/posts/2020/2731-jzoj-6461/index.en"/>
    <id>https://kalorona.com/posts/2020/2731-jzoj-6461/index.en</id>
    <published>2020-08-07T13:23:44Z</published>
    <updated>2020-08-07T13:23:44Z</updated>
    <category term="Olympiad in Informatics"/>
    <summary type="html">&lt;p&gt;Interesting. I once did a problem that used Matrix-Tree + Gaussian-elimination interpolation to solve the one-dimensional case of this problem, and I planned to keep doing it that way, but later found that Lagrange interpolation can get it done in \(\Theta(n^5)\), so I learned a little something new.&lt;/p&gt;
&lt;p&gt;First, realize that once you run the Matrix-Tree Theorem on this problem, what comes out is a bivariate polynomial:&lt;/p&gt;
&lt;p&gt;\[\sum_{i = 0}^{n - 1} \sum_{j = 0}^{n - 1} a_{i, j} x^i y^j\]&lt;/p&gt;</summary>
  </entry>
  <entry>
    <title>AtCoder Grand Contest 032 - Problem-Solving Report</title>
    <link href="https://kalorona.com/posts/2020/2726-agc-032/index.en"/>
    <id>https://kalorona.com/posts/2020/2726-agc-032/index.en</id>
    <published>2020-08-07T13:07:54Z</published>
    <updated>2020-08-07T13:07:54Z</updated>
    <category term="Olympiad in Informatics"/>
    <summary type="html">&lt;p&gt;Here \(n \leq 100\), so consider the last insertion, and then just restore everything from there.&lt;/p&gt;</summary>
  </entry>
  <entry>
    <title>Lagrange Interpolation</title>
    <link href="https://kalorona.com/posts/2020/2712-lagrange-interpolation/index.en"/>
    <id>https://kalorona.com/posts/2020/2712-lagrange-interpolation/index.en</id>
    <published>2020-08-05T13:57:13Z</published>
    <updated>2020-08-05T13:57:13Z</updated>
    <category term="Olympiad in Informatics"/>
    <summary type="html">&lt;p&gt;If you have a bunch of scattered points on hand, then you can fit a function with this formula:&lt;/p&gt;
&lt;p&gt;\[f(x) = \sum_{i = 1}^n y_i \prod_{j \neq i}^n \frac{x - x_j}{x_i - x_j}\]&lt;/p&gt;</summary>
  </entry>
  <entry>
    <title>NOI Review Topic - Data Structures</title>
    <link href="https://kalorona.com/posts/2020/2707-noi-review-data-structure/index.en"/>
    <id>https://kalorona.com/posts/2020/2707-noi-review-data-structure/index.en</id>
    <published>2020-08-03T12:55:03Z</published>
    <updated>2020-08-03T12:55:03Z</updated>
    <category term="Olympiad in Informatics"/>
    <summary type="html">&lt;p&gt;Classic problem: HDU4085&lt;/p&gt;</summary>
  </entry>
  <entry>
    <title>NOI Review Topic - DP</title>
    <link href="https://kalorona.com/posts/2020/2701-noi-review-dp/index.en"/>
    <id>https://kalorona.com/posts/2020/2701-noi-review-dp/index.en</id>
    <published>2020-08-03T12:53:56Z</published>
    <updated>2020-08-03T12:53:56Z</updated>
    <category term="Olympiad in Informatics"/>
    <summary type="html">&lt;p&gt;Slope optimization actually isn't very hard. You can think of it as taking some points in the plane as decision points; you now have a line with slope \(k\), and you need to make it pass through a suitable point so that the line's intercept is maximized/minimized. Clearly this can be done by making these points form an upper/lower convex hull, then binary searching for the segment with the closest slope and transitioning from it.&lt;/p&gt;</summary>
  </entry>
  <entry>
    <title>P5161: WD and Sequences — Solution</title>
    <link href="https://kalorona.com/posts/2020/2695-p5161/index.en"/>
    <id>https://kalorona.com/posts/2020/2695-p5161/index.en</id>
    <published>2020-07-31T06:30:14Z</published>
    <updated>2020-07-31T06:30:14Z</updated>
    <category term="Olympiad in Informatics"/>
    <summary type="html">&lt;p&gt;First take differences, and then solve this non-overlapping substring matching problem.&lt;/p&gt;
&lt;p&gt;We can consider maintaining the endpos sets with segment trees, and then use small-to-large merging to compute the contribution produced between a suffix node and the current point set. There are two cases:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Substrings that have the current longest length for the endpos and do not overlap the current position \(x\). For these we can just brute-force a count query on the segment tree.&lt;/li&gt;
&lt;li&gt;Lengths less than \(maxdep\). Taking the case where \(endpos\) is on the left as an example: the contribution to the answer is \(x - endpos - 1\).&lt;/li&gt;
&lt;/ul&gt;</summary>
  </entry>
  <entry>
    <title>[Codeforces 724F] Uniformly Branched Trees — Solution</title>
    <link href="https://kalorona.com/posts/2020/2693-cf-742f/index.en"/>
    <id>https://kalorona.com/posts/2020/2693-cf-742f/index.en</id>
    <published>2020-07-30T13:03:19Z</published>
    <updated>2020-07-30T13:03:19Z</updated>
    <category term="Olympiad in Informatics"/>
    <summary type="html">&lt;p&gt;Ah, an unrooted-tree DP again. First split on parity: if it's odd, you can DP directly; if not, you need to do inclusion–exclusion &lt;span class=&quot;slang&quot; data-zh=&quot;一波&quot; data-gloss=&quot;yī bō, “a wave”. Slang for doing something in one quick go.&quot;&gt;in one go&lt;/span&gt;.&lt;/p&gt;
&lt;p&gt;Define the state \(dp[scale][maxPart][degree]\), meaning the number of ways for a tree of size \(scale\) whose largest subtree has size \(maxPart\) and whose root has degree \(degree\). The transitions are actually easy to come up with; just read the code.&lt;/p&gt;</summary>
  </entry>
  <entry>
    <title>[Codeforces 566C] Logistical Questions — Solution</title>
    <link href="https://kalorona.com/posts/2020/2688-cf-566c/index.en"/>
    <id>https://kalorona.com/posts/2020/2688-cf-566c/index.en</id>
    <published>2020-07-30T12:39:06Z</published>
    <updated>2020-07-30T12:39:06Z</updated>
    <category term="Olympiad in Informatics"/>
    <summary type="html">&lt;p&gt;This problem is really &lt;span class=&quot;slang&quot; data-zh=&quot;神仙&quot; data-gloss=&quot;shénxiān, “immortal”. Someone, or a problem or idea, so brilliant it seems superhuman.&quot;&gt;godlike&lt;/span&gt;. First, note that this function is unimodal, and the cost function formed by multiple points in the end must have the form \(y = ax^{\frac{3}{2}} + b\), which is clearly also unimodal. So, when the tree is a chain, we can try binary search. If it evolves into a tree, we can consider centroid decomposition, observing that among the subtrees currently connected to the root, at most one subtree is better.&lt;/p&gt;</summary>
  </entry>
  <entry>
    <title>[Codeforces 526F] Pudding Monsters — Solution</title>
    <link href="https://kalorona.com/posts/2020/2685-cf-526f/index.en"/>
    <id>https://kalorona.com/posts/2020/2685-cf-526f/index.en</id>
    <published>2020-07-30T12:18:02Z</published>
    <updated>2020-07-30T12:18:02Z</updated>
    <category term="Olympiad in Informatics"/>
    <summary type="html">&lt;p&gt;Transformed a bit, this problem is: given a permutation, count how many intervals there are whose numbers can form a consecutive sequence.&lt;/p&gt;</summary>
  </entry>
  <entry>
    <title>[Codeforces 341D] Iahub and Xors — Solution</title>
    <link href="https://kalorona.com/posts/2020/2681-cf-341d/index.en"/>
    <id>https://kalorona.com/posts/2020/2681-cf-341d/index.en</id>
    <published>2020-07-30T11:49:46Z</published>
    <updated>2020-07-30T11:49:46Z</updated>
    <category term="Olympiad in Informatics"/>
    <summary type="html">&lt;p&gt;First, seeing this problem, you could consider a tree of trees, &lt;s&gt;and then you're done.&lt;/s&gt;&lt;/p&gt;
&lt;p&gt;Let's consider using a 2D Fenwick tree to take differences. Of course, if we take differences the usual way, all we can think of is using prefix sums to maintain point values, not range XOR sums. Let the result after differencing be:&lt;/p&gt;
&lt;p&gt;\[d_{i, j} = a_{i, j} \oplus a_{i - 1, j} \oplus a_{i, j - 1} \oplus a_{i - 1, j - 1}\]&lt;/p&gt;</summary>
  </entry>
  <entry>
    <title>AtCoder Grand Contest 033 - Problem-Solving Report</title>
    <link href="https://kalorona.com/posts/2020/2660-agc-033/index.en"/>
    <id>https://kalorona.com/posts/2020/2660-agc-033/index.en</id>
    <published>2020-07-24T11:54:24Z</published>
    <updated>2020-07-24T11:54:24Z</updated>
    <category term="Olympiad in Informatics"/>
    <summary type="html">&lt;p&gt;A &lt;span class=&quot;slang&quot; data-zh=&quot;一眼题&quot; data-gloss=&quot;yīyǎn tí, “one-glance problem”. A problem whose solution is obvious the moment you read it.&quot;&gt;one-glance problem&lt;/span&gt;: just run a BFS to find the longest shortest path.&lt;/p&gt;</summary>
  </entry>
  <entry>
    <title>Virtual Tree</title>
    <link href="https://kalorona.com/posts/2020/2657-virtual-tree/index.en"/>
    <id>https://kalorona.com/posts/2020/2657-virtual-tree/index.en</id>
    <published>2020-07-23T06:36:45Z</published>
    <updated>2020-07-23T06:36:45Z</updated>
    <category term="Olympiad in Informatics"/>
    <summary type="html">&lt;p&gt;A flexible data structure for performing computations on a set of key vertices in a tree.&lt;/p&gt;</summary>
  </entry>
</feed>
