QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#67251 | #5099. 朝圣道 | Fy5Fengye | Compile Error | / | / | C++14 | 526b | 2022-12-10 11:09:24 | 2022-12-10 11:09:26 |
Judging History
你现在查看的是最新测评结果
- [2023-08-10 23:21:45]
- System Update: QOJ starts to keep a history of the judgings of all the submissions.
- [2022-12-10 11:09:26]
- 评测
- 测评结果:Compile Error
- 用时:0ms
- 内存:0kb
- [2022-12-10 11:09:24]
- 提交
answer
#include<bits/stdc++.h>
#define int long long
// #include "pilgrimage.h"
using namespace std;
int mo;
int nss,nsr;
int qpow(int x,int y){int ret=1;while(y){if(y&1)ret=ret*x%mo;y>>=1;x=x*x%mo;}return ret;}
void init(int o,int p)
{
mo=p;
nss=qpow(2,mo-2);
}
int ask(long long n)
{
int cs=1;
nsr=qpow(nss,n);
int ret=nsr*cs*n%mo;
for(int i=1;i<=n;++i)
{
cs=cs*(n-i+1)%mo;
cs=cs*qpow(i,mo-2)%mo;
ret=(ret+cs*nsr%mo*abs(n-i-i))%mo;
}
return ret;
}
详细
/usr/bin/ld: /tmp/cc982wRf.o: in function `main': implementer.cpp:(.text.startup+0x2b): undefined reference to `init(int, int)' collect2: error: ld returned 1 exit status