#include<cstdio>
#include<iostream>
#include<cmath>
#include<algorithm>
#include<cstring>
using namespace std;
void read(int& x)
{
x = 0;
char c = getchar();
bool flag = 0;
while(c<'0'||c>'9')
{
if(c=='-')flag=1;
c = getchar();
}
while(c>='0'&&c<='9')
{
x = x*10+c-'0';
c =getchar();
}
if(flag)x = -x;
}
#define maxn 1001000
#define eps 0.000001
typedef long long ll;
double ans = 0.0;
int n,p;
int a[maxn];
int pre[maxn],suf[maxn];
double tmp;
int main()
{
#define AC
#ifdef AC
freopen("nsq.in","r",stdin);
freopen("nsq.out","w",stdout);
#endif
read(n),read(p);
for(int i=1;i<=n;i++)read(a[i]);
pre[0] = 1,suf[n+1]=1;
for(int i=1;i<=n;i++)pre[i] = (ll)pre[i-1]*a[i]%p;
for(int i=n;i
test·A·Summary

最新推荐文章于 2024-09-11 07:46:39 发布
