QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#719137#5817. 小学生数学题Wei_HanCompile Error//C++141.2kb2024-11-06 22:42:022024-11-06 22:42:02

Judging History

你现在查看的是最新测评结果

  • [2024-11-06 22:42:02]
  • 评测
  • [2024-11-06 22:42:02]
  • 提交

answer

#include<bits/stdc++.h>
#define INF 0x3f3f3f3f3f3f3f3f
#define inf 0x3f3f3f3f
#define pr putchar('\n')
#define pp putchar(' ')
#define pii pair<ll,ll>
#define pdi pair<ll,ll>
#define mem(aa,bb) memset(aa,bb,sizeof(aa))
#define fo(a,i,b) for(register ll i = a ; i <= b ; ++ i )
#define Fo(a,i,b) for(register ll i = a ; i >= b ; -- i )
#define fi first
#define se second
#define pb push_back
//#pragma GCC optimize(2)
using namespace std;
typedef long long ll;
//typedef int ll;
//typedef __int128 ll;
typedef double db;
const int N=2e7+5,M=2e6+5;
inline void read(ll &opp){ll x=0,t=1;char ch;ch=getchar();while(ch<'0'||ch>'9'){if(ch=='-'){t=-1;}ch=getchar();}while(ch>='0'&&ch<='9'){x=(x<<1)+(x<<3)+(ch^48);ch=getchar();}opp=x*t;return; }
inline void wr(ll x){if(x<0){putchar('-');x=-x;}if(x>9){wr(x/10);}putchar(x%10+'0');}
ll n,k,pre[N],fac[N],suf[N],num=1;
const ll mod=998244353;
inline ll qpow(ll a,ll b){return (!b?1:qpow(a*a%mod,b>>1)*((b&1)?a:1)%mod);}
signed main(){
	read(n),read(k);pre[0]=1;fo(1,i,n) pre[i]=pre[i-1]*i%mod,num=num*i%mod;fac[n]=n;fac[n+1]=1;Fo(n-1,i,1) fac[i]=fac[i+1]*i%mod;
	ll sum=0;fo(1,i,n) sum=(sum+pre[i]*qpow(pre[i-1]*fac[i+1]mod,k)%mod)%mod;wr(sum*qpow(qpow(pre[n],k),mod-2)%mod),pr;
	return 0; 
}

Details

answer.code: In function ‘int main()’:
answer.code:28:66: error: expected ‘)’ before ‘mod’
   28 |         ll sum=0;fo(1,i,n) sum=(sum+pre[i]*qpow(pre[i-1]*fac[i+1]mod,k)%mod)%mod;wr(sum*qpow(qpow(pre[n],k),mod-2)%mod),pr;
      |                                                ~                 ^~~
      |                                                                  )