C. Kuro and Walking Route time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Kuro is living in a country called Uberland, consisting of nn towns, numbered from 11 to nn, and n−1n−1 bidirectio…
题目链接:http://codeforces.com/contest/979/problem/B B. Treasure Hunt time limit per test1 second memory limit per test:256 megabytes input:standard input output:standard output After the big birthday party, Katie still wanted Shiro to have some more fun…
F. Ivan and Burgers 题目链接:https://codeforces.com/contest/1100/problem/F 题意: 给出n个数,然后有多个询问,每次回答询问所给出的区间的异或和最大值. 题解: 考虑离线做法,先把所有的询问区间按照右端点进行排序,然后从1开始逐个将ai插入,插入线性基的同时记录一下位置,最后扫一下,看看哪些的位置是不小于li的即可加入答案. 这种做法在时间复杂度上面是可行的,但是需要注意的是,如果在i这个位置插入最高位为x的线性基,同时在j这个位…
D. MADMAX time limit per test1 second memory limit per test256 megabytes Problem Description As we all know, Max is the best video game player among her friends. Her friends were so jealous of hers, that they created an actual game just to prove that…
B. Radio Station time limit per test2 seconds memory limit per test256 megabytes Problem Dsecription As the guys fried the radio station facilities, the school principal gave them tasks as a punishment. Dustin's task was to add comments to nginx conf…
D. Kuro and GCD and XOR and SUM 字典树真好玩... 牛老板提供的思路:建1e5个 字典树,每个数插入到以它的因子为根所在的字典树中,这样就实现了整除,当然gcd(k, x) = k是必须的 然后如何保证v + x <= s 和 v ^ x 最大呢? 对于v + x <= s,我们可以维护01字典树中,经过每个节点的最小值,这样我们在访问每个节点时,直接min + x <= s 判断是否成立即可, 不成立就不用往下走了,因为最小值都不成立. 对于v ^ x最…
A. DZY Loves Chessboard time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output DZY loves chessboard, and he enjoys playing with it. He has a chessboard of n rows and m columns. Some cells of the c…
B. Inna and New Matrix of Candies time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Inna likes sweets and a game called the "Candy Matrix". Today, she came up with the new game "Can…
C. DZY Loves Sequences time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output DZY has a sequence a, consisting of n integers. We'll call a sequence ai, ai + 1, ..., aj (1 ≤ i ≤ j ≤ n) a subsegment…
A. Inna and Choose Options time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output There always is something to choose from! And now, instead of "Noughts and Crosses", Inna choose a very unusu…
B. DZY Loves Chemistry time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output DZY loves chemistry, and he enjoys mixing chemicals. DZY has n chemicals, and m pairs of them will react. He wants to…
http://codeforces.com/contest/1066/problem/F Maksim walks on a Cartesian plane. Initially, he stands at the point (0,0)(0,0) and in one move he can go to any of four adjacent points (left, right, up, down). For example, if Maksim is currently at the…
Codeforces Round #739 (Div. 3) 20210907.网址:https://codeforces.com/contest/1560. --(叹). A 不希望出现带"3"的数和3的倍数,把剩下的数从小到大排,问第k个是多少.数据范围很小,因此是大水题. B 偶数个人围成圈,按顺时针给每个人编号,不知道总共多少人.问题是,如果知道a和b面对面,那么c和谁面对面.简单的讨论,注意围不成圈的情况(如1和3面对面,问99对面是谁). C 用一种方式(详见题目,很容易的…
Codeforces Round #275 (Div. 1)A. Diverse Permutation Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/482/problem/A Description Permutation p is an ordered set of integers p1, p2, ..., pn, consisting of n distinct posi…