D. Artsem and Saunders 题目连接: http://codeforces.com/contest/765/problem/D Description Artsem has a friend Saunders from University of Chicago. Saunders presented him with the following problem. Let [n] denote the set {1, ..., n}. We will also write f:…
A. Neverending competitions time limit per test 2 seconds memory limit per test 512 megabytes input standard input output standard output There are literally dozens of snooker competitions held each year, and team Jinotega tries to attend them all (f…
地址:http://codeforces.com/contest/765/problem/D 题目: D. Artsem and Saunders time limit per test 2 seconds memory limit per test 512 megabytes input standard input output standard output Artsem has a friend Saunders from University of Chicago. Saunders…
根据那两个式子 g(h(x))=x h(g(x))=f(x) 可以推出来两个新的式子 g(f(x))=g(x) h(x)=f(h(x)) 于是,我们先找到f(x)的所有不动点,有几个不动点,m就是多少,将它们依次赋值给h(1),h(2),...,h(m),对应的g(h(i))赋值成1,2,..,m 然后如果对于某个i,g(f(i))不存在的话,则无解,否则有解,将g和h依次输出即可. #include<cstdio> using namespace std; int n,f[100010],g…
F. Souvenirs 题目连接: http://codeforces.com/contest/765/problem/F Description Artsem is on vacation and wants to buy souvenirs for his two teammates. There are n souvenir shops along the street. In i-th shop Artsem can buy one souvenir for ai dollars, a…
E. Tree Folding 题目连接: http://codeforces.com/contest/765/problem/E Description Vanya wants to minimize a tree. He can perform the following operation multiple times: choose a vertex v, and two disjoint (except for v) paths of equal length a0 = v, a1,…
C. Table Tennis Game 2 题目连接: http://codeforces.com/contest/765/problem/C Description Misha and Vanya have played several table tennis sets. Each set consists of several serves, each serve is won by one of the players, he receives one point and the lo…
B. Code obfuscation 题目连接: http://codeforces.com/contest/765/problem/B Description Kostya likes Codeforces contests very much. However, he is very disappointed that his solutions are frequently hacked. That's why he decided to obfuscate (intentionally…
A. Neverending competitions 题目连接: http://codeforces.com/contest/765/problem/A Description There are literally dozens of snooker competitions held each year, and team Jinotega tries to attend them all (for some reason they prefer name "snookah")!…
地址:http://codeforces.com/contest/765/problem/E 题目: E. Tree Folding time limit per test 2 seconds memory limit per test 512 megabytes input standard input output standard output Vanya wants to minimize a tree. He can perform the following operation mu…