· Olympiad in Informatics

LibreOJ 6002: [24 Network Flow Problems] Minimum Path Cover — Solution

This model is kinda badass, y’know.

Continue reading →Chinese original · English translation by Claude Opus 5.5

· Olympiad in Informatics

LibreOJ 6001: [24 Network Flow Problems] Space Flight Plan — Solution

Clearly a maximum weight closure. Connect the experiments and the instruments with edges, adapt the edge weights a bit, then compute the max flow and record the vertices on the min cut, and that’s it. The input/output is a little nasty.

Continue reading →Chinese original · English translation by Claude Opus 5.5

· Olympiad in Informatics

Li Chao Tree

The Li Chao tree is named after its inventor, the great god Li Chao of Hangzhou Xuejun High School. This data structure is mainly used to dynamically maintain an (upper\lower) convex hull. It is a really godlike thing, and the main difficulty lies in handling the lazy tags on the segment tree.

Continue reading →Chinese original · English translation by Claude Opus 5.5

· Olympiad in Informatics

Combinatorics in OI

  • Overview and Basic Concepts
  • Permutations
  • Combinations
  • Stars and Bars
  • Stirling Numbers
    • First Kind
    • Second Kind
  • Derangements
  • Catalan Numbers
  • Permutations and Combinations of Multisets
  • Prüfer Sequences
  • Tricks for Permutations and Combinations in OI
  • References

Continue reading →Chinese original · English translation by Claude Opus 5.5

· Things

Zibo Trip

My connection with the city of Zibo comes from a primary-school classmate of mine. After primary school he moved back to his hometown, Zibo, but we've kept in good touch, and the cheeky banter between us carries on as ever. Because every time he's supposed to come to Nanchang he flakes (maybe human nature is to flake), I took this trip to Jinan as a chance to swing by Zibo too. When I got there, I first chatted briefly with his parents about how things were going and the differences between the two cities, and then went to pick him up after class.

Continue reading →Chinese original · English translation by Claude Opus 5.5

· Olympiad in Informatics

P4316: The Mung Bean Frog's Destination — Solution

This is a pretty good problem (an easy problem that big shots insta-solve). We run a Topo Sort on the DAG to tally the answer. For node \(i\), the probability is

Continue reading →Chinese original · English translation by Claude Opus 5.5

· Olympiad in Informatics

[Codeforces 280C] Game on Tree — Solution

Let's consider the scenario in which each vertex gets deleted. For vertex \(i\), it can only be deleted after an operation on a vertex whose depth is less than or equal to that of vertex \(i\), with probability \(\frac{1}{dep[i]}\). Each deleted vertex costs \(1\), so the answer is \(\sum_{i=1}^{n} \frac{1}{dep[i]}\)

Continue reading →Chinese original · English translation by Claude Opus 5.5

· Olympiad in Informatics

Probability & Mathematical Expectation

  • Overview
  • Probability
    • Concepts Related to Probability
    • The Meaning of Probability
    • Probability of Simultaneous Occurrence
    • Axioms & Propositions of Probability
    • Conditional Probability
      • Concept
      • Law of Total Probability
      • Bayes' Formula
      • Examples
    • Random Variables
    • Applications of Probability in OI
  • Mathematical Expectation
    • The Concept of Mathematical Expectation
    • Linearity of Expectation & Recurrences
    • Applications of Mathematical Expectation in OI

Continue reading →Chinese original · English translation by Claude Opus 5.5

· Olympiad in Informatics

January Summary

This month I really caught up hard on my regular classes. My math grades still need improving (this is what upsets me most), English is still running on black magic, I passed all the science subjects (yes, I'm now so garbage that all I can aim for is a pass), and 90 in biology made me very happy, because in the weekly practice test I had still got 68. I have to say, the New Year vibe of the papers this time was really obvious.

Continue reading →Chinese original · English translation by Claude Opus 5.5

· Olympiad in Informatics

Elementary Number Theory

  • GCD & LCM
  • Euler's Totient Function
  • The BSGS Algorithm
  • CRT (Chinese Remainder Theorem)
  • Primitive Roots

Continue reading →Chinese original · English translation by Claude Opus 5.5