B. Continued Fractions time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output A continued fraction of height n is a fraction of form . You are given two rational numbers, one is represented as a…
Codeforces 979 D. Kuro and GCD and XOR and SUM 题目大意:有两种操作:①给一个数v,加入数组a中②给出三个数x,k,s:从当前数组a中找出一个数u满足 u与x的gcd可以被k整除,u不大于s-x,且与x的异或和最大. 思路:之前没有碰到过异或和最值的问题,所以是懵逼的.学习了01字典树后把这题补出来. 碰到操作①就上树,上树过程中注意不断维护每个节点往后路径中的最小值(具体见代码细节): 碰到操作②,如果k==1,那么从树上找数的同时注意限制条件最小…
A continued fraction of height n is a fraction of form . You are given two rational numbers, one is represented as and the other one is represented as a finite fraction of height n. Check if they are equal. Input The first line contains two space-se…
C. Maximal GCD time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output You are given positive integer number n. You should create such strictly increasing sequence of k positive numbers a1, a2, ...…
You are given positive integer number n. You should create such strictly increasingsequence of k positive numbers a1, a2, ..., ak, that their sum is equal to n and greatest common divisor is maximal. Greatest common divisor of sequence is maximum of…
任意门:http://codeforces.com/gym/100641/attachments Con + tin/(ued + Frac/tions) Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 217 Accepted Submission(s): 27 Description The (simple) contin…