题目链接: C. Bear and Up-Down time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output The life goes up and down, just like nice sequences. Sequence t1, t2, ..., tn is called nice if the following two…
D. Polycarp's Picture Gallery time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Polycarp loves not only to take pictures, but also to show his photos to friends. On his personal website he h…
题意: 给出无向图. good way : 仅有两条边只经过一次,余下边全经过两次的路 问你共有多少条不同的good way. 两条good way不同仅当它们所经过的边的集合中至少有一条不同 (很关键) 存在多个边连通分量的情况肯定是0. 当确定某两条边只经过一次的时候: 由于经过边的顺序不重要,余下边全经过两次,至多只有一条good way 那么把剩下经过两次的边拆分成两条经过一次的边,记现在的图是新图 原图中是否存在good way 就等价于新图中是否存在欧拉路 暴力枚举两条边判断肯定是要…
A. Carrot Cakes time limit per test:1 second memory limit per test:256 megabytes input:standard input output:standard output In some game by Playrix it takes t minutes for an oven to bake k carrot cakes, all cakes are ready at the same moment t minut…