ural 2124
题意
做法
求出一个原根\(\omega\),对于每个数\(x\)写成\(x=\omega^{k}\)的形式,\(\delta(x)=\frac{p-1}{k}\)
我们不关心群具体的东西,用\(\omega\)表示,求阶就方便了
但在模意义下,区间乘求\(gcd\),是件很困难的事
但商分一下,\(b_i=a_{i}\times a_{i-1}^{-1}\),就可以单点修改了
题外话
题目链接网址含有敏感词...只能放个百度的链接了
ural 2124的更多相关文章
- BZOJ 2124: 等差子序列
Sol 线段树+Hash. 首先暴力 等差子序列至少3项就可以了,就枚举中项,枚举公差就可以了,只需要一个数在中项前出现,另一个数在中项前没出现过就可以了.复杂度 \(O(n^2)\) 然后我想了一个 ...
- 后缀数组 POJ 3974 Palindrome && URAL 1297 Palindrome
题目链接 题意:求给定的字符串的最长回文子串 分析:做法是构造一个新的字符串是原字符串+反转后的原字符串(这样方便求两边回文的后缀的最长前缀),即newS = S + '$' + revS,枚举回文串 ...
- ural 2071. Juice Cocktails
2071. Juice Cocktails Time limit: 1.0 secondMemory limit: 64 MB Once n Denchiks come to the bar and ...
- ural 2073. Log Files
2073. Log Files Time limit: 1.0 secondMemory limit: 64 MB Nikolay has decided to become the best pro ...
- ural 2070. Interesting Numbers
2070. Interesting Numbers Time limit: 2.0 secondMemory limit: 64 MB Nikolay and Asya investigate int ...
- ural 2069. Hard Rock
2069. Hard Rock Time limit: 1.0 secondMemory limit: 64 MB Ilya is a frontman of the most famous rock ...
- ural 2068. Game of Nuts
2068. Game of Nuts Time limit: 1.0 secondMemory limit: 64 MB The war for Westeros is still in proces ...
- ural 2067. Friends and Berries
2067. Friends and Berries Time limit: 2.0 secondMemory limit: 64 MB There is a group of n children. ...
- ural 2066. Simple Expression
2066. Simple Expression Time limit: 1.0 secondMemory limit: 64 MB You probably know that Alex is a v ...
随机推荐
- ros中坐标系管理系统
首先安装小海龟实例的功能包ros-melodic-turtle-tf qqtsj ~ sudo apt install ros-melodic-turtle-tf [sudo] qqtsj ...
- jmeter性能测试2:基础功能介绍
对于英语不好的同学建议先改为简体中文再进行使用 1.添加->threads->线程组(控制总体并发) 线程数:虚拟用户数.一个虚拟用户占用一个进程或线程 ...
- asp.net core 3.x 身份验证-2启动阶段的配置
注册服务.配置选项.添加身份验证方案 在Startup.ConfigureServices执行services.AddAuthentication() 注册如下服务(便于理解省略了部分辅助服务): s ...
- python 类 --导入类
导入类 1.1.导入单个类 如何导入单个类 以上一节为例,编写一个car.py程序 编写一个新程序my_car.py 希望在my.car.py文件中直接使用car.py中的函数,使用from car ...
- Codeforces_739_B
http://codeforces.com/problemset/problem/739/B dfs,记录距离前缀和,每次找到离最近的不符合的点. #include<iostream> # ...
- CCF_201503-2_数字排序
自己写个排序的cmp. #include<iostream> #include<cstdio> #include<algorithm> using namespac ...
- java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener,环境Spring+Maven
记录一下莫名出现的错误.Spring+Maven+STS. 严重: Error configuring application listener of class org.springframewor ...
- 编写 Django 应用单元测试
作者:HelloGitHub-追梦人物 文中所涉及的示例代码,已同步更新到 HelloGitHub-Team 仓库 我们博客功能越来越来完善了,但这也带来了一个问题,我们不敢轻易地修改已有功能的代码了 ...
- [Redis-CentOS7]Redis安装(-)
系统环境 CentOS Linux release 7.7.1908 (Core) yum安装 yum install redis Loaded plugins: fastestmirror Load ...
- [Python]公司接口返回值规范
返回值规范 json { "code":200, "message":"" "data":[ { "title ...