LibreOJ #525. 「LibreOJ β Round #4」多项式
二次联通门 : LibreOJ #525. 「LibreOJ β Round #4」多项式
官方题解 :




/*
LibreOJ #525. 「LibreOJ β Round #4」多项式 由于会有多种解
所以只需要找出一组特殊解即可 */
#include <cstdio>
#include <iostream> void read (int &now)
{
register char c = getchar ();
for (now = ; !isdigit (c); c = getchar ());
for (; isdigit (c); now = now * + c - '', c = getchar ());
} int Main ()
{
int N; read (N); register int i, j; int L = N;
int phi = ; if (N == ) return printf ("-1"), ;
for (i = ; i * i <= L; ++ i)
if (L % i == )
{
L /= i, phi *= (i - );
for (; L % i == ; L /= i, phi *= i);
}
if (L != ) phi *= L - ;
printf ("%d\n", L = phi << | ); ++ phi;
for (i = ; i < phi; ++ i) printf ("0 ");
printf ("%d ", N - );
for (++ i; i < L; ++ i) printf ("0 ");
printf ("");
return ;
} int ZlycerQan = Main ();
int main (int argc, char *argv[]) {;}
LibreOJ #525. 「LibreOJ β Round #4」多项式的更多相关文章
- [LOJ#525]「LibreOJ β Round #4」多项式
[LOJ#525]「LibreOJ β Round #4」多项式 试题描述 给定一个正整数 k,你需要寻找一个系数均为 0 到 k−1 之间的非零多项式 f(x),满足对于任意整数 x 均有 f(x) ...
- LibreOJ #517. 「LibreOJ β Round #2」计算几何瞎暴力
二次联通门 : LibreOJ #517. 「LibreOJ β Round #2」计算几何瞎暴力 /* LibreOJ #517. 「LibreOJ β Round #2」计算几何瞎暴力 叫做计算几 ...
- LibreOJ #528. 「LibreOJ β Round #4」求和
二次联通门 : LibreOJ #528. 「LibreOJ β Round #4」求和 /* LibreOJ #528. 「LibreOJ β Round #4」求和 题目要求的是有多少对数满足他们 ...
- LibreOJ #527. 「LibreOJ β Round #4」框架
二次联通门 : LibreOJ #527. 「LibreOJ β Round #4」框架 /* LibreOJ #527. 「LibreOJ β Round #4」框架 %% xxy dalao 对于 ...
- LibreOJ #526. 「LibreOJ β Round #4」子集
二次联通门 : LibreOJ #526. 「LibreOJ β Round #4」子集 /* LibreOJ #526. 「LibreOJ β Round #4」子集 考虑一下,若两个数奇偶性相同 ...
- LibreOJ #524. 「LibreOJ β Round #4」游戏
二次联通门 : LibreOJ #524. 「LibreOJ β Round #4」游戏 /* LibreOJ #524. 「LibreOJ β Round #4」游戏 找找规律就会发现.. 当有X的 ...
- LibreOJ #507. 「LibreOJ NOI Round #1」接竹竿
二次联通门 : LibreOJ #507. 「LibreOJ NOI Round #1」接竹竿 /* LibreOJ #507. 「LibreOJ NOI Round #1」接竹竿 dp 记录一下前驱 ...
- LibreOJ #516. 「LibreOJ β Round #2」DP 一般看规律
二次联通门 : LibreOJ #516. 「LibreOJ β Round #2」DP 一般看规律 /* LibreOJ #516. 「LibreOJ β Round #2」DP 一般看规律 set ...
- LibreOJ #6191. 「美团 CodeM 复赛」配对游戏
二次联通门 : LibreOJ #6191. 「美团 CodeM 复赛」配对游戏 /* LibreOJ #6191. 「美团 CodeM 复赛」配对游戏 概率dp */ #include <cs ...
随机推荐
- [LOJ2541] [PKUWC2018] 猎人杀
题目链接 LOJ:https://loj.ac/problem/2541 Solution 很巧妙的思路. 注意到运行的过程中概率的分母在不停的变化,这样会让我们很不好算,我们考虑这样转化:假设所有人 ...
- SpringBoot指定额外需要扫描的包
我们都知道,SpringBoot主启动类标注了@SpringBootApplication注解,该注解引入了@ComponentScan注解 所以默认的包扫描规则是,程序会自动扫描主启动类所在包及其子 ...
- SpringBoot--整合Mybatis+druid
分为两部分,首先替换默认数据源为阿里德鲁伊并添加监控,其次是SpringBoot下使用Mybatis 替换数据源为德鲁伊 首先在配置文件里配置好数据库连接的基本信息,如username passwor ...
- java之struts2之ServletAPI
在之前的学习中struts2已经可以处理大部分问题了.但是如果要将用户登录数据存入session中,可以有两种方式开存入ServletAPI. 一种解耦合方式,一种耦合方式. 1. 解耦合方式 解耦合 ...
- c#-Json-Json字符串字段递归排序
private static dynamic GetSorObject (Object obj) { if (obj is JArray) { var list = new List<dynam ...
- Cookie 和 Session 总结
Cookie 和 Session 区别 cookie数据存放在客户的浏览器上,session数据放在服务器上 cookie不是很安全,别人可以分析存放在本地的cookie并进行cookie欺骗,考虑* ...
- jmeter中assertion的使用
用于检查测试中得到的响应数据等是否符合预期,用以保证性能测试过程中的数据交互与预期一致. 最新版本的3.0jmeter中有13种不同的断言: 1)BeanShell断言:针对sampler中的Bean ...
- PHP基础之输出缓冲区基本概念、原理分析
一.概念 在PHP运行的过程中,可以将会产生输出的函数或操作结果暂时保存在PHP的缓冲区,只有当缓冲区满了.或者PHP运行完毕.或者在必要时候进行输出,才会将数据输出到浏览器,此缓冲数据的区域称为PH ...
- 系统调用IO和标准IO
目录 1. 系统调用IO(无缓冲IO) 系统调用 常用系统调用IO函数 open close read write lseek ioctl 2. 标准IO(带缓冲IO) 概述 缓冲与冲洗 常用标准IO ...
- mysqldump 备份与恢复数据库
备份数据库 mysqldump -u root -plvtao test > /home/bak.sql 数据库还原,常用source 命令登陆 mysql -u root -p mysql&g ...