随笔分类 - OJ 计蒜客
摘要:query Given a permutation pp of length nn, you are asked to answer mm queries, each query can be represented as a pair (l ,r )(l,r), you need to find
阅读全文
摘要:XKC's basketball team XKC , the captain of the basketball team , is directing a train of nn team members. He makes all members stand in a row , and nu
阅读全文
摘要:Travel There are nn planets in the MOT galaxy, and each planet has a unique number from 1 \sim n1∼n. Each planet is connected to other planets through
阅读全文
摘要:Swap There is a sequence of numbers of length nn, and each number in the sequence is different. There are two operations: Swap the first half and the
阅读全文
摘要:Tree Ming and Hong are playing a simple game called nim game. They have nn piles of stones numbered 11 to nn ,the ii-th pile of stones has a_iai ston
阅读全文
摘要:Angel's Journey “Miyane!” This day Hana asks Miyako for help again. Hana plays the part of angel on the stage show of the cultural festival, and she i
阅读全文
摘要:Tasks It's too late now, but you still have too much work to do. There are nn tasks on your list. The ii-th task costs you t_itiseconds. You want to
阅读全文
摘要:Max answer Alice has a magic array. She suggests that the value of a interval is equal to the sum of the values in the interval, multiplied by the sma
阅读全文
摘要:Distance on the tree DSM(Data Structure Master) once learned about tree when he was preparing for NOIP(National Olympiad in Informatics in Provinces)
阅读全文
摘要:程序设计:蒜厂年会 问答问题反馈 只看题面 16.79% 1000ms 262144K 在蒜厂年会上有一个抽奖,在一个环形的桌子上,有 nn 个纸团,每个纸团上写一个数字,表示你可以获得多少蒜币。但是这个游戏比较坑,里面竟然有负数,表示你要支付多少蒜币。因为这些数字都是可见的,所以大家都是不会出现的
阅读全文
摘要:J. Sum 26.87% 1000ms 512000K A square-free integer is an integer which is indivisible by any square number except 11. For example, 6 = 2 \cdot 36=2⋅3
阅读全文
摘要:G. Lpl and Energy-saving Lamps 42.07% 1000ms 65536K During tea-drinking, princess, amongst other things, asked why has such a good-natured and cute Dr
阅读全文
摘要:A. An Olympian Math Problem 54.28% 1000ms 65536K Alice, a student of grade 66, is thinking about an Olympian Math problem, but she feels so despair th
阅读全文
摘要:H.Ryuji doesn't want to study 27.34% 1000ms 262144K Ryuji is not a good student, and he doesn't want to study. But there are n books he should learn,
阅读全文
摘要:F. Features Track Morgana is learning computer vision, and he likes cats, too. One day he wants to find the cat movement from a cat video. To do this,
阅读全文
摘要:M. Big brother said the calculation 通过线段树维护。 这个题和杭电的一道题几乎就是一样的题目。HDU5649.DZY Loves Sorting 题意就是一个n的排列,执行Q次操作,每次操作是对某个区间从小到大排序或者从大到小排序。最后只查询一次,输出第k个位置当
阅读全文
摘要:ACM训练联盟周赛 这一场有几个数据结构的题,但是自己太菜,不会树套树,带插入的区间第K小-替罪羊套函数式线段树, 先立个flag,BZOJ3065: 带插入区间K小值 计蒜客 Zeratul与Xor 赛后知道这是个01字典树的题目(嘤嘤嘤???) 这一场写了两道(具体来说就一道)就开溜了,但是计蒜
阅读全文
摘要:K. Upside down primes 传送门 这个题就是把大数按字符串输进去,判断一下是不是素数,然后反转180度,先判断反转之后的东西是不是一个数,如果是的话,再把这个数判一下是不是素数,如果都满足条件就yes。 直接调用两次米勒拉宾判大素数就可以了。 代码: 就这些,没了。 因为这场没找到
阅读全文
摘要:这一场两个和大数有关的题目,都用到了米勒拉宾算法,有点东西,备忘一下。 题目传送门 F. Divisions 传送门 这个题是求一个数的所有因子个数,但是数据比较大,1e18,所以是大数的题目,正常的求因数的或者求质因数的都过不了,因为这一场的K是米勒拉宾判大素数,先过的K题,所以这个题直接头铁用M
阅读全文
摘要:E.Extreme Sort 传送门 代码:
阅读全文