https://atcoder.jp/contests/abc478/tasks/abc478_dXが同じものを集めます。Xが2なら、(1, 4, 2)と(2, 5, 2)がありますが、集合なので重複は1カウントで合わせて(1, 5, 2)とします。そして、木を作ってその範囲に1を足します。 // Count Cells in a Window #![allow(non_snake_case)] use std::collections::HashMap; //////////////////// library //////////////////// fn read<T: std::str…