$Luogu$

$Sol$

枚举解+秦九韶公式计算+取模.

$Code$

#include<iostream>
#include<cstdio>
#include<cstring>
#include<queue>
#include<algorithm>
#define il inline
#define Rg register
#define go(i,a,b) for(Rg int i=a;i<=b;++i)
#define yes(i,a,b) for(Rg int i=a;i>=b;--i)
#define e(i,u) for(Rg int i=b[u];i;i=a[i].nt)
#define mem(a,b) memset(a,b,sizeof(a))
#define ll long long
#define ull unsigned long long
#define db double
#define inf 2147483647
using namespace std;
const int N=1000010,mod=1000000007;
il int read()
{
ll x=0;int y=1;char c=getchar();
while(c<'0'||c>'9'){if(c=='-')y=-1;c=getchar();}
while(c>='0'&&c<='9'){x=((x<<1)%mod+(x<<3)%mod+c-'0')%mod;c=getchar();}
return x*y;
}
int n,m,ct,as[N],a[N];
il bool ck(int x)
{
ll ret=0;
yes(i,n,0)ret=(ret*x%mod+a[i])%mod;
if(ret==0)return 1;return 0;
}
int main()
{
n=read(),m=read();
go(i,0,n)a[i]=read();
go(i,1,m)if(ck(i))as[++ct]=i;
printf("%d\n",ct);
go(i,1,ct)printf("%d\n",as[i]);
return 0;
}

随机推荐

  1. Vue.js 第4章 组件与路由

    组件 什么是组件:组件就是一些标签结构的封装,同时为这些结构添加需要的业务逻辑,设置你想要的样式 一个组件中一般可以设置:结构,功能和样式 为什么要使用组件: 使用方便 复用 组件的创建和使用 组件的 ...

  2. Python类型模块:types

    types模块中定义了Python中所有的类型,包括NoneType,  TypeType,  IntType,  FloatType,  BooleanType,  BufferType,  Bui ...

  3. 13 Free GIS Software Options: Map the World in Open Source

    13 Free GIS Software Options: Map the World in Open Source   A LIST OF FREE OPEN SOURCE MAPPING SOFT ...

  4. Android 使用SystemBarTint设置状态栏颜色

    做项目时,发现APP的状态栏是系统默认的颜色,突然想到,为啥别的APP是自己设置的颜色(和APP本身很相搭),于是也想给自己的APP设置系统状态栏的颜色,更加美美哒... 搜了下,发现原来设置状态栏居 ...

  5. [ Laravel 5.6 文档 ] 安全系列 —— 重置密码

    http://laravelacademy.org/post/8929.html 简介 想要快速实现该功能?只需要在新安装的 Laravel 应用下运行 php artisan make:auth(如 ...

  6. Laravel实现定时任务的示例代码

    https://mp.weixin.qq.com/s/VUEqjwcHRb0ovhP0wup36A 最近在玩Laravel实现定时任务,这个是示例代码,可以参照这个实例.有需要的可以看看 定时任务是后 ...

  7. 【CSS3 + 原生JS】移动的标签

    左图为本博客右侧截取的GIF图,右图为代码效果 HTML: <!DOCTYPE html> <html lang="en"> <head> &l ...

  8. Python--day64--author表多对多关联book表

    数据库数据结构设计:

  9. Python--day21--异常处理

    初识try: except -->异常处理 万能异常的用法:except Exception as error:

  10. 2018-3-7-VisualStudio-csproj-添加-ItemGroup-的-Service-

    title author date CreateTime categories VisualStudio csproj 添加 ItemGroup 的 Service lindexi 2018-3-7 ...