General
 
 
# Author Problem Lang Verdict Time Memory Sent Judged  
131543828 Practice:
mrsrz
1065E - 8 C++17 (GCC 9-64) Accepted 46 ms 4200 KB 2021-10-11 14:36:29 2021-10-11 14:36:30
→ Source
#include<bits/stdc++.h>
using namespace std;
const int md=998244353;
typedef long long LL;
int ans=1,n,m,c,p;
inline int pow(int a,int b){
	int res=1;
	for(;b;b>>=1,a=(LL)a*a%md)if(b&1)res=(LL)res*a%md;
	return res;
}
int main(){
	ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
	cin>>n>>m>>c;
	for(int x;m--;p=x){
		cin>>x;
		int k=pow(c,x-p);
		ans=((LL)k*k+k)/2%md*ans%md;
	}
	ans=(LL)ans*pow(c,n-p-p)%md;
	cout<<ans<<'\n';
	return 0;
}
?
Time: ? ms, memory: ? KB
Verdict: ?
Input
?
Participant's output
?
Jury's answer
?
Checker comment
?
Diagnostics
?
Click to see test details