二次联通门 : 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」多项式的更多相关文章

  1. [LOJ#525]「LibreOJ β Round #4」多项式

    [LOJ#525]「LibreOJ β Round #4」多项式 试题描述 给定一个正整数 k,你需要寻找一个系数均为 0 到 k−1 之间的非零多项式 f(x),满足对于任意整数 x 均有 f(x) ...

  2. LibreOJ #517. 「LibreOJ β Round #2」计算几何瞎暴力

    二次联通门 : LibreOJ #517. 「LibreOJ β Round #2」计算几何瞎暴力 /* LibreOJ #517. 「LibreOJ β Round #2」计算几何瞎暴力 叫做计算几 ...

  3. LibreOJ #528. 「LibreOJ β Round #4」求和

    二次联通门 : LibreOJ #528. 「LibreOJ β Round #4」求和 /* LibreOJ #528. 「LibreOJ β Round #4」求和 题目要求的是有多少对数满足他们 ...

  4. LibreOJ #527. 「LibreOJ β Round #4」框架

    二次联通门 : LibreOJ #527. 「LibreOJ β Round #4」框架 /* LibreOJ #527. 「LibreOJ β Round #4」框架 %% xxy dalao 对于 ...

  5. LibreOJ #526. 「LibreOJ β Round #4」子集

    二次联通门 : LibreOJ #526. 「LibreOJ β Round #4」子集 /* LibreOJ #526. 「LibreOJ β Round #4」子集 考虑一下,若两个数奇偶性相同 ...

  6. LibreOJ #524. 「LibreOJ β Round #4」游戏

    二次联通门 : LibreOJ #524. 「LibreOJ β Round #4」游戏 /* LibreOJ #524. 「LibreOJ β Round #4」游戏 找找规律就会发现.. 当有X的 ...

  7. LibreOJ #507. 「LibreOJ NOI Round #1」接竹竿

    二次联通门 : LibreOJ #507. 「LibreOJ NOI Round #1」接竹竿 /* LibreOJ #507. 「LibreOJ NOI Round #1」接竹竿 dp 记录一下前驱 ...

  8. LibreOJ #516. 「LibreOJ β Round #2」DP 一般看规律

    二次联通门 : LibreOJ #516. 「LibreOJ β Round #2」DP 一般看规律 /* LibreOJ #516. 「LibreOJ β Round #2」DP 一般看规律 set ...

  9. LibreOJ #6191. 「美团 CodeM 复赛」配对游戏

    二次联通门 : LibreOJ #6191. 「美团 CodeM 复赛」配对游戏 /* LibreOJ #6191. 「美团 CodeM 复赛」配对游戏 概率dp */ #include <cs ...

随机推荐

  1. .net core使用ocelot---第八篇 Consul

    简介 .net core使用ocelot---第一篇 简单使用   .net core使用ocelot---第二篇 身份验证使用  .net core使用ocelot---第三篇 日志记录  .net ...

  2. js 简单的滑动3

    js 简单的滑动教程(三)   作者:Lellansin 转载请标明出处,谢谢 在前面的基础上(js 简单的滑动教程(二)),我们可以再添加一些功能使程序的可用性更高. 比如自动为图片的LI赋id值, ...

  3. Windows server 2012 R2下安装sharepoint2013

    • 安装windows server 2012 R2 系统,配置IP.系统打补丁,修改主机名.加域后重启.• 安装WEB服务器,勾选windows身份验证 • 安装应用程序服务器 • 安装.NET F ...

  4. 【洛谷 P4248】 [AHOI2013]差异(后缀自动机)

    题目链接 \[ans=\sum_{1<=i<j<=n}len(T_i)+len(T_j)-2*lcp(T_i,T_j)\] 观察这个式子可以发现,前面两个\(len\)是常数,后面的 ...

  5. OO第三单元(地铁,JML)单元总结

    OO第三单元(地铁,JML)单元总结 这是我们OO课程的第二个单元,这个单元的主要目的是让我们熟悉并了解JML来是我们具有规格化编程架构的思想.这个单元的主题一开始并不明了,从第一次作业的路径到第二次 ...

  6. vue 关于子组件向父组件传值$emit触发无效问题

    先贴上代码 子组件代码 //子组件请求接口,用自己封装的axios getupdate(){ this.$post({ url:this.$apis.unitupdate, postType:'jso ...

  7. Android 常用开源库总结(持续更新)

    前言 收集了一些比较常见的开源库,特此记录(已收录350+).另外,本文将持续更新,大家有关于Android 优秀的开源库,也可以在下面留言. 一 .基本控件 TextView HTextView 一 ...

  8. springboot启动后执行一段代码的方式

    文章转载自: https://www.cnblogs.com/zuidongfeng/p/9926471.html https://blog.csdn.net/zknxx/article/detail ...

  9. springboot学习入门简易版七---springboot2.0使用@Async异步执行方法(17)

    1启动类开启异步调用注解 @SpringBootApplication @EnableAsync //开启异步调用 public class StartApplication { 不开启则异步调用无效 ...

  10. 转 Python3 ssl模块不可用的问题

      编译安装完Python3之后,使用pip来安装python库,发现了如下报错:   $ pip install numpy pip is configured with locations tha ...