Welcome to my blog!

In my very early ages, I have planned to set up a personal blog. However, all my personal blogs were discarded either because I felt tired to maintain it or I felt nobody was going to read my posts. And as you see, this is my another attempt, and I would try my best to maintain this blog for this ti

A reflection on ICPC 2024

Preface ICPC 2024 regional has ended, and our team ranked #20 and #38 in Jakarta and Hanoi sites, respectively. As a final year for participating in ICPC as a contestant, I felt quite disappointed and pitiful for the results. Nevertheless, I enjoy the process for training and learning with all NTU c

The Pisano period of C-finite sequences

Problem definition The Pisano period of a prime ppp, is defined as the minimum integer π(p)\pi(p)π(p) satisfying f0≡fπ(p),f1≡fπ(p)+1(mod⁡p)f_0\equiv f_{\pi(p)},f_1\equiv f_{\pi(p)+1}(\operatorname{mod} p)f0​≡fπ(p)​,f1​≡fπ(p)+1​(modp), where fff is the Fibonacci sequence. It is well known that for p=

Graph coloring with densest subgraph

Problem definition An undirected graph GGG is kkk-coloring if all vertices could be colored with at most kkk different colors, such that all adjacent vertices have different colors. For example, a kkk-clique is kkk-coloring, and a tree is 2-coloring. The densest subgraph of a graph GGG, is an induce

Maintaining the diameter of a growing tree in O(log n) time

A tree is a connected undirected graph with nnn nodes and n−1n-1n−1 edges. The diameter of a tree is the largest distance between two nodes in the tree. We define a growing tree as follows: at each moment, a new node uuu is inserted into the tree, and uuu is connected to some node vvv in the origin