Entries from 2016-12-14 to 1 day
問題 abc019.contest.atcoder.jp note 木の直径を求める際には、まず適当なノードを選んで、そこから最も遠いノードを求める。 次にそのノードから最も遠いノードを求めると、その2頂点の長さが木の直径になる。
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…