链接:http://agc001.contest.atcoder.jp/tasks/agc001_c 题解(官方): We use the following well-known fact about trees.Let T be a tree, and let D be the diameter of the tree. • If D is even, there exists an vertex v of T such that for each vertex w inT, the dis…
我都出了F了……结果并没有出E……atcoder让我差4分上橙是啥意思啊…… C - Together 题意:把每个数加1或减1或不变求最大众数. #include<cstdio> #include<algorithm> using namespace std; int read_p,read_ca; inline int read(){ read_p=;read_ca=getchar(); ') read_ca=getchar(); +read_ca-,read_ca=getch…
D - Menagerie Time limit : 2sec / Memory limit : 256MB Score : 500 points Problem Statement Snuke, who loves animals, built a zoo. There are N animals in this zoo. They are conveniently numbered 1 through N, and arranged in a circle. The animal numbe…
A - K-City Time limit : 2sec / Memory limit : 256MB Score : 100 points Problem Statement In K-city, there are n streets running east-west, and m streets running north-south. Each street running east-west and each street running north-south cross each…
D - joisino's travel Time Limit: 2 sec / Memory Limit: 256 MB Score : 400400 points Problem Statement There are NN towns in the State of Atcoder, connected by MM bidirectional roads. The ii-th road connects Town AiAi and BiBi and has a length of CiCi…
题目链接:https://abc042.contest.atcoder.jp/tasks/arc058_b 题目大意: 给定一个 H * W 的矩阵,其中左下角 A * B 区域是禁区,要求在不踏入禁区的前提下,从左上角走到右下角一共有多少种走法? 分析: 设 D 为往下,R为往左. 这里举个 H = 10,W = 7,A = 3,B = 4的例子: 首先不管怎么走,路线都是要跨越蓝色边界线的,这里我们只讨论从 A 跨越到 B 的情况,其余情况同理. 在这种情况下,总的路数就是所有从 S 走到…