# Krydom: 暁の水平线に胜利を刻むのです

04/24
17:00

04/20
16:46

## [czyz 2017.04.20 NOIP 模拟赛]

A：先把所有课程按照已经修完的学分从大到小排序，然后0~n枚举把多少课程学分修完，二分算出剩下的天数最多能把没学完的所有课学到多少，复杂度O(nlogn)

04/20
07:53
kruskal

## [CF 472D] Design Tutorial: Inverse the Problem

### ♦♦♦♦♦♦   Description   ♦♦♦♦♦♦

There is an easy way to obtain a new task from an old one called "Inverse the problem": we give an output of the original task, and ask to generate an input, such that solution to the original problem will produce the output we provided. The hard task of Topcoder Open 2014 Round 2C, InverseRMQ, is a good example.

Now let's create a task this way. We will use the task: you are given a tree, please calculate the distance between any pair of its nodes. Yes, it is very easy, but the inverse version is a bit harder: you are given an n × n distance matrix. Determine if it is the distance matrix of a weighted tree (all weights must be positive integers).

04/19
21:47

## [2017.04.18 省选模拟赛] 旅行商

### ♦♦♦♦♦♦   Description   ♦♦♦♦♦♦

moreD共在 $N$ 个城市间倒卖物品。他从 $1$ 号城市出发，自然，这 $N$ 个城市都是要访问到的。

moreD明白这应该需要写算法解决，但是由于3D眩晕症，他现在已经脸如死灰地躺在床上了(◎﹏◎)，显然不能胜任这个任务。于是他希望你能帮他解决这个问题。

04/19
21:39

## [2017.04.18 省选模拟赛] 隔壁老王的简单数列

### ♦♦♦♦♦♦   Description   ♦♦♦♦♦♦

moreD的隔壁室友（人称隔壁老王的）liouzhou_101最近选了数论课，经过一段时间的卓有成效的学习，他非常自信，认为自己的数论水平已经可以吊打全国 $99.99\%$的学生了。O(*￣▽￣*)ブ

04/19
21:26

A：

【防AK好题（？？？）（雾）】

04/19
21:16

## [bzoj 4822] [Cqoi2017]老C的任务

### ♦♦♦♦♦♦   Description   ♦♦♦♦♦♦

大意：给一些点和权值，询问一个矩形内的权值总和，离线
$n, m \le 10 ^ 5$

04/11
13:11

## [bzoj 4756] [Usaco2017 Jan]Promotion Counting

### ♦♦♦♦♦♦   Description   ♦♦♦♦♦♦

The cows have once again tried to form a startup company, failing to remember from past experience that cows make terrible managers!The cows, conveniently numbered 1…N1…N (1≤N≤100,000), organize the company as a tree, with cow 1 as the president (the root of the tree). Each cow except the president has a single manager (its "parent" in the tree). Each cow ii has a distinct proficiency rating, p(i),which describes how good she is at her job. If cow ii is an ancestor (e.g., a manager of a manager of a manager) of cow jj, then we say jj is a subordinate of ii.
Unfortunately, the cows find that it is often the case that a manager has less proficiency than several of her subordinates, in which case the manager should consider promoting some of her subordinates. Your task is to help the cows figure out when this is happening. For each cow ii in the company, please count the number of subordinates jj where p(j)>p(i).
n只奶牛构成了一个树形的公司，每个奶牛有一个能力值pi，1号奶牛为树根。

04/9
16:59