A post-contest write-up. Problem link The main references were Kuang Shen’s livestream solution and the official Analysis. Wiggle Walk The easy idea is brute force. Simulate the entire command execution process and mark whether each cell has been visited before. Time complexity: O(N ^ 2). Althoug
Read more »

A post-contest write-up. Problem link Building Palindromes Given a string of length N and Q queries. Each query is a range, from which we can get a substring. Determine whether the substring can be rearranged into a palindrome. Since arbitrary rearrangement is allowed, the order of characters in th
Read more »

Today my high school classmate xl came to Beijing to chat with me. I had lunch and dinner with him and hcq, and we chatted for the whole afternoon. During the morning contest, I only hurriedly finished the warm-up problem. For the second problem, because of carelessness, I wrote the timing of the re
Read more »

Unlike a blog, a book is relatively more complete and more systematic. Blogs, by comparison, are much more scattered. However, excellent blog series are often adapted into books. If you want to share larger-scale, systematic knowledge, writing a small book is a good choice. This article introduces a
Read more »

This year I still spent my 23rd birthday at school. In the afternoon, I went out with my roommates to watch the movie The Lion King. In the evening, we went to Chengnan Jiushi and ate “Beijing cuisine.” I suppose that counts as celebrating my birthday. Happy birthday to me. Since I left home at 18 a
Read more »

RankNameScoreFinish TimeQ1 (5)Q2 (5)Q3 (8)Q4 (8)451 / 4931YoungForest161:24:260:09:370:17:391:14:26 2null1122. Relative Sort Array Custom sorting rule. Time complexity: O(N log N), Space complexity: O(N). 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 class Solution { public: vector
Read more »

This morning I had to take the TOEFL exam, so I could not participate in the weekly contest as usual. I solved the problems after the contest. 1108. Defanging an IP Address One pass. Just replace directly. Time complexity: O(N), Space complexity: O(1). 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 cla
Read more »

RankNameScoreFinish TimeQ1 (5)Q2 (5)Q3 (8)Q4 (8)396 / 4272YoungForest141:01:140:11:380:28:380:56:14 1null1103. Distribute Candies to People Brute force. Simulate the entire distribution process. Time complexity: O(sqrt(candies.size())), because 1 + 2 + ... + n = n * (n + 1) / 2 = candies.size(). Sp
Read more »

RankNameScoreFinish TimeQ1 (5)Q2 (5)Q3 (8)Q4 (8)851 / 4504YoungForest131:39:38null1:00:12 21:19:38 2nullThe main mistake in this contest was that I wrote the cmp function in sort incorrectly for the second problem and did not guarantee strict ordering. It kept causing segmentation faults. That is, i
Read more »

RankNameScoreFinish TimeQ1 (4)Q2 (5)Q3 (6)Q4 (8)234 / 4126YoungForest221:18:450:25:23 10:36:290:51:471:13:45I had a Natural Dialectics exam on Monday and a Matrix exam on Tuesday, but still forced myself to make time for the contest. My review itself was not sufficient, and my usual study was not ve
Read more »
0%