問題一覧 > 通常問題

No.1067 #Various Colors / Red and Blue and more various colors (Middle)

レベル : / AI推定難易度 : 1900 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (解説公開後に AC するまで非表示) / 解いたユーザー数 113
作問者 : leafirby / テスター : harady_a_human
お気に入りにしたユーザー ProblemId : 4379 / 自分の提出
問題文最終更新日: 2020-06-03 02:37:00
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 250 (順位表) の他の問題:

Problem Statement

There are $N$ boxes here. The $i(1\leq i\leq N)$-th box contains $A_i$ balls.
More specifically, box $i$ contains exactly $1$ ball of each color from color $1$ to color $A_i$.
Answer $Q$ queries. The $i(1\leq i\leq Q)$-th query is as follows.

  • When taking one ball from each box, for each color from color $l_i$ to color $r_i$, find the number of ways in which exactly $p_i$ balls of that color are included, $mod998244353$, and output the bitwise XOR of all of these values, $mod998244353$.

  • Input

    $N\ Q$
    $A_1\ A_2\ ...\ A_N$
    $l_1\ r_1\ p_1$
    $l_2\ r_2\ p_2$
    .
    .
    .
    $l_Q\ r_Q\ p_Q$
    

    $1\le N\le 6000$
    $1\le Q\le 5000$
    $1\le A_i\le 10^9$
    $1\le l_i\le r_i\le max(A_1,A_2,...,A_N)$
    $0\le r_i-l_i\le 200$
    $0\le p_i\le N$
    All inputs are integers.

    Output

    Answer the $Q$ queries, and print a newline at the end.

    Sample

    Sample 1
    Input
    3 4
    3 4 5
    1 5 0
    1 5 1
    1 5 2
    1 5 3
    Output
    12
    3
    10
    1

    Note that for each query, you should output the bitwise XOR of the answers taken modulo $998244353$, and then take that result modulo $998244353$.

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