2016-03-18から1日間の記事一覧
各クエリに対し、LCAが深い順に点を消していくgreedyをやる。setで隣り合うものに関する何かを管理するのは完全に闇。 こういうのどうやったらコンテスト中に通せるんだろう。 #include<stdio.h> #include<vector> #include<algorithm> #include<set> using namespace std; typedef pair<int, int>pii; t</int,></set></algorithm></vector></stdio.h>…