09 2018 档案
摘要:欧拉函数: 对正整数n,欧拉函数是少于或等于n的数中与n互质的数的数目。 POJ 2407.Relatives-欧拉函数 代码O(sqrt(n)): 欧拉线性筛素数 洛谷 P3383 【模板】线性筛素数-线性筛素数(欧拉筛素数)基础题贴个板子备忘 代码改了一点东西O(n): 最后传送一下队友的博客:
阅读全文
摘要:1036: [ZJOI2008]树的统计Count Description 一棵树上有n个节点,编号分别为1到n,每个节点都有一个权值w。我们将以下面的形式来要求你对这棵树完成一些操作: I. CHANGE u t : 把结点u的权值改为t II. QMAX u v: 询问从点u到点v的路径上的节点
阅读全文
摘要:Tree Time Limit: 5000MS Memory Limit: 131072K Total Submissions: 12247 Accepted: 3151 Description You are given a tree with N nodes. The tree’s nodes
阅读全文
摘要: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
阅读全文
摘要:P3383 【模板】线性筛素数 题目描述 如题,给定一个范围N,你需要处理M个某数字是否为质数的询问(每个数字均在范围1-N内) 输入输出格式 输入格式: 第一行包含两个正整数N、M,分别表示查询的范围和查询的个数。 接下来M行每行包含一个不小于1且不大于N的整数,即询问该数是否为质数。 输出格式:
阅读全文
摘要: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,
阅读全文
摘要:3223: Tyvj 1729 文艺平衡树 Description 您需要写一种数据结构(可参考题目标题),来维护一个有序数列,其中需要提供以下操作:翻转一个区间,例如原有序序列是5 4 3 2 1,翻转区间是[2,4]的话,结果是5 2 3 4 1 您需要写一种数据结构(可参考题目标题),来维护一
阅读全文
摘要:3224: Tyvj 1728 普通平衡树 Description 您需要写一种数据结构(可参考题目标题),来维护一些数,其中需要提供以下操作:1. 插入x数2. 删除x数(若有多个相同的数,因只删除一个)3. 查询x数的排名(若有多个相同的数,因输出最小的排名)4. 查询排名为x的数5. 求x的前
阅读全文