問題一覧 > 通常問題

No.2966 Simple Plus Minus Problem

レベル : / AI推定難易度 : 2050 / 実行時間制限 : 1ケース 2.567秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 20
作問者 : twitteryou / テスター : 👑 qand
お気に入りにしたユーザー ProblemId : 11520 / 自分の提出
問題文最終更新日: 2024-11-16 14:58:29
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
yukicoder contest 453 (順位表) の他の問題:

Story

Out of ideas.   

Well, I had already pretty much run out of story ideas by the time of the Mon〇st one, though...   

I'll leave a hint here → Hint

Problem Statement

You are given integers $N,K$ and an integer sequence $A$ of length $N$.

Perform the following operation on the integer sequence $A$ $K$ times.

  • Replace $(A_1,A_2,\cdots,A_N)$ with $(\sum_{i=1}^{1}(-1)^{i+1}A_i,\sum_{i=1}^{2}(-1)^{i+1}A_i,\cdots,\sum_{i=1}^{N}(-1)^{i+1}A_i)$.

    Find each element of the integer sequence $A$ after the $K$ replacements, $\text{mod}$ $998244353$.

  • Input

    $N$ $K$
    $A_1$ $A_2$ $\cdots$ $A_{N}$
    

  • $1 \leq N \leq 2 \times 10^5$
  • $1 \leq K \leq 10^8$
  • $1 \leq A_i \leq 10^8 \ (1 \leq i \leq N)$
  • All input values are integers.
  • Output

    Print each element of the integer sequence $A$ after the $K$ replacements, $\text{mod}$ $998244353$, separated by spaces on $1$ line.

    Sample

    Sample 1
    Input
    5 1
    1 2 3 4 5
    Output
    1 998244352 2 998244351 3

    Performing the operation $1$ time on the integer sequence $A$ gives $(1,1-2,1-2+3,1-2+3-4,1-2+3-4+5)=(1,-1,2,-2,3)$.

    Sample 2
    Input
    3 7
    96 58 74
    Output
    96 38 400

    Sample 3
    Input
    1 100000000
    622
    Output
    622

    提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。