#include <bits/stdc++.h>
using namespace std;
const int mod=998244353;
long long b[200007];
long long ksm(long long x,long long y){//快速幂
    long long ans=1;
    while(x){
        if(x&1)
            ans=ans*y%mod;
        y=y*y%mod;
        x>>=1;
    }
    return ans;
}
int main(){
    long long n,m,a;
    scanf("%lld%lld%lld",&n,&m,&a);
    long long ans=1;
    for(int i=1;i<=m;i++){
        scanf("%lld",&b[i]);
        long long c=ksm(b[i]-b[i-1],a);//多出来的部分进行排列组合
        ans=c*(c+1)/2%mod*ans%mod;//左右各多余部分的a次方,即x^2a,减去左右倒置后相同,即与一边的组合情况数量相等,即x^a,除以二得到交换后相同的数量再加上之前被减去的左右镜像的x^a种得到答案
    }
    ans=ans*ksm(n-2*b[m],a)%mod;//快速幂乘上还未组合过的
    printf("%lld\n",ans);
    return 0;
}

Educational Codeforces Round 52E(构造,快速幂)的更多相关文章

  1. Educational Codeforces Round 60 (Rated for Div. 2) - D. Magic Gems(动态规划+矩阵快速幂)

    Problem   Educational Codeforces Round 60 (Rated for Div. 2) - D. Magic Gems Time Limit: 3000 mSec P ...

  2. Educational Codeforces Round 81 + Gym 102267

    UPD:变色了!!!历史最高1618~ Educational Codeforces Round 81 (Rated for Div. 2) The 2019 University of Jordan ...

  3. Educational Codeforces Round 9

    Educational Codeforces Round 9 Longest Subsequence 题目描述:给出一个序列,从中抽出若干个数,使它们的公倍数小于等于\(m\),问最多能抽出多少个数, ...

  4. Educational Codeforces Round 40 F. Runner's Problem

    Educational Codeforces Round 40 F. Runner's Problem 题意: 给一个$ 3 * m \(的矩阵,问从\)(2,1)$ 出发 走到 \((2,m)\) ...

  5. [Educational Codeforces Round 16]C. Magic Odd Square

    [Educational Codeforces Round 16]C. Magic Odd Square 试题描述 Find an n × n matrix with different number ...

  6. Educational Codeforces Round 37

    Educational Codeforces Round 37 这场有点炸,题目比较水,但只做了3题QAQ.还是实力不够啊! 写下题解算了--(写的比较粗糙,细节或者bug可以私聊2333) A. W ...

  7. Educational Codeforces Round 43 (Rated for Div. 2)

    Educational Codeforces Round 43 (Rated for Div. 2) https://codeforces.com/contest/976 A #include< ...

  8. CodeForces 185A. Plant (矩阵快速幂)

    CodeForces 185A. Plant (矩阵快速幂) 题意分析 求解N年后,向上的三角形和向下的三角形的个数分别是多少.如图所示: N=0时只有一个向上的三角形,N=1时有3个向上的三角形,1 ...

  9. Educational Codeforces Round 48 (Rated for Div. 2) CD题解

    Educational Codeforces Round 48 (Rated for Div. 2) C. Vasya And The Mushrooms 题目链接:https://codeforce ...

随机推荐

  1. css 网站素装 追忆过去

    素装代码,以表哀悼等.以下为全站CSS代码. html { filter: grayscale(100%); -webkit-filter: grayscale(100%); -moz-filter: ...

  2. java:安装Runtime Environment,设置Tomcat Server 的方法

    Eclipse 中开发Webapp, 一般需要配置Tomcat Server, 以便在Eclipse 中进行Debug.具体的步骤如下: 1. Windows ==>Preference ==& ...

  3. django 实现分页功能

    分页效果: 视图代码: # -*- coding: utf-8 -*- from django.shortcuts import render,get_object_or_404 from djang ...

  4. cluster KMeans need preprocessing scale????

    Out: n_digits: 10, n_samples 1797, n_features 64 ___________________________________________________ ...

  5. jmeter--轻量级接口自动化测试框架

    大致思路: jmeter完成接口脚本,Ant完成脚本执行并收集结果生成报告,最后利用jenkins完成脚本的自动集成运行. 环境安装: 1.jdk1.7 配置环境变量(参考前面的分页) 2.jmete ...

  6. Bootstrap-other内置组件

    1.缩略图 缩略图在网站中最常用的地方就是产品列表页面,一行显示几张图片,有的在图片底下(左侧或右侧)带有标题.描述等信息.Bootstrap框架将这一部独立成一个模块组件.并通过“thumbnail ...

  7. BEC listen and translation exercise 35

    高中听力: At five o'clock, we have afternoon tea, but we don't have it in the kitchen. Father's Day is t ...

  8. codeforces 650 C. Watchmen(数学公式)

    C. Watchmen time limit per test 3 seconds memory limit per test 256 megabytes input standard input o ...

  9. linux命令学习笔记(39):grep 命令

    Linux系统中grep命令是一种强大的文本搜索工具,它能使用正则表达式搜索文本,并把匹 配的行打印出来. grep全称是Global Regular Expression Print,表示全局正则表 ...

  10. 【二叉树的递归】03判断二叉树中有没有和为给定值的路径【Path Sum】

    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 给定一个二叉树和一个和,判断这个树 ...