{"problem":{"name":"Power Up","description":{"content":"You are given a multiset of positive integers with $N$ elements: $A=\\lbrace A_1,A_2,\\dots,A_N \\rbrace$. You may repeat the following operation any number of times (possibly zero). *   Choose a positi","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"arc160_c"},"statements":[{"statement_type":"Markdown","content":"You are given a multiset of positive integers with $N$ elements: $A=\\lbrace A_1,A_2,\\dots,A_N \\rbrace$.\nYou may repeat the following operation any number of times (possibly zero).\n\n*   Choose a positive integer $x$ that occurs at least twice in $A$. Delete two occurrences of $x$ from $A$, and add one occurrence of $x+1$ to $A$.\n\nFind the number, modulo $998244353$, of multisets that $A$ can be in the end.\n\n## Constraints\n\n*   $1 \\le N \\le 2 \\times 10^5$\n*   $1 \\le A_i \\le 2 \\times 10^5$\n\n## Input\n\nThe input is given from Standard Input in the following format:\n\n$N$\n$A_1$ $A_2$ $\\dots$ $A_N$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"arc160_c","tags":[],"sample_group":[["4\n1 1 2 4","3\n\n$A$ can be one of the three multisets $\\lbrace 1,1,2,4 \\rbrace,\\lbrace 2,2,4 \\rbrace,\\lbrace 3,4 \\rbrace$ in the end.\nYou can make $A = \\lbrace 3,4 \\rbrace$ as follows.\n\n*   Choose $x = 1$. Delete two $1$s from $A$ and add one $2$ to $A$, making $A=\\lbrace 2,2,4 \\rbrace$.\n*   Choose $x = 2$. Delete two $2$s from $A$ and add one $3$ to $A$, making $A=\\lbrace 3,4 \\rbrace$."],["5\n1 2 3 4 5","1"],["13\n3 1 4 1 5 9 2 6 5 3 5 8 9","66"]],"created_at":"2026-03-03 11:01:14"}}