SCP-bzoj-4734
2024-10-07 17:59:49
项目编号:bzoj-4734
项目等级:Safe
项目描述:
特殊收容措施:
附录:
#include <bits/stdc++.h>
#define range(i,c,o) for(register int i=(c);i<(o);++i)
using namespace std; // quick_io BEGIN HERE
#ifdef __WIN32
#define getC getchar
#else
#define getC getchar_unlocked
#endif inline unsigned getU()
{
char c; unsigned r=;
while(!isdigit(c=getC()));
for(;isdigit(c);c=getC())
{
r=(r<<)+(r<<)+c-'';
}
return r;
}
// quick_io END HERE static const int AwD=; inline int rev(const int&x)
{
int ret=;
for(int i=AwD-,j=x;i;i>>=,j=1LL*j*j%AwD)
{
if(i&) ret=1LL*ret*j%AwD;
}
return ret;
} int b[],f[]; int main()
{
int N=getU(),M=getU(),x=getU();
range(i,,M+) f[i]=getU();
range(i,,M+)
{
b[i]=f[];
range(j,,M-i)
{
f[j]=f[j+]-f[j];
if(f[j]<) f[j]+=AwD;
}
}
int ans=b[],C=,X=;
range(i,,M+)
{
C=1LL*C*(N-i+)%AwD*rev(i)%AwD;
X=1LL*X*x%AwD;
ans=(ans+1LL*b[i]*C%AwD*X)%AwD;
}
return printf("%d\n",ans),;
}
最新文章
- 将Matlab中的矩阵输出到txt文件
- MSSQL 多行合并为一行
- poj 2051.Argus 解题报告
- CSS3 里添加自定义字体
- C# 中distinct的使用
- Redis是什么?Redis数据库全解?
- 怎样用VB自动更新应用程序
- 【BZOJ3270】【高斯消元】博物馆
- IOS 企业版证书($299)In-House方式发布指南
- CSS控制文本超出后隐藏并用省略号代替
- 严重: Servlet.service() for servlet jsp threw exception java.lang.IllegalStateException: getOutputStream() has already been called for this response
- 手机自动化测试:appium源码分析之bootstrap十一
- LeetCode 169 Majority Element 解题报告
- cookie和sission的原理及异同
- Qt之QTreeWidget入门
- latex之矩阵表示
- 字符驱动之二操作方法(struct file_operations)【转】
- Html 常见meta
- 解决 office2016 意外的严重错误 不能启动程序
- Summary: Stack Overflow Error