No.1067 #Various Colors / Red and Blue and more various colors (Middle)
タグ : / 解いたユーザー数 113
作問者 :
leafirby
/ テスター :
harady_a_human
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.
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もしくは右上の雲マークをクリックしてアカウントを作成してください。