Takefumi Yamamura's blog

This blog is for my memorandum about programming and English.

Happy Coding

This blog is for my memorandum

Entries from 2016-12-14 to 1 day

Double Sweep AtCoder Beginner Contest 019 D - 高橋くんと木の直径

問題 abc019.contest.atcoder.jp note 木の直径を求める際には、まず適当なノードを選んで、そこから最も遠いノードを求める。 次にそのノードから最も遠いノードを求めると、その2頂点の長さが木の直径になる。

Union Find Tree SRM 703 Middium GCDGraph

Problem Statement You are given four s: n, k, x, and y. The s n and k describe a simple undirected graph. The graph has n nodes, numbered 1 through n. Two distinct vertices i and j are connected by an edge if and only if gcd(i, j) > k. Her…