#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
const LL MOD=998244353;
template<typename node> void read(node &a){
bool f=0;
LL x=0;
char ch=getchar();
while(ch<'0'||ch>'9'){
if(ch=='-') f=1;
ch=getchar();
}
while(ch>='0'&&ch<='9'){
x=((x<<1)%MOD+(x<<3)%MOD+(ch^48))%MOD;
ch=getchar();
}
a=x;
if(f) a=-a;
}
int n,m;
LL a[110];
int q[110],cnt;
inline bool work(LL x){
LL ans=0;
for(int i=n;i;i--)
ans=((ans+a[i])*x)%MOD;
ans=(ans+a[0])%MOD;
return !ans;
}
int main(){
// freopen("P2312_2.in","r",stdin);
cout.tie(0);
read(n);read(m);
for(int i=0;i<n+1;i++) read(a[i]);
// cout<<"Step1"<<endl;
for(LL i=1;i<=m;i++)
if(work(i))
q[++cnt]=i;
cout<<cnt<<endl;
for(int i=1;i<=cnt;i++) cout<<q[i]<<endl;
return 0;
}
估计没几个人能查出我的错。。。
错误就在
ch^48
这里忘打括号了
而+,−,×,÷的优先级大于左右移,与,或和异或运算,所以记住加括号!!!