Lorenzo Von Matterhorn Barney lives in NYC. NYC has infinite number of intersections numbered with positive integers starting from 1. There exists a bidirectional road between intersections i and 2i and another road between i and 2i + 1 for every pos…
C. Lorenzo Von Matterhorn time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Barney lives in NYC. NYC has infinite number of intersections numbered with positive integers starting from 1. Ther…
2018-03-16 http://codeforces.com/problemset/problem/697/C C. Lorenzo Von Matterhorn time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Barney lives in NYC. NYC has infinite number of intersect…
Lorenzo Von Matterhorn time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Barney lives in NYC. NYC has infinite number of intersections numbered with positive integers starting from 1. There e…
题目链接: A. Lorenzo Von Matterhorn time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Barney lives in NYC. NYC has infinite number of intersections numbered with positive integers starting from 1…
http://codeforces.com/contest/697/problem/C C. Lorenzo Von Matterhorn time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Barney lives in NYC. NYC has infinite number of intersections numbered…
原题链接:http://codeforces.com/contest/696/problem/A 原题描述: Lorenzo Von Matterhorn Barney lives in NYC. NYC has infinite number of intersections numbered with positive integers starting from 1. There exists a bidirectional road between intersections i a…
A. Lorenzo Von Matterhorn time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Barney lives in NYC. NYC has infinite number of intersections numbered with positive integers starting from 1. Ther…
Least Common Ancestors 节点范围是1~1e18,至多1000次询问. 只要不断让深的节点退一层(>>1)就能到达LCA. 用点来存边权,用map储存节点和父亲连边的权值. #include<cstdio> #include<map> #define ll long long using namespace std; map<ll,ll>m; ll u,v,w; void add(){ while(u!=v){ if(u<v){ m…