description
stringlengths
171
4k
code
stringlengths
94
3.98k
normalized_code
stringlengths
57
4.99k
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
def main(): md = 998244353 n = int(input()) for w in range(1, n): ans = ((n - w - 1) * 81 + 180) * pow(10, n - w - 1, md) % md print(ans) print(10) main()
FUNC_DEF ASSIGN VAR NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR NUMBER VAR ASSIGN VAR BIN_OP BIN_OP BIN_OP BIN_OP BIN_OP BIN_OP VAR VAR NUMBER NUMBER NUMBER FUNC_CALL VAR NUMBER BIN_OP BIN_OP VAR VAR NUMBER VAR VAR EXPR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR NUMBER EXPR FUNC_CALL VAR
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
import sys def main(): MOD = 998244353 n = int(input()) ans = [] for i in range(1, n): ends = 2 * 9 * pow(10, n - i, MOD) % MOD middle = 9 * 9 * pow(10, n - 1 - i, MOD) % MOD middle *= (n - 1 - i) % MOD middle %= MOD ans.append((ends + middle) % MOD) ans.append(10) oneLineArrayPrint(ans) return input = lambda: sys.stdin.readline().rstrip("\r\n") def oneLineArrayPrint(arr): print(" ".join([str(x) for x in arr])) def multiLineArrayPrint(arr): print("\n".join([str(x) for x in arr])) def multiLineArrayOfArraysPrint(arr): print("\n".join([" ".join([str(x) for x in y]) for y in arr])) def readIntArr(): return [int(x) for x in input().split()] inf = float("inf") MOD = 10**9 + 7 for _ in range(1): main()
IMPORT FUNC_DEF ASSIGN VAR NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR LIST FOR VAR FUNC_CALL VAR NUMBER VAR ASSIGN VAR BIN_OP BIN_OP BIN_OP NUMBER NUMBER FUNC_CALL VAR NUMBER BIN_OP VAR VAR VAR VAR ASSIGN VAR BIN_OP BIN_OP BIN_OP NUMBER NUMBER FUNC_CALL VAR NUMBER BIN_OP BIN_OP VAR NUMBER VAR VAR VAR VAR BIN_OP BIN_OP BIN_OP VAR NUMBER VAR VAR VAR VAR EXPR FUNC_CALL VAR BIN_OP BIN_OP VAR VAR VAR EXPR FUNC_CALL VAR NUMBER EXPR FUNC_CALL VAR VAR RETURN ASSIGN VAR FUNC_CALL FUNC_CALL VAR STRING FUNC_DEF EXPR FUNC_CALL VAR FUNC_CALL STRING FUNC_CALL VAR VAR VAR VAR FUNC_DEF EXPR FUNC_CALL VAR FUNC_CALL STRING FUNC_CALL VAR VAR VAR VAR FUNC_DEF EXPR FUNC_CALL VAR FUNC_CALL STRING FUNC_CALL STRING FUNC_CALL VAR VAR VAR VAR VAR VAR FUNC_DEF RETURN FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR STRING ASSIGN VAR BIN_OP BIN_OP NUMBER NUMBER NUMBER FOR VAR FUNC_CALL VAR NUMBER EXPR FUNC_CALL VAR
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
def solve(): n = int(input()) numbers = [10] power = 1 mod = 998244353 for i in range(2, n + 1): numbers.append(9 * (9 * i + 2) * power % mod) power = power * 10 % mod s = reversed(list(map(str, numbers))) print(" ".join(s)) def modpow(base, exponent, mod): res = 1 power = base while exponent > 0: if exponent & 1: res = res * power % mod power = power * power % mod exponent //= 2 return res solve()
FUNC_DEF ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR LIST NUMBER ASSIGN VAR NUMBER ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR NUMBER BIN_OP VAR NUMBER EXPR FUNC_CALL VAR BIN_OP BIN_OP BIN_OP NUMBER BIN_OP BIN_OP NUMBER VAR NUMBER VAR VAR ASSIGN VAR BIN_OP BIN_OP VAR NUMBER VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR VAR VAR EXPR FUNC_CALL VAR FUNC_CALL STRING VAR FUNC_DEF ASSIGN VAR NUMBER ASSIGN VAR VAR WHILE VAR NUMBER IF BIN_OP VAR NUMBER ASSIGN VAR BIN_OP BIN_OP VAR VAR VAR ASSIGN VAR BIN_OP BIN_OP VAR VAR VAR VAR NUMBER RETURN VAR EXPR FUNC_CALL VAR
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
n = int(input()) q = [(1) for i in range(n)] for i in range(1, n): q[i] = q[i - 1] * 10 % 998244353 for i in range(n - 1): print((180 + (n - i - 2) * 81) * q[n - i - 2] % 998244353, end=" ") print(10)
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR NUMBER VAR FUNC_CALL VAR VAR FOR VAR FUNC_CALL VAR NUMBER VAR ASSIGN VAR VAR BIN_OP BIN_OP VAR BIN_OP VAR NUMBER NUMBER NUMBER FOR VAR FUNC_CALL VAR BIN_OP VAR NUMBER EXPR FUNC_CALL VAR BIN_OP BIN_OP BIN_OP NUMBER BIN_OP BIN_OP BIN_OP VAR VAR NUMBER NUMBER VAR BIN_OP BIN_OP VAR VAR NUMBER NUMBER STRING EXPR FUNC_CALL VAR NUMBER
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
def pow(a, b, m): res = 1 while b: if b & 1: res *= a res %= m a *= a a %= m b >>= 1 return res % m n = int(input()) m = 998244353 for i in range(1, n + 1): if i == n: print(10) break val = 9 * (9 * (n - i) + 11) val %= m val *= pow(10, n - i - 1, m) val %= m print(val, end=" ")
FUNC_DEF ASSIGN VAR NUMBER WHILE VAR IF BIN_OP VAR NUMBER VAR VAR VAR VAR VAR VAR VAR VAR VAR NUMBER RETURN BIN_OP VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR NUMBER BIN_OP VAR NUMBER IF VAR VAR EXPR FUNC_CALL VAR NUMBER ASSIGN VAR BIN_OP NUMBER BIN_OP BIN_OP NUMBER BIN_OP VAR VAR NUMBER VAR VAR VAR FUNC_CALL VAR NUMBER BIN_OP BIN_OP VAR VAR NUMBER VAR VAR VAR EXPR FUNC_CALL VAR VAR STRING
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
import sys input = sys.stdin.readline n = int(input()) ans = "" exp10s = {} val = 1 for f in range(n + 1): exp10s[f] = val val = 10 * val % 998244353 for i in range(1, n + 1): if i == n: val = 10 elif i == n - 1: val = 180 else: val = exp10s[n - i - 1] * (180 + (n - i - 1) * 81) % 998244353 print(val, end=" ")
IMPORT ASSIGN VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR STRING ASSIGN VAR DICT ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR BIN_OP VAR NUMBER ASSIGN VAR VAR VAR ASSIGN VAR BIN_OP BIN_OP NUMBER VAR NUMBER FOR VAR FUNC_CALL VAR NUMBER BIN_OP VAR NUMBER IF VAR VAR ASSIGN VAR NUMBER IF VAR BIN_OP VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR BIN_OP BIN_OP VAR BIN_OP BIN_OP VAR VAR NUMBER BIN_OP NUMBER BIN_OP BIN_OP BIN_OP VAR VAR NUMBER NUMBER NUMBER EXPR FUNC_CALL VAR VAR STRING
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
n = int(input()) arr = [0] sm = 0 smarr = 0 ten = 1 MOD = 998244353 for i in range(1, n + 1): ten = ten * 10 % MOD all = i * ten % MOD sm = (sm + smarr) % MOD x = (all - sm + MOD) % MOD arr.append(x) smarr = (smarr + x) % MOD sm = (sm + x) % MOD arr.reverse() arr.pop() print(*arr)
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR LIST NUMBER ASSIGN VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR NUMBER BIN_OP VAR NUMBER ASSIGN VAR BIN_OP BIN_OP VAR NUMBER VAR ASSIGN VAR BIN_OP BIN_OP VAR VAR VAR ASSIGN VAR BIN_OP BIN_OP VAR VAR VAR ASSIGN VAR BIN_OP BIN_OP BIN_OP VAR VAR VAR VAR EXPR FUNC_CALL VAR VAR ASSIGN VAR BIN_OP BIN_OP VAR VAR VAR ASSIGN VAR BIN_OP BIN_OP VAR VAR VAR EXPR FUNC_CALL VAR EXPR FUNC_CALL VAR EXPR FUNC_CALL VAR VAR
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
n = int(input()) a = [10, 180] v = 1 for i in range(2, n): c = a[-1] * 10 + 81 * pow(10, v, 998244353) v += 1 a.append(c % 998244353) an = a[:n] print(*an[::-1])
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR LIST NUMBER NUMBER ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR NUMBER VAR ASSIGN VAR BIN_OP BIN_OP VAR NUMBER NUMBER BIN_OP NUMBER FUNC_CALL VAR NUMBER VAR NUMBER VAR NUMBER EXPR FUNC_CALL VAR BIN_OP VAR NUMBER ASSIGN VAR VAR VAR EXPR FUNC_CALL VAR VAR NUMBER
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
n = int(input()) blocks = [] list_of_powers = [1] prev = 1 for _ in range(n): prev = prev * 10 % 998244353 list_of_powers.append(prev) for i in range(n): if i == 0: blocks.append(10) else: blocks.append(18 * list_of_powers[i] + (i - 1) * 81 * list_of_powers[i - 1]) for i in range(n): blocks[i] = str(blocks[i] % 998244353) blocks = blocks[::-1] print(" ".join(blocks))
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR LIST ASSIGN VAR LIST NUMBER ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR VAR ASSIGN VAR BIN_OP BIN_OP VAR NUMBER NUMBER EXPR FUNC_CALL VAR VAR FOR VAR FUNC_CALL VAR VAR IF VAR NUMBER EXPR FUNC_CALL VAR NUMBER EXPR FUNC_CALL VAR BIN_OP BIN_OP NUMBER VAR VAR BIN_OP BIN_OP BIN_OP VAR NUMBER NUMBER VAR BIN_OP VAR NUMBER FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR BIN_OP VAR VAR NUMBER ASSIGN VAR VAR NUMBER EXPR FUNC_CALL VAR FUNC_CALL STRING VAR
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
mod = 998244353 n = int(input()) for i in range(1, n): res = 2 * 10 * 9 * pow(10, n - i - 1, mod) res += (n - 1 - i) * 10 * 9 * 9 * pow(10, n - i - 2, mod) print(res % mod, end=" ") print(10)
ASSIGN VAR NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR NUMBER VAR ASSIGN VAR BIN_OP BIN_OP BIN_OP NUMBER NUMBER NUMBER FUNC_CALL VAR NUMBER BIN_OP BIN_OP VAR VAR NUMBER VAR VAR BIN_OP BIN_OP BIN_OP BIN_OP BIN_OP BIN_OP VAR NUMBER VAR NUMBER NUMBER NUMBER FUNC_CALL VAR NUMBER BIN_OP BIN_OP VAR VAR NUMBER VAR EXPR FUNC_CALL VAR BIN_OP VAR VAR STRING EXPR FUNC_CALL VAR NUMBER
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
n = int(input()) p = 998244353 for i in range(1, n + 1): if n - i - 2 > -1: c = 81 * (n - i - 1) * pow(10, n - i - 2, p) else: c = 0 if n - i - 1 > -1: d = 18 * pow(10, n - i - 1, p) else: d = 1 a = 10 * (d + c) print(a % p, end=" ")
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR NUMBER BIN_OP VAR NUMBER IF BIN_OP BIN_OP VAR VAR NUMBER NUMBER ASSIGN VAR BIN_OP BIN_OP NUMBER BIN_OP BIN_OP VAR VAR NUMBER FUNC_CALL VAR NUMBER BIN_OP BIN_OP VAR VAR NUMBER VAR ASSIGN VAR NUMBER IF BIN_OP BIN_OP VAR VAR NUMBER NUMBER ASSIGN VAR BIN_OP NUMBER FUNC_CALL VAR NUMBER BIN_OP BIN_OP VAR VAR NUMBER VAR ASSIGN VAR NUMBER ASSIGN VAR BIN_OP NUMBER BIN_OP VAR VAR EXPR FUNC_CALL VAR BIN_OP VAR VAR STRING
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
import sys input = sys.stdin.readline mod = 998244353 n = int(input()) ans = [10] dp1 = [10] dp2 = [10] for i in range(2, n + 1): s = i * pow(10, i, mod) ans.append((s - dp1[i - 2] - dp2[i - 2]) % mod) dp1.append((dp1[i - 2] + ans[i - 1]) % mod) dp2.append((dp2[i - 2] + dp1[i - 1]) % mod) print(*ans[::-1])
IMPORT ASSIGN VAR VAR ASSIGN VAR NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR LIST NUMBER ASSIGN VAR LIST NUMBER ASSIGN VAR LIST NUMBER FOR VAR FUNC_CALL VAR NUMBER BIN_OP VAR NUMBER ASSIGN VAR BIN_OP VAR FUNC_CALL VAR NUMBER VAR VAR EXPR FUNC_CALL VAR BIN_OP BIN_OP BIN_OP VAR VAR BIN_OP VAR NUMBER VAR BIN_OP VAR NUMBER VAR EXPR FUNC_CALL VAR BIN_OP BIN_OP VAR BIN_OP VAR NUMBER VAR BIN_OP VAR NUMBER VAR EXPR FUNC_CALL VAR BIN_OP BIN_OP VAR BIN_OP VAR NUMBER VAR BIN_OP VAR NUMBER VAR EXPR FUNC_CALL VAR VAR NUMBER
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
n = int(input()) steps = [] st = 1 mod = 998244353 for i in range(n + 1): steps.append(st) st *= 10 st %= mod for i in range(1, n + 1): mid = (n - i - 1) * 10 * 9 * 9 * steps[n - i - 2] if n - i < 2: mid = 0 mid %= mod borders = 2 * 10 * 9 * steps[n - i - 1] if n == i: borders = 10 borders %= mod print((borders + mid) % mod)
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR LIST ASSIGN VAR NUMBER ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR BIN_OP VAR NUMBER EXPR FUNC_CALL VAR VAR VAR NUMBER VAR VAR FOR VAR FUNC_CALL VAR NUMBER BIN_OP VAR NUMBER ASSIGN VAR BIN_OP BIN_OP BIN_OP BIN_OP BIN_OP BIN_OP VAR VAR NUMBER NUMBER NUMBER NUMBER VAR BIN_OP BIN_OP VAR VAR NUMBER IF BIN_OP VAR VAR NUMBER ASSIGN VAR NUMBER VAR VAR ASSIGN VAR BIN_OP BIN_OP BIN_OP NUMBER NUMBER NUMBER VAR BIN_OP BIN_OP VAR VAR NUMBER IF VAR VAR ASSIGN VAR NUMBER VAR VAR EXPR FUNC_CALL VAR BIN_OP BIN_OP VAR VAR VAR
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
import sys input = sys.stdin.readline n = int(input()) MOD = 998244353 if n == 1: print(10) exit() a = [0] * n a[0] = 1 a[1] = 18 for i in range(2, n): a[i] = (81 * i + 99) * pow(10, i - 2, MOD) a[i] %= MOD a = a[::-1] for i in range(n): a[i] *= 10 a[i] %= MOD print(*a)
IMPORT ASSIGN VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR NUMBER IF VAR NUMBER EXPR FUNC_CALL VAR NUMBER EXPR FUNC_CALL VAR ASSIGN VAR BIN_OP LIST NUMBER VAR ASSIGN VAR NUMBER NUMBER ASSIGN VAR NUMBER NUMBER FOR VAR FUNC_CALL VAR NUMBER VAR ASSIGN VAR VAR BIN_OP BIN_OP BIN_OP NUMBER VAR NUMBER FUNC_CALL VAR NUMBER BIN_OP VAR NUMBER VAR VAR VAR VAR ASSIGN VAR VAR NUMBER FOR VAR FUNC_CALL VAR VAR VAR VAR NUMBER VAR VAR VAR EXPR FUNC_CALL VAR VAR
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
n = int(input()) mod = 998244353 pow10 = [1] for i in range(1, n + 1): pow10.append(pow10[i - 1] * 10 % mod) if n == 1: print(10) elif n == 2: print(180, 10) else: for i in range(1, n): curr = 0 diffs = n - (i - 1) - 2 curr += 9 * pow10[n - i - 1] * 10 * 2 curr += 81 * pow10[n - i - 2] * 10 * diffs print(curr % mod, end=" ") print(10)
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR NUMBER ASSIGN VAR LIST NUMBER FOR VAR FUNC_CALL VAR NUMBER BIN_OP VAR NUMBER EXPR FUNC_CALL VAR BIN_OP BIN_OP VAR BIN_OP VAR NUMBER NUMBER VAR IF VAR NUMBER EXPR FUNC_CALL VAR NUMBER IF VAR NUMBER EXPR FUNC_CALL VAR NUMBER NUMBER FOR VAR FUNC_CALL VAR NUMBER VAR ASSIGN VAR NUMBER ASSIGN VAR BIN_OP BIN_OP VAR BIN_OP VAR NUMBER NUMBER VAR BIN_OP BIN_OP BIN_OP NUMBER VAR BIN_OP BIN_OP VAR VAR NUMBER NUMBER NUMBER VAR BIN_OP BIN_OP BIN_OP NUMBER VAR BIN_OP BIN_OP VAR VAR NUMBER NUMBER VAR EXPR FUNC_CALL VAR BIN_OP VAR VAR STRING EXPR FUNC_CALL VAR NUMBER
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
n = int(input()) a = [(0) for _ in range(n)] mod = 998244353 a[0] = 10 ctnext = 90 ctprev = 10 for i in range(1, n): a[i] = 10 * a[i - 1] + ctnext - ctprev a[i] %= mod ctprev = ctnext ctnext *= 10 ctnext %= mod for i in range(n - 1, -1, -1): print(a[i], end=" ")
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR NUMBER VAR FUNC_CALL VAR VAR ASSIGN VAR NUMBER ASSIGN VAR NUMBER NUMBER ASSIGN VAR NUMBER ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR NUMBER VAR ASSIGN VAR VAR BIN_OP BIN_OP BIN_OP NUMBER VAR BIN_OP VAR NUMBER VAR VAR VAR VAR VAR ASSIGN VAR VAR VAR NUMBER VAR VAR FOR VAR FUNC_CALL VAR BIN_OP VAR NUMBER NUMBER NUMBER EXPR FUNC_CALL VAR VAR VAR STRING
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
a = int(input()) anslist = [] for i in range(a): anslist.append(-1) for i in range(a - 1, -1, -1): if i == a - 1: anslist[i] = 10 elif i == a - 2: anslist[i] = ( (a - i) * pow(10, a - (i + 1), 998244353) * 10 - anslist[i + 1] * 2 ) % 998244353 else: anslist[i] = ( 10 * ( 18 * pow(10, a - (i + 1) - 1, 998244353) + (a - i - 2) * 81 * pow(10, a - (i + 1) - 2, 998244353) ) % 998244353 ) for i in range(a): print(str(anslist[i]), end=" ")
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR NUMBER FOR VAR FUNC_CALL VAR BIN_OP VAR NUMBER NUMBER NUMBER IF VAR BIN_OP VAR NUMBER ASSIGN VAR VAR NUMBER IF VAR BIN_OP VAR NUMBER ASSIGN VAR VAR BIN_OP BIN_OP BIN_OP BIN_OP BIN_OP VAR VAR FUNC_CALL VAR NUMBER BIN_OP VAR BIN_OP VAR NUMBER NUMBER NUMBER BIN_OP VAR BIN_OP VAR NUMBER NUMBER NUMBER ASSIGN VAR VAR BIN_OP BIN_OP NUMBER BIN_OP BIN_OP NUMBER FUNC_CALL VAR NUMBER BIN_OP BIN_OP VAR BIN_OP VAR NUMBER NUMBER NUMBER BIN_OP BIN_OP BIN_OP BIN_OP VAR VAR NUMBER NUMBER FUNC_CALL VAR NUMBER BIN_OP BIN_OP VAR BIN_OP VAR NUMBER NUMBER NUMBER NUMBER FOR VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR FUNC_CALL VAR VAR VAR STRING
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
from time import time power = [1] * 200002 for i in range(1, 200002): power[i] = power[i - 1] * 10 % 998244353 n = int(input()) if n == 1: print(10) else: m = [0] * n m[n - 1] = 10 shag = 2 for i in range(n - 2, -1, -1): ans = 2 * 10 * (9 * power[shag - 2]) ans %= 998244353 ans += 10 * 9 * 9 * power[shag - 3] * (shag - 2) m[i] = int(ans % 998244353) shag += 1 print(*m)
ASSIGN VAR BIN_OP LIST NUMBER NUMBER FOR VAR FUNC_CALL VAR NUMBER NUMBER ASSIGN VAR VAR BIN_OP BIN_OP VAR BIN_OP VAR NUMBER NUMBER NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR IF VAR NUMBER EXPR FUNC_CALL VAR NUMBER ASSIGN VAR BIN_OP LIST NUMBER VAR ASSIGN VAR BIN_OP VAR NUMBER NUMBER ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR BIN_OP VAR NUMBER NUMBER NUMBER ASSIGN VAR BIN_OP BIN_OP NUMBER NUMBER BIN_OP NUMBER VAR BIN_OP VAR NUMBER VAR NUMBER VAR BIN_OP BIN_OP BIN_OP BIN_OP NUMBER NUMBER NUMBER VAR BIN_OP VAR NUMBER BIN_OP VAR NUMBER ASSIGN VAR VAR FUNC_CALL VAR BIN_OP VAR NUMBER VAR NUMBER EXPR FUNC_CALL VAR VAR
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
n = int(input()) mod = 998244353 base = 81 ans = 180 will = ["10", "180"] for i in range(2, n): ans = (ans + base) % mod * 10 % mod base = base * 10 % mod will.append(str(ans)) if n == 1: print("10") else: print(" ".join(will[::-1]))
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR LIST STRING STRING FOR VAR FUNC_CALL VAR NUMBER VAR ASSIGN VAR BIN_OP BIN_OP BIN_OP BIN_OP VAR VAR VAR NUMBER VAR ASSIGN VAR BIN_OP BIN_OP VAR NUMBER VAR EXPR FUNC_CALL VAR FUNC_CALL VAR VAR IF VAR NUMBER EXPR FUNC_CALL VAR STRING EXPR FUNC_CALL VAR FUNC_CALL STRING VAR NUMBER
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
N = int(input()) P = 998244353 ANS = [] for i in range(1, N): a = 0 if N - i >= 2: a += (N - i - 1) * 81 * pow(10, N - i - 1, P) if N - i >= 1: a += 2 * 9 * pow(10, N - i, P) ANS.append(a % P) ANS.append(10) print(*ANS)
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR NUMBER ASSIGN VAR LIST FOR VAR FUNC_CALL VAR NUMBER VAR ASSIGN VAR NUMBER IF BIN_OP VAR VAR NUMBER VAR BIN_OP BIN_OP BIN_OP BIN_OP VAR VAR NUMBER NUMBER FUNC_CALL VAR NUMBER BIN_OP BIN_OP VAR VAR NUMBER VAR IF BIN_OP VAR VAR NUMBER VAR BIN_OP BIN_OP NUMBER NUMBER FUNC_CALL VAR NUMBER BIN_OP VAR VAR VAR EXPR FUNC_CALL VAR BIN_OP VAR VAR EXPR FUNC_CALL VAR NUMBER EXPR FUNC_CALL VAR VAR
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
n = int(input()) ans = [] for i in range(1, n): x = n - i + 1 ans.append( ( 10 * max(x - 2, 0) * pow(10, max(0, n - i - 2), 998244353) * 81 + 2 * 10 * pow(10, max(0, n - i - 1), 998244353) * 9 ) % 998244353 ) ans.append(10) print(" ".join(map(str, ans)))
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR LIST FOR VAR FUNC_CALL VAR NUMBER VAR ASSIGN VAR BIN_OP BIN_OP VAR VAR NUMBER EXPR FUNC_CALL VAR BIN_OP BIN_OP BIN_OP BIN_OP BIN_OP NUMBER FUNC_CALL VAR BIN_OP VAR NUMBER NUMBER FUNC_CALL VAR NUMBER FUNC_CALL VAR NUMBER BIN_OP BIN_OP VAR VAR NUMBER NUMBER NUMBER BIN_OP BIN_OP BIN_OP NUMBER NUMBER FUNC_CALL VAR NUMBER FUNC_CALL VAR NUMBER BIN_OP BIN_OP VAR VAR NUMBER NUMBER NUMBER NUMBER EXPR FUNC_CALL VAR NUMBER EXPR FUNC_CALL VAR FUNC_CALL STRING FUNC_CALL VAR VAR VAR
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
mod = 998244353 n = int(input()) prev = [0] * (n + 3) val = [0] * (n + 2) s = [0] * (n + 2) for i in range(n, 0, -1): s[i] = (s[i + 1] + prev[i + 2] + 2 * val[i + 1]) % mod val[i] = ((n - i + 1) * pow(10, n - i + 1, mod) - s[i]) % mod prev[i] = (prev[i + 1] + val[i]) % mod for i in range(1, n + 1): print(val[i], end=" ")
ASSIGN VAR NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR BIN_OP LIST NUMBER BIN_OP VAR NUMBER ASSIGN VAR BIN_OP LIST NUMBER BIN_OP VAR NUMBER ASSIGN VAR BIN_OP LIST NUMBER BIN_OP VAR NUMBER FOR VAR FUNC_CALL VAR VAR NUMBER NUMBER ASSIGN VAR VAR BIN_OP BIN_OP BIN_OP VAR BIN_OP VAR NUMBER VAR BIN_OP VAR NUMBER BIN_OP NUMBER VAR BIN_OP VAR NUMBER VAR ASSIGN VAR VAR BIN_OP BIN_OP BIN_OP BIN_OP BIN_OP VAR VAR NUMBER FUNC_CALL VAR NUMBER BIN_OP BIN_OP VAR VAR NUMBER VAR VAR VAR VAR ASSIGN VAR VAR BIN_OP BIN_OP VAR BIN_OP VAR NUMBER VAR VAR VAR FOR VAR FUNC_CALL VAR NUMBER BIN_OP VAR NUMBER EXPR FUNC_CALL VAR VAR VAR STRING
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
N = int(input()) if N == 1: print("10") elif N == 2: print("180 10") else: ans = [0] * (N + 1) powt = [0] * (N + 1) powt[0] = 1 for i in range(1, N + 1): powt[i] = powt[i - 1] * 10 % 998244353 ans[0] = 10 ans[1] = 180 for i in range(2, N + 1): ans[i] = (ans[i - 1] + 81 * powt[i - 2]) * 10 % 998244353 for i in range(1, N + 1): print(ans[-i - 1], end=" ") print("")
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR IF VAR NUMBER EXPR FUNC_CALL VAR STRING IF VAR NUMBER EXPR FUNC_CALL VAR STRING ASSIGN VAR BIN_OP LIST NUMBER BIN_OP VAR NUMBER ASSIGN VAR BIN_OP LIST NUMBER BIN_OP VAR NUMBER ASSIGN VAR NUMBER NUMBER FOR VAR FUNC_CALL VAR NUMBER BIN_OP VAR NUMBER ASSIGN VAR VAR BIN_OP BIN_OP VAR BIN_OP VAR NUMBER NUMBER NUMBER ASSIGN VAR NUMBER NUMBER ASSIGN VAR NUMBER NUMBER FOR VAR FUNC_CALL VAR NUMBER BIN_OP VAR NUMBER ASSIGN VAR VAR BIN_OP BIN_OP BIN_OP VAR BIN_OP VAR NUMBER BIN_OP NUMBER VAR BIN_OP VAR NUMBER NUMBER NUMBER FOR VAR FUNC_CALL VAR NUMBER BIN_OP VAR NUMBER EXPR FUNC_CALL VAR VAR BIN_OP VAR NUMBER STRING EXPR FUNC_CALL VAR STRING
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
n = int(input()) [ print(pow(10, i - 1, 998244353) * (81 * i + 99) % 998244353) for i in range(n - 1, 1, -1) ] print(str(180) + "\n" + str(10)) if n >= 2 else print(10)
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR EXPR FUNC_CALL VAR BIN_OP BIN_OP FUNC_CALL VAR NUMBER BIN_OP VAR NUMBER NUMBER BIN_OP BIN_OP NUMBER VAR NUMBER NUMBER VAR FUNC_CALL VAR BIN_OP VAR NUMBER NUMBER NUMBER EXPR VAR NUMBER FUNC_CALL VAR BIN_OP BIN_OP FUNC_CALL VAR NUMBER STRING FUNC_CALL VAR NUMBER FUNC_CALL VAR NUMBER
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
n = int(input()) MOD = 998244353 for k in range(1, n): t = ( (n - k - 1) * 81 * pow(10, n - k - 2, MOD) * 10 + 10 * 9 * pow(10, n - k - 1, MOD) * 2 ) % MOD print(t, end=" ") print(10)
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR NUMBER VAR ASSIGN VAR BIN_OP BIN_OP BIN_OP BIN_OP BIN_OP BIN_OP BIN_OP VAR VAR NUMBER NUMBER FUNC_CALL VAR NUMBER BIN_OP BIN_OP VAR VAR NUMBER VAR NUMBER BIN_OP BIN_OP BIN_OP NUMBER NUMBER FUNC_CALL VAR NUMBER BIN_OP BIN_OP VAR VAR NUMBER VAR NUMBER VAR EXPR FUNC_CALL VAR VAR STRING EXPR FUNC_CALL VAR NUMBER
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
import sys readline = sys.stdin.readline readlines = sys.stdin.readlines ns = lambda: readline().rstrip() ni = lambda: int(readline().rstrip()) nm = lambda: map(int, readline().split()) nl = lambda: list(map(int, readline().split())) prn = lambda x: print(*x, sep="\n") def solve(): n = ni() mod = 998244353 l = list() res = 0 inc = 0 t = 1 for i in range(n): res += inc t = t * 10 % mod c = t * (i + 1) % mod a = (c - res) % mod l.append(a) res = (res + a) % mod inc = (inc + a) % mod print(*l[::-1]) solve()
IMPORT ASSIGN VAR VAR ASSIGN VAR VAR ASSIGN VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR STRING FUNC_DEF ASSIGN VAR FUNC_CALL VAR ASSIGN VAR NUMBER ASSIGN VAR FUNC_CALL VAR ASSIGN VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR VAR VAR VAR ASSIGN VAR BIN_OP BIN_OP VAR NUMBER VAR ASSIGN VAR BIN_OP BIN_OP VAR BIN_OP VAR NUMBER VAR ASSIGN VAR BIN_OP BIN_OP VAR VAR VAR EXPR FUNC_CALL VAR VAR ASSIGN VAR BIN_OP BIN_OP VAR VAR VAR ASSIGN VAR BIN_OP BIN_OP VAR VAR VAR EXPR FUNC_CALL VAR VAR NUMBER EXPR FUNC_CALL VAR
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
n = int(input()) big = 998244353 l = [(0) for i in range(n)] l[0] = 10 if n > 1: l[1] = 180 val1 = 10 for i in range(1, n - 1): val2 = i * val1 % big val1 = val1 * 10 % big val = 18 * val1 + 81 * val2 val = val % big l[i + 1] = val for i in range(n): print(l[n - i - 1])
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR NUMBER ASSIGN VAR NUMBER VAR FUNC_CALL VAR VAR ASSIGN VAR NUMBER NUMBER IF VAR NUMBER ASSIGN VAR NUMBER NUMBER ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR NUMBER BIN_OP VAR NUMBER ASSIGN VAR BIN_OP BIN_OP VAR VAR VAR ASSIGN VAR BIN_OP BIN_OP VAR NUMBER VAR ASSIGN VAR BIN_OP BIN_OP NUMBER VAR BIN_OP NUMBER VAR ASSIGN VAR BIN_OP VAR VAR ASSIGN VAR BIN_OP VAR NUMBER VAR FOR VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR VAR BIN_OP BIN_OP VAR VAR NUMBER
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
import sys def main(): import sys input = sys.stdin.readline N = int(input()) mod = 998244353 ten = [0] * (N + 1) for i in range(1, N + 1): ten[i] = pow(10, i, mod) ans = [0] * (N + 1) S = 0 for i in range(1, N + 1): a = (ten[i] * i % mod - (ten[i - 1] * (i - 1) % mod + S) % mod) % mod ans[i] = a S = (S + a) % mod ans.reverse() print(*ans[:-1]) main()
IMPORT FUNC_DEF IMPORT ASSIGN VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR NUMBER ASSIGN VAR BIN_OP LIST NUMBER BIN_OP VAR NUMBER FOR VAR FUNC_CALL VAR NUMBER BIN_OP VAR NUMBER ASSIGN VAR VAR FUNC_CALL VAR NUMBER VAR VAR ASSIGN VAR BIN_OP LIST NUMBER BIN_OP VAR NUMBER ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR NUMBER BIN_OP VAR NUMBER ASSIGN VAR BIN_OP BIN_OP BIN_OP BIN_OP VAR VAR VAR VAR BIN_OP BIN_OP BIN_OP BIN_OP VAR BIN_OP VAR NUMBER BIN_OP VAR NUMBER VAR VAR VAR VAR ASSIGN VAR VAR VAR ASSIGN VAR BIN_OP BIN_OP VAR VAR VAR EXPR FUNC_CALL VAR EXPR FUNC_CALL VAR VAR NUMBER EXPR FUNC_CALL VAR
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
n = int(input()) mod = 998244353 def modmul(arr): ret = 1 for v in arr: ret = ret * v % mod return ret pows = [1] for i in range(n): pows.append(pows[-1] * 10 % mod) for i in range(1, n + 1): ans = 10 c = n - i + 1 if c == 1: print(ans) elif c == 2: borders = modmul([2, 10, 9, pows[n - i - 1]]) print(borders, end=" ") else: borders = modmul([2, 10, 9, pows[n - i - 1]]) c -= 2 other = modmul([c, 10, 9, 9, pows[n - i - 2]]) print((borders + other) % mod, end=" ")
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR NUMBER FUNC_DEF ASSIGN VAR NUMBER FOR VAR VAR ASSIGN VAR BIN_OP BIN_OP VAR VAR VAR RETURN VAR ASSIGN VAR LIST NUMBER FOR VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR BIN_OP BIN_OP VAR NUMBER NUMBER VAR FOR VAR FUNC_CALL VAR NUMBER BIN_OP VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR BIN_OP BIN_OP VAR VAR NUMBER IF VAR NUMBER EXPR FUNC_CALL VAR VAR IF VAR NUMBER ASSIGN VAR FUNC_CALL VAR LIST NUMBER NUMBER NUMBER VAR BIN_OP BIN_OP VAR VAR NUMBER EXPR FUNC_CALL VAR VAR STRING ASSIGN VAR FUNC_CALL VAR LIST NUMBER NUMBER NUMBER VAR BIN_OP BIN_OP VAR VAR NUMBER VAR NUMBER ASSIGN VAR FUNC_CALL VAR LIST VAR NUMBER NUMBER NUMBER VAR BIN_OP BIN_OP VAR VAR NUMBER EXPR FUNC_CALL VAR BIN_OP BIN_OP VAR VAR VAR STRING
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
N = int(input()) mod = 998244353 Ans = [] nums = pow(10, N, mod) nums_inv = pow(nums, mod - 2, mod) inv10 = pow(10, mod - 2, mod) for d in range(1, N): ans = 0 ans += pow(inv10, d, mod) * 9 * nums * 2 % mod ans += (N - d - 1) * pow(inv10, d + 1, mod) * 81 * nums % mod Ans.append(ans % mod) Ans.append(10) print(" ".join(map(str, Ans)))
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR NUMBER ASSIGN VAR LIST ASSIGN VAR FUNC_CALL VAR NUMBER VAR VAR ASSIGN VAR FUNC_CALL VAR VAR BIN_OP VAR NUMBER VAR ASSIGN VAR FUNC_CALL VAR NUMBER BIN_OP VAR NUMBER VAR FOR VAR FUNC_CALL VAR NUMBER VAR ASSIGN VAR NUMBER VAR BIN_OP BIN_OP BIN_OP BIN_OP FUNC_CALL VAR VAR VAR VAR NUMBER VAR NUMBER VAR VAR BIN_OP BIN_OP BIN_OP BIN_OP BIN_OP BIN_OP VAR VAR NUMBER FUNC_CALL VAR VAR BIN_OP VAR NUMBER VAR NUMBER VAR VAR EXPR FUNC_CALL VAR BIN_OP VAR VAR EXPR FUNC_CALL VAR NUMBER EXPR FUNC_CALL VAR FUNC_CALL STRING FUNC_CALL VAR VAR VAR
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
mod = 998244353 n = int(input()) ten = [1] for i in range(n): ten.append(ten[-1] * 10 % mod) ans = [0] * n ans[n - 1] = 10 for l in range(1, n): s = 2 * 10 * 9 * ten[n - l - 1] if n - l >= 2: s += (n - l - 1) * 10 * 81 * ten[n - l - 2] ans[l - 1] = s % mod print(" ".join(map(str, ans)))
ASSIGN VAR NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR LIST NUMBER FOR VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR BIN_OP BIN_OP VAR NUMBER NUMBER VAR ASSIGN VAR BIN_OP LIST NUMBER VAR ASSIGN VAR BIN_OP VAR NUMBER NUMBER FOR VAR FUNC_CALL VAR NUMBER VAR ASSIGN VAR BIN_OP BIN_OP BIN_OP NUMBER NUMBER NUMBER VAR BIN_OP BIN_OP VAR VAR NUMBER IF BIN_OP VAR VAR NUMBER VAR BIN_OP BIN_OP BIN_OP BIN_OP BIN_OP VAR VAR NUMBER NUMBER NUMBER VAR BIN_OP BIN_OP VAR VAR NUMBER ASSIGN VAR BIN_OP VAR NUMBER BIN_OP VAR VAR EXPR FUNC_CALL VAR FUNC_CALL STRING FUNC_CALL VAR VAR VAR
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
import sys input = sys.stdin.readline MOD = 998244353 n = int(input()) ans = [] for i in range(n, 0, -1): if i == n: ans.append(10) continue pattern = n - i + 1 ret = 10 * 9 * pow(10, n - i - 1, MOD) * 2 pattern -= 2 ret += pattern * 9 * 9 * pow(10, n - i - 1, MOD) ans.append(ret % MOD) ans.reverse() print(*ans)
IMPORT ASSIGN VAR VAR ASSIGN VAR NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR NUMBER NUMBER IF VAR VAR EXPR FUNC_CALL VAR NUMBER ASSIGN VAR BIN_OP BIN_OP VAR VAR NUMBER ASSIGN VAR BIN_OP BIN_OP BIN_OP NUMBER NUMBER FUNC_CALL VAR NUMBER BIN_OP BIN_OP VAR VAR NUMBER VAR NUMBER VAR NUMBER VAR BIN_OP BIN_OP BIN_OP VAR NUMBER NUMBER FUNC_CALL VAR NUMBER BIN_OP BIN_OP VAR VAR NUMBER VAR EXPR FUNC_CALL VAR BIN_OP VAR VAR EXPR FUNC_CALL VAR EXPR FUNC_CALL VAR VAR
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
n = int(input()) m = 998244353 power = [] x = 1 for i in range(1, n + 1): power.append(x) x *= 10 x %= m for i in range(n - 1): ans = 180 * power[n - 2 - i] + (n - 2 - i) * 810 * power[n - 3 - i] ans %= m print(ans, end=" ") print(10)
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR NUMBER ASSIGN VAR LIST ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR NUMBER BIN_OP VAR NUMBER EXPR FUNC_CALL VAR VAR VAR NUMBER VAR VAR FOR VAR FUNC_CALL VAR BIN_OP VAR NUMBER ASSIGN VAR BIN_OP BIN_OP NUMBER VAR BIN_OP BIN_OP VAR NUMBER VAR BIN_OP BIN_OP BIN_OP BIN_OP VAR NUMBER VAR NUMBER VAR BIN_OP BIN_OP VAR NUMBER VAR VAR VAR EXPR FUNC_CALL VAR VAR STRING EXPR FUNC_CALL VAR NUMBER
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
import sys inp = sys.stdin.readline def input(): return inp().strip() out = [] def iin(): return int(input()) def lin(): return list(map(int, input().split())) def main(): n = iin() md = 998244353 ans = [0] sm1 = 0 sm2 = 0 for i in range(1, n + 1): sm2 = (sm2 + ans[-1]) % md sm = (sm2 * 2 + sm1) % md ans.append((i * pow(10, i, md) % md - sm) % md) sm1 = (sm1 + sm2) % md print(*ans[-1:0:-1]) main()
IMPORT ASSIGN VAR VAR FUNC_DEF RETURN FUNC_CALL FUNC_CALL VAR ASSIGN VAR LIST FUNC_DEF RETURN FUNC_CALL VAR FUNC_CALL VAR FUNC_DEF RETURN FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR FUNC_DEF ASSIGN VAR FUNC_CALL VAR ASSIGN VAR NUMBER ASSIGN VAR LIST NUMBER ASSIGN VAR NUMBER ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR NUMBER BIN_OP VAR NUMBER ASSIGN VAR BIN_OP BIN_OP VAR VAR NUMBER VAR ASSIGN VAR BIN_OP BIN_OP BIN_OP VAR NUMBER VAR VAR EXPR FUNC_CALL VAR BIN_OP BIN_OP BIN_OP BIN_OP VAR FUNC_CALL VAR NUMBER VAR VAR VAR VAR VAR ASSIGN VAR BIN_OP BIN_OP VAR VAR VAR EXPR FUNC_CALL VAR VAR NUMBER NUMBER NUMBER EXPR FUNC_CALL VAR
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
n = int(input()) if n == 1: print(10) quit() ans = [10] total = 10 mod = 998244353 modm = [1] cur = 1 for i in range(1, 2 * 10**5 + 4): cur = cur * 10 % mod modm += [cur] for i in range(2, n + 1): next = (i % mod * modm[i] - total % mod) % mod total = (total + next) % mod ans += [next] b = [] for i in range(n - 1, 0, -1): el = (ans[i] - ans[i - 1]) % mod b += [el] b += [10] print(" ".join(str(k) for k in b))
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR IF VAR NUMBER EXPR FUNC_CALL VAR NUMBER EXPR FUNC_CALL VAR ASSIGN VAR LIST NUMBER ASSIGN VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR LIST NUMBER ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR NUMBER BIN_OP BIN_OP NUMBER BIN_OP NUMBER NUMBER NUMBER ASSIGN VAR BIN_OP BIN_OP VAR NUMBER VAR VAR LIST VAR FOR VAR FUNC_CALL VAR NUMBER BIN_OP VAR NUMBER ASSIGN VAR BIN_OP BIN_OP BIN_OP BIN_OP VAR VAR VAR VAR BIN_OP VAR VAR VAR ASSIGN VAR BIN_OP BIN_OP VAR VAR VAR VAR LIST VAR ASSIGN VAR LIST FOR VAR FUNC_CALL VAR BIN_OP VAR NUMBER NUMBER NUMBER ASSIGN VAR BIN_OP BIN_OP VAR VAR VAR BIN_OP VAR NUMBER VAR VAR LIST VAR VAR LIST NUMBER EXPR FUNC_CALL VAR FUNC_CALL STRING FUNC_CALL VAR VAR VAR VAR
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
n = int(input()) res = [] mod = 998244353 for w in range(1, n + 1): ans = 10 if n - w >= 2: ans = ( ans * ( 2 * 9 * pow(10, n - w - 1, mod) + (n - w - 1) * 9 * 9 * pow(10, n - w - 2, mod) ) % mod ) elif n - w == 1: ans = ans * (2 * 9) % mod res.append(ans) for e in res: print(e, end=" ") print()
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR LIST ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR NUMBER BIN_OP VAR NUMBER ASSIGN VAR NUMBER IF BIN_OP VAR VAR NUMBER ASSIGN VAR BIN_OP BIN_OP VAR BIN_OP BIN_OP BIN_OP NUMBER NUMBER FUNC_CALL VAR NUMBER BIN_OP BIN_OP VAR VAR NUMBER VAR BIN_OP BIN_OP BIN_OP BIN_OP BIN_OP VAR VAR NUMBER NUMBER NUMBER FUNC_CALL VAR NUMBER BIN_OP BIN_OP VAR VAR NUMBER VAR VAR IF BIN_OP VAR VAR NUMBER ASSIGN VAR BIN_OP BIN_OP VAR BIN_OP NUMBER NUMBER VAR EXPR FUNC_CALL VAR VAR FOR VAR VAR EXPR FUNC_CALL VAR VAR STRING EXPR FUNC_CALL VAR
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
n = int(input()) ans = [0] * n ans[0] = 10 mi = 10 c = 0 mod = 998244353 p = 10 for i in range(2, n + 1): p *= 10 p %= mod a = (p % mod - mi) % mod a *= i a %= mod a += c a %= mod ans[i - 1] = a mi += a mi %= mod c += a * (i - 1) c %= mod print(*ans[::-1])
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR BIN_OP LIST NUMBER VAR ASSIGN VAR NUMBER NUMBER ASSIGN VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR NUMBER BIN_OP VAR NUMBER VAR NUMBER VAR VAR ASSIGN VAR BIN_OP BIN_OP BIN_OP VAR VAR VAR VAR VAR VAR VAR VAR VAR VAR VAR VAR ASSIGN VAR BIN_OP VAR NUMBER VAR VAR VAR VAR VAR VAR BIN_OP VAR BIN_OP VAR NUMBER VAR VAR EXPR FUNC_CALL VAR VAR NUMBER
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
def solve(): n = int(input()) MOD = 998244353 pow = [(1) for _ in range(n + 1)] for i in range(1, n + 1, 1): pow[i] = pow[i - 1] * 10 % MOD for i in range(1, n, 1): add_one = pow[n - i - 1] * (81 * (n - i - 1) % MOD) % MOD add_two = 18 * pow[n - i] % MOD result = (add_one + add_two) % MOD print(result, end=" ") print(10) solve()
FUNC_DEF ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR NUMBER ASSIGN VAR NUMBER VAR FUNC_CALL VAR BIN_OP VAR NUMBER FOR VAR FUNC_CALL VAR NUMBER BIN_OP VAR NUMBER NUMBER ASSIGN VAR VAR BIN_OP BIN_OP VAR BIN_OP VAR NUMBER NUMBER VAR FOR VAR FUNC_CALL VAR NUMBER VAR NUMBER ASSIGN VAR BIN_OP BIN_OP VAR BIN_OP BIN_OP VAR VAR NUMBER BIN_OP BIN_OP NUMBER BIN_OP BIN_OP VAR VAR NUMBER VAR VAR ASSIGN VAR BIN_OP BIN_OP NUMBER VAR BIN_OP VAR VAR VAR ASSIGN VAR BIN_OP BIN_OP VAR VAR VAR EXPR FUNC_CALL VAR VAR STRING EXPR FUNC_CALL VAR NUMBER EXPR FUNC_CALL VAR
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
n = int(input()) out = [] MOD = 998244353 for i in range(1, n + 1): if i == n: out.append(10) else: nex = 2 * 9 * pow(10, n - i - 1, MOD) * 10 if i < n - 1: nex += (n - 1 - i) * 9 * 9 * pow(10, n - i - 2, MOD) * 10 out.append(nex % MOD) print(" ".join(map(str, out)))
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR LIST ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR NUMBER BIN_OP VAR NUMBER IF VAR VAR EXPR FUNC_CALL VAR NUMBER ASSIGN VAR BIN_OP BIN_OP BIN_OP NUMBER NUMBER FUNC_CALL VAR NUMBER BIN_OP BIN_OP VAR VAR NUMBER VAR NUMBER IF VAR BIN_OP VAR NUMBER VAR BIN_OP BIN_OP BIN_OP BIN_OP BIN_OP BIN_OP VAR NUMBER VAR NUMBER NUMBER FUNC_CALL VAR NUMBER BIN_OP BIN_OP VAR VAR NUMBER VAR NUMBER EXPR FUNC_CALL VAR BIN_OP VAR VAR EXPR FUNC_CALL VAR FUNC_CALL STRING FUNC_CALL VAR VAR VAR
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
def modInverse(a, m): m0 = m y = 0 x = 1 if m == 1: return 0 while a > 1: q = a // m t = m m = a % m a = t t = y y = x - q * y x = t if x < 0: x = x + m0 return x n = int(input()) mod = 998244353 out = [] fac = [1] big = [1] for i in range(1, n + 10): fac.append(fac[-1] * i % mod) big.append(10 * big[-1] % mod) for i in range(1, n + 1): if i == n: out.append("10") elif i == n - 1: out.append("180") else: num = n - i blah = 2 * (big[num] - big[num - 1]) blah %= mod blah += (n - i - 1) * (big[num] - 2 * big[num - 1] + big[num - 2]) blah %= mod blah *= 10 blah %= mod out.append(str(blah)) print(" ".join(out))
FUNC_DEF ASSIGN VAR VAR ASSIGN VAR NUMBER ASSIGN VAR NUMBER IF VAR NUMBER RETURN NUMBER WHILE VAR NUMBER ASSIGN VAR BIN_OP VAR VAR ASSIGN VAR VAR ASSIGN VAR BIN_OP VAR VAR ASSIGN VAR VAR ASSIGN VAR VAR ASSIGN VAR BIN_OP VAR BIN_OP VAR VAR ASSIGN VAR VAR IF VAR NUMBER ASSIGN VAR BIN_OP VAR VAR RETURN VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR NUMBER ASSIGN VAR LIST ASSIGN VAR LIST NUMBER ASSIGN VAR LIST NUMBER FOR VAR FUNC_CALL VAR NUMBER BIN_OP VAR NUMBER EXPR FUNC_CALL VAR BIN_OP BIN_OP VAR NUMBER VAR VAR EXPR FUNC_CALL VAR BIN_OP BIN_OP NUMBER VAR NUMBER VAR FOR VAR FUNC_CALL VAR NUMBER BIN_OP VAR NUMBER IF VAR VAR EXPR FUNC_CALL VAR STRING IF VAR BIN_OP VAR NUMBER EXPR FUNC_CALL VAR STRING ASSIGN VAR BIN_OP VAR VAR ASSIGN VAR BIN_OP NUMBER BIN_OP VAR VAR VAR BIN_OP VAR NUMBER VAR VAR VAR BIN_OP BIN_OP BIN_OP VAR VAR NUMBER BIN_OP BIN_OP VAR VAR BIN_OP NUMBER VAR BIN_OP VAR NUMBER VAR BIN_OP VAR NUMBER VAR VAR VAR NUMBER VAR VAR EXPR FUNC_CALL VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR FUNC_CALL STRING VAR
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
n = int(input()) s = [] count, temp, mod = 0, 0, 998244353 for i in range(1, n + 1): temp = (temp + count) % mod x = (i * pow(10, i, mod) - temp) % mod s.append(x) count = (count + x) % mod temp = (temp + x) % mod for i in range(n - 1, -1, -1): print(s[i], end=" ")
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR LIST ASSIGN VAR VAR VAR NUMBER NUMBER NUMBER FOR VAR FUNC_CALL VAR NUMBER BIN_OP VAR NUMBER ASSIGN VAR BIN_OP BIN_OP VAR VAR VAR ASSIGN VAR BIN_OP BIN_OP BIN_OP VAR FUNC_CALL VAR NUMBER VAR VAR VAR VAR EXPR FUNC_CALL VAR VAR ASSIGN VAR BIN_OP BIN_OP VAR VAR VAR ASSIGN VAR BIN_OP BIN_OP VAR VAR VAR FOR VAR FUNC_CALL VAR BIN_OP VAR NUMBER NUMBER NUMBER EXPR FUNC_CALL VAR VAR VAR STRING
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
import sys reader = (s.rstrip() for s in sys.stdin) input = reader.__next__ sum1 = 10 currnum = 0 ans = [10] mod = 998244353 n = int(input()) for i in range(1, n): currnum = (9 * i + 10) * pow(10, i, mod) - sum1 sum1 += currnum ans.append(currnum % mod) print(" ".join(str(x) for x in ans[::-1]))
IMPORT ASSIGN VAR FUNC_CALL VAR VAR VAR ASSIGN VAR VAR ASSIGN VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR LIST NUMBER ASSIGN VAR NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR NUMBER VAR ASSIGN VAR BIN_OP BIN_OP BIN_OP BIN_OP NUMBER VAR NUMBER FUNC_CALL VAR NUMBER VAR VAR VAR VAR VAR EXPR FUNC_CALL VAR BIN_OP VAR VAR EXPR FUNC_CALL VAR FUNC_CALL STRING FUNC_CALL VAR VAR VAR VAR NUMBER
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
n = int(input()) if n == 1: print(10) elif n == 2: print(180, 10) elif n == 3: print(2610, 180, 10) elif n == 4: print(34200, 2610, 180, 10) else: M = 998244353 B = [0] * (n + 1) B[1] %= M B[n] = 10 B[n - 1] = 180 B[n - 2] = 2610 for i in range(1, n - 2): B[i] = ( 10 * ( 18 * pow(10, n - i - 1, M) % M + (n - i - 1) * 81 * pow(10, n - i - 2, M) ) % M ) B[i] %= M for i in range(len(B)): B[i] %= M print(*B[1:])
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR IF VAR NUMBER EXPR FUNC_CALL VAR NUMBER IF VAR NUMBER EXPR FUNC_CALL VAR NUMBER NUMBER IF VAR NUMBER EXPR FUNC_CALL VAR NUMBER NUMBER NUMBER IF VAR NUMBER EXPR FUNC_CALL VAR NUMBER NUMBER NUMBER NUMBER ASSIGN VAR NUMBER ASSIGN VAR BIN_OP LIST NUMBER BIN_OP VAR NUMBER VAR NUMBER VAR ASSIGN VAR VAR NUMBER ASSIGN VAR BIN_OP VAR NUMBER NUMBER ASSIGN VAR BIN_OP VAR NUMBER NUMBER FOR VAR FUNC_CALL VAR NUMBER BIN_OP VAR NUMBER ASSIGN VAR VAR BIN_OP BIN_OP NUMBER BIN_OP BIN_OP BIN_OP NUMBER FUNC_CALL VAR NUMBER BIN_OP BIN_OP VAR VAR NUMBER VAR VAR BIN_OP BIN_OP BIN_OP BIN_OP VAR VAR NUMBER NUMBER FUNC_CALL VAR NUMBER BIN_OP BIN_OP VAR VAR NUMBER VAR VAR VAR VAR VAR FOR VAR FUNC_CALL VAR FUNC_CALL VAR VAR VAR VAR VAR EXPR FUNC_CALL VAR VAR NUMBER
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
M = 998244353 def solve(n): if n == 1: return "10" if n == 2: return "180 10" if n == 3: return "2610 180 10" ans = [10, 180, 2610] for _ in range(n - 3): ans.append((20 * ans[-1] - 100 * ans[-2]) % M) ans = ans[::-1] return " ".join(map(str, ans[:n])) def main(): n = int(input()) print(solve(n)) main()
ASSIGN VAR NUMBER FUNC_DEF IF VAR NUMBER RETURN STRING IF VAR NUMBER RETURN STRING IF VAR NUMBER RETURN STRING ASSIGN VAR LIST NUMBER NUMBER NUMBER FOR VAR FUNC_CALL VAR BIN_OP VAR NUMBER EXPR FUNC_CALL VAR BIN_OP BIN_OP BIN_OP NUMBER VAR NUMBER BIN_OP NUMBER VAR NUMBER VAR ASSIGN VAR VAR NUMBER RETURN FUNC_CALL STRING FUNC_CALL VAR VAR VAR VAR FUNC_DEF ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR EXPR FUNC_CALL VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
MOD = 998244353 def powr(n, N): temp = 1 while N > 0: if N % 2 != 0: temp = temp * n % MOD n = n * n % MOD N = N // 2 return temp % MOD n = int(input()) L = [0, 1, 18] tot = 1 for i in range(2, n): t1 = powr(10, i - 2) % MOD t2 = 81 * i % MOD t2 = (t2 + 99) % MOD t2 = t2 * t1 % MOD tot = (tot + t2) % MOD L.append(t2 % MOD) ans = [] for i in range(1, n + 1): t3 = L[i] * 10 % MOD ans.append(t3) ans = ans[::-1] print(*ans)
ASSIGN VAR NUMBER FUNC_DEF ASSIGN VAR NUMBER WHILE VAR NUMBER IF BIN_OP VAR NUMBER NUMBER ASSIGN VAR BIN_OP BIN_OP VAR VAR VAR ASSIGN VAR BIN_OP BIN_OP VAR VAR VAR ASSIGN VAR BIN_OP VAR NUMBER RETURN BIN_OP VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR LIST NUMBER NUMBER NUMBER ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR NUMBER VAR ASSIGN VAR BIN_OP FUNC_CALL VAR NUMBER BIN_OP VAR NUMBER VAR ASSIGN VAR BIN_OP BIN_OP NUMBER VAR VAR ASSIGN VAR BIN_OP BIN_OP VAR NUMBER VAR ASSIGN VAR BIN_OP BIN_OP VAR VAR VAR ASSIGN VAR BIN_OP BIN_OP VAR VAR VAR EXPR FUNC_CALL VAR BIN_OP VAR VAR ASSIGN VAR LIST FOR VAR FUNC_CALL VAR NUMBER BIN_OP VAR NUMBER ASSIGN VAR BIN_OP BIN_OP VAR VAR NUMBER VAR EXPR FUNC_CALL VAR VAR ASSIGN VAR VAR NUMBER EXPR FUNC_CALL VAR VAR
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
mod = 998244353 pow10 = [1] * int(2 * 100000.0 + 1) n = int(input()) for i in range(1, n): pow10[i] = pow10[i - 1] * 10 % mod for len in range(1, n): ans = 2 * 10 * 9 * pow10[n - len - 1] % mod ans += (n - len - 1) * 81 * 10 * pow10[n - len - 2] % mod ans %= mod print(ans, end=" ") print(10)
ASSIGN VAR NUMBER ASSIGN VAR BIN_OP LIST NUMBER FUNC_CALL VAR BIN_OP BIN_OP NUMBER NUMBER NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR NUMBER VAR ASSIGN VAR VAR BIN_OP BIN_OP VAR BIN_OP VAR NUMBER NUMBER VAR FOR VAR FUNC_CALL VAR NUMBER VAR ASSIGN VAR BIN_OP BIN_OP BIN_OP BIN_OP NUMBER NUMBER NUMBER VAR BIN_OP BIN_OP VAR VAR NUMBER VAR VAR BIN_OP BIN_OP BIN_OP BIN_OP BIN_OP BIN_OP VAR VAR NUMBER NUMBER NUMBER VAR BIN_OP BIN_OP VAR VAR NUMBER VAR VAR VAR EXPR FUNC_CALL VAR VAR STRING EXPR FUNC_CALL VAR NUMBER
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
n = int(input()) if n == 1: print("10") exit() m = 998244353 ans = [10, 180] k, s = 100, 190 a = [20, 390] for i in range(3, n + 1): k = k % m * 10 % m p = i * k % m ans.append((p - a[i - 2]) % m) a.append((a[-1] % m + (s + ans[-1] + ans[-1]) % m) % m) s += ans[-1] ans.reverse() print(*ans)
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR IF VAR NUMBER EXPR FUNC_CALL VAR STRING EXPR FUNC_CALL VAR ASSIGN VAR NUMBER ASSIGN VAR LIST NUMBER NUMBER ASSIGN VAR VAR NUMBER NUMBER ASSIGN VAR LIST NUMBER NUMBER FOR VAR FUNC_CALL VAR NUMBER BIN_OP VAR NUMBER ASSIGN VAR BIN_OP BIN_OP BIN_OP VAR VAR NUMBER VAR ASSIGN VAR BIN_OP BIN_OP VAR VAR VAR EXPR FUNC_CALL VAR BIN_OP BIN_OP VAR VAR BIN_OP VAR NUMBER VAR EXPR FUNC_CALL VAR BIN_OP BIN_OP BIN_OP VAR NUMBER VAR BIN_OP BIN_OP BIN_OP VAR VAR NUMBER VAR NUMBER VAR VAR VAR VAR NUMBER EXPR FUNC_CALL VAR EXPR FUNC_CALL VAR VAR
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
from sys import stdin, stdout def cout(x): print(x, end=" ") return n = int(input()) mod = 998244353 t, a = 10, 10 v, pot = [10], 10 for i in range(2, n + 1): t += a t %= mod pot *= 10 pot %= mod x = (i * pot - t) % mod a += x a %= mod t += x t %= mod v.append(x % mod) v.reverse() for i in range(len(v)): cout(v[i])
FUNC_DEF EXPR FUNC_CALL VAR VAR STRING RETURN ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR NUMBER ASSIGN VAR VAR NUMBER NUMBER ASSIGN VAR VAR LIST NUMBER NUMBER FOR VAR FUNC_CALL VAR NUMBER BIN_OP VAR NUMBER VAR VAR VAR VAR VAR NUMBER VAR VAR ASSIGN VAR BIN_OP BIN_OP BIN_OP VAR VAR VAR VAR VAR VAR VAR VAR VAR VAR VAR VAR EXPR FUNC_CALL VAR BIN_OP VAR VAR EXPR FUNC_CALL VAR FOR VAR FUNC_CALL VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR VAR VAR
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
def solve(k, i): middles = max(k - i - 1, 0) ends = 2 if k != i else 0 base = 100 * (ends + middles) - (ends * 10 + middles * 19) return base, k - i - 1 n = int(input()) ans = [] for i in range(1, n + 1): if n == i: ans.append(10) continue base, exp = solve(n, i) q = pow(10, exp, 998244353) q *= base q %= 998244353 ans.append(q) print(*ans)
FUNC_DEF ASSIGN VAR FUNC_CALL VAR BIN_OP BIN_OP VAR VAR NUMBER NUMBER ASSIGN VAR VAR VAR NUMBER NUMBER ASSIGN VAR BIN_OP BIN_OP NUMBER BIN_OP VAR VAR BIN_OP BIN_OP VAR NUMBER BIN_OP VAR NUMBER RETURN VAR BIN_OP BIN_OP VAR VAR NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR LIST FOR VAR FUNC_CALL VAR NUMBER BIN_OP VAR NUMBER IF VAR VAR EXPR FUNC_CALL VAR NUMBER ASSIGN VAR VAR FUNC_CALL VAR VAR VAR ASSIGN VAR FUNC_CALL VAR NUMBER VAR NUMBER VAR VAR VAR NUMBER EXPR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR VAR
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
def solve(n): MOD = 998244353 pow10 = [1] for i in range(n + 3): pow10 += [pow10[-1] * 10 % MOD] cnt = [0] * (n - 1) for block in range(1, n): k = n - block + 1 d = n - block m = 0 m += pow10[d] * 18 % MOD m += (k - 2) * pow10[d - 1] * 81 % MOD m %= MOD cnt[block - 1] += m cnt[block - 1] %= MOD cnt += [10] return cnt n = int(input()) print(" ".join(map(str, solve(n))))
FUNC_DEF ASSIGN VAR NUMBER ASSIGN VAR LIST NUMBER FOR VAR FUNC_CALL VAR BIN_OP VAR NUMBER VAR LIST BIN_OP BIN_OP VAR NUMBER NUMBER VAR ASSIGN VAR BIN_OP LIST NUMBER BIN_OP VAR NUMBER FOR VAR FUNC_CALL VAR NUMBER VAR ASSIGN VAR BIN_OP BIN_OP VAR VAR NUMBER ASSIGN VAR BIN_OP VAR VAR ASSIGN VAR NUMBER VAR BIN_OP BIN_OP VAR VAR NUMBER VAR VAR BIN_OP BIN_OP BIN_OP BIN_OP VAR NUMBER VAR BIN_OP VAR NUMBER NUMBER VAR VAR VAR VAR BIN_OP VAR NUMBER VAR VAR BIN_OP VAR NUMBER VAR VAR LIST NUMBER RETURN VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR EXPR FUNC_CALL VAR FUNC_CALL STRING FUNC_CALL VAR VAR FUNC_CALL VAR VAR
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
M = 998244353 n = int(input()) l = [10, 180] pow10 = 1 for i in range(n - 2): pow10 = pow10 * 10 % M l.append((10 * l[-1] + 81 * pow10) % M) l = list(map(str, l)) l.reverse() if n == 1: print("10") else: print(" ".join(l))
ASSIGN VAR NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR LIST NUMBER NUMBER ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR BIN_OP VAR NUMBER ASSIGN VAR BIN_OP BIN_OP VAR NUMBER VAR EXPR FUNC_CALL VAR BIN_OP BIN_OP BIN_OP NUMBER VAR NUMBER BIN_OP NUMBER VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR VAR EXPR FUNC_CALL VAR IF VAR NUMBER EXPR FUNC_CALL VAR STRING EXPR FUNC_CALL VAR FUNC_CALL STRING VAR
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
mod = 998244353 n = int(input()) pow10 = [1] for i in range(n): pow10.append(10 * pow10[-1] % mod) ans = [] for i in range(1, n + 1): tmp = 0 if i == n: tmp = 10 else: tmp += 2 * 10 * 9 * pow10[n - i - 1] if n - i - 1 > 0: tmp += (n - i - 1) * 10 * 9 * 9 * pow10[n - i - 1 - 1] tmp %= mod ans.append(tmp) print(*ans)
ASSIGN VAR NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR LIST NUMBER FOR VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR BIN_OP BIN_OP NUMBER VAR NUMBER VAR ASSIGN VAR LIST FOR VAR FUNC_CALL VAR NUMBER BIN_OP VAR NUMBER ASSIGN VAR NUMBER IF VAR VAR ASSIGN VAR NUMBER VAR BIN_OP BIN_OP BIN_OP NUMBER NUMBER NUMBER VAR BIN_OP BIN_OP VAR VAR NUMBER IF BIN_OP BIN_OP VAR VAR NUMBER NUMBER VAR BIN_OP BIN_OP BIN_OP BIN_OP BIN_OP BIN_OP VAR VAR NUMBER NUMBER NUMBER NUMBER VAR BIN_OP BIN_OP BIN_OP VAR VAR NUMBER NUMBER VAR VAR EXPR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR VAR
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
n = int(input()) lens = [] total = 0 rotal = 0 for x in range(1, n + 1): thing = x * pow(10, x, 998244353) - rotal total += thing rotal += total + thing lens.append(str(thing % 998244353)) lens.reverse() print(" ".join(lens))
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR LIST ASSIGN VAR NUMBER ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR NUMBER BIN_OP VAR NUMBER ASSIGN VAR BIN_OP BIN_OP VAR FUNC_CALL VAR NUMBER VAR NUMBER VAR VAR VAR VAR BIN_OP VAR VAR EXPR FUNC_CALL VAR FUNC_CALL VAR BIN_OP VAR NUMBER EXPR FUNC_CALL VAR EXPR FUNC_CALL VAR FUNC_CALL STRING VAR
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
n = int(input()) mod = 998244353 output = [] for i in range(1, n + 1): if i == n: output.append(10) elif i == n - 1: output.append(180) else: a1 = 2 * 9 * 10 * pow(10, n - i - 1, mod) a2 = (n - i - 1) * 10 * 9 * 9 * pow(10, n - i - 2, mod) output.append((a1 + a2) % mod) print(*output)
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR NUMBER ASSIGN VAR LIST FOR VAR FUNC_CALL VAR NUMBER BIN_OP VAR NUMBER IF VAR VAR EXPR FUNC_CALL VAR NUMBER IF VAR BIN_OP VAR NUMBER EXPR FUNC_CALL VAR NUMBER ASSIGN VAR BIN_OP BIN_OP BIN_OP NUMBER NUMBER NUMBER FUNC_CALL VAR NUMBER BIN_OP BIN_OP VAR VAR NUMBER VAR ASSIGN VAR BIN_OP BIN_OP BIN_OP BIN_OP BIN_OP BIN_OP VAR VAR NUMBER NUMBER NUMBER NUMBER FUNC_CALL VAR NUMBER BIN_OP BIN_OP VAR VAR NUMBER VAR EXPR FUNC_CALL VAR BIN_OP BIN_OP VAR VAR VAR EXPR FUNC_CALL VAR VAR
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
n = int(input()) if n == 1: print(10) elif n == 2: print(180, 10) else: mo = 998244353 d = [10, 180] s = 190 pp = 200 for i in range(n - 2): zz = (i + 3) * pow(10, i + 3, mo) % mo d.append((zz - pp - s + mo) % mo) pp = zz s += d[-1] s %= mo print(*d[::-1])
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR IF VAR NUMBER EXPR FUNC_CALL VAR NUMBER IF VAR NUMBER EXPR FUNC_CALL VAR NUMBER NUMBER ASSIGN VAR NUMBER ASSIGN VAR LIST NUMBER NUMBER ASSIGN VAR NUMBER ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR BIN_OP VAR NUMBER ASSIGN VAR BIN_OP BIN_OP BIN_OP VAR NUMBER FUNC_CALL VAR NUMBER BIN_OP VAR NUMBER VAR VAR EXPR FUNC_CALL VAR BIN_OP BIN_OP BIN_OP BIN_OP VAR VAR VAR VAR VAR ASSIGN VAR VAR VAR VAR NUMBER VAR VAR EXPR FUNC_CALL VAR VAR NUMBER
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
mod = 998244353 n = int(input()) pow10 = [1] * (n + 1) for i in range(n): pow10[i + 1] = pow10[i] * 10 % mod for len in range(1, n): ans = 18 * pow10[n - len] % mod ans = (ans + (n - len - 1) * 81 * pow10[n - len - 1]) % mod print(ans, end=" ") print(10)
ASSIGN VAR NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR BIN_OP LIST NUMBER BIN_OP VAR NUMBER FOR VAR FUNC_CALL VAR VAR ASSIGN VAR BIN_OP VAR NUMBER BIN_OP BIN_OP VAR VAR NUMBER VAR FOR VAR FUNC_CALL VAR NUMBER VAR ASSIGN VAR BIN_OP BIN_OP NUMBER VAR BIN_OP VAR VAR VAR ASSIGN VAR BIN_OP BIN_OP VAR BIN_OP BIN_OP BIN_OP BIN_OP VAR VAR NUMBER NUMBER VAR BIN_OP BIN_OP VAR VAR NUMBER VAR EXPR FUNC_CALL VAR VAR STRING EXPR FUNC_CALL VAR NUMBER
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
import sys m = 998244353 n = int(input()) v = [(0) for _ in range(n)] k10 = 10 v[0] = 10 total = 10 one = 10 for i in range(1, n): total = (total + one) % m k10 = k10 * 10 % m v[i] = ((k10 * (i + 1) - total) % m + m) % m total += v[i] one = (one + v[i]) % m for i in reversed(v): print(i, end=" ")
IMPORT ASSIGN VAR NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR NUMBER VAR FUNC_CALL VAR VAR ASSIGN VAR NUMBER ASSIGN VAR NUMBER NUMBER ASSIGN VAR NUMBER ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR NUMBER VAR ASSIGN VAR BIN_OP BIN_OP VAR VAR VAR ASSIGN VAR BIN_OP BIN_OP VAR NUMBER VAR ASSIGN VAR VAR BIN_OP BIN_OP BIN_OP BIN_OP BIN_OP VAR BIN_OP VAR NUMBER VAR VAR VAR VAR VAR VAR VAR ASSIGN VAR BIN_OP BIN_OP VAR VAR VAR VAR FOR VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR VAR STRING
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
n = int(input()) a = [] p = 998244353 a.append(10) d = 10 s = 10 for i in range(n - 1): a.append((d * 10 * (i + 2) - d * (i + 1) - s) % p) d = d * 10 % p s = (s + a[-1]) % p q = "" for i in range(len(a) - 1): q += str(a[-1 - i]) q += " " print(q + "10")
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR LIST ASSIGN VAR NUMBER EXPR FUNC_CALL VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR BIN_OP VAR NUMBER EXPR FUNC_CALL VAR BIN_OP BIN_OP BIN_OP BIN_OP BIN_OP VAR NUMBER BIN_OP VAR NUMBER BIN_OP VAR BIN_OP VAR NUMBER VAR VAR ASSIGN VAR BIN_OP BIN_OP VAR NUMBER VAR ASSIGN VAR BIN_OP BIN_OP VAR VAR NUMBER VAR ASSIGN VAR STRING FOR VAR FUNC_CALL VAR BIN_OP FUNC_CALL VAR VAR NUMBER VAR FUNC_CALL VAR VAR BIN_OP NUMBER VAR VAR STRING EXPR FUNC_CALL VAR BIN_OP VAR STRING
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
MOD = 998244353 pow10 = [1] * (2 * 10**5 + 1) for i in range(1, 2 * 10**5 + 1): pow10[i] = pow10[i - 1] * 10 pow10[i] %= MOD n = int(input()) for i in range(1, n): print( (2 * pow10[n - i - 1] * 9 + max(0, n - i - 1) * pow10[max(0, n - i - 2)] * 81) * 10 % MOD, end=" ", ) print(10)
ASSIGN VAR NUMBER ASSIGN VAR BIN_OP LIST NUMBER BIN_OP BIN_OP NUMBER BIN_OP NUMBER NUMBER NUMBER FOR VAR FUNC_CALL VAR NUMBER BIN_OP BIN_OP NUMBER BIN_OP NUMBER NUMBER NUMBER ASSIGN VAR VAR BIN_OP VAR BIN_OP VAR NUMBER NUMBER VAR VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR NUMBER VAR EXPR FUNC_CALL VAR BIN_OP BIN_OP BIN_OP BIN_OP BIN_OP NUMBER VAR BIN_OP BIN_OP VAR VAR NUMBER NUMBER BIN_OP BIN_OP FUNC_CALL VAR NUMBER BIN_OP BIN_OP VAR VAR NUMBER VAR FUNC_CALL VAR NUMBER BIN_OP BIN_OP VAR VAR NUMBER NUMBER NUMBER VAR STRING EXPR FUNC_CALL VAR NUMBER
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
n = int(input()) modulo = 998244353 ten_powers = [1] for i in range(1, n): ten_powers.append(ten_powers[-1] * 10 % modulo) for k in range(1, n + 1): if n == k: ways = 10 elif n == k + 1: ways = 180 else: ways = ten_powers[n - k - 1] * (180 + 9**2 * (n - k - 1)) % modulo print(ways, end=" ", flush=False) print()
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR NUMBER ASSIGN VAR LIST NUMBER FOR VAR FUNC_CALL VAR NUMBER VAR EXPR FUNC_CALL VAR BIN_OP BIN_OP VAR NUMBER NUMBER VAR FOR VAR FUNC_CALL VAR NUMBER BIN_OP VAR NUMBER IF VAR VAR ASSIGN VAR NUMBER IF VAR BIN_OP VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR BIN_OP BIN_OP VAR BIN_OP BIN_OP VAR VAR NUMBER BIN_OP NUMBER BIN_OP BIN_OP NUMBER NUMBER BIN_OP BIN_OP VAR VAR NUMBER VAR EXPR FUNC_CALL VAR VAR STRING NUMBER EXPR FUNC_CALL VAR
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
n = int(input()) mod = 998244353 def query(P): if P == n: return 10 part1 = 10 * 9 * pow(10, n - P - 1, mod) if P < n - 1: part2 = 10 * 9 * 9 * pow(10, n - P - 2, mod) else: part2 = 0 ans = 2 * part1 + (n - P - 1) * part2 ans %= mod return ans ans = [query(i) for i in range(1, n + 1)] print(*ans)
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR NUMBER FUNC_DEF IF VAR VAR RETURN NUMBER ASSIGN VAR BIN_OP BIN_OP NUMBER NUMBER FUNC_CALL VAR NUMBER BIN_OP BIN_OP VAR VAR NUMBER VAR IF VAR BIN_OP VAR NUMBER ASSIGN VAR BIN_OP BIN_OP BIN_OP NUMBER NUMBER NUMBER FUNC_CALL VAR NUMBER BIN_OP BIN_OP VAR VAR NUMBER VAR ASSIGN VAR NUMBER ASSIGN VAR BIN_OP BIN_OP NUMBER VAR BIN_OP BIN_OP BIN_OP VAR VAR NUMBER VAR VAR VAR RETURN VAR ASSIGN VAR FUNC_CALL VAR VAR VAR FUNC_CALL VAR NUMBER BIN_OP VAR NUMBER EXPR FUNC_CALL VAR VAR
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
mod = 998244353 n = int(input()) ans = [-1] * n ans[-1] = 10 for i in range(n - 2, -1, -1): ans[i] = (11 + 9 * (n - i - 1)) * (9 * pow(10, n - i - 2, mod) % mod) % mod print(*ans)
ASSIGN VAR NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR BIN_OP LIST NUMBER VAR ASSIGN VAR NUMBER NUMBER FOR VAR FUNC_CALL VAR BIN_OP VAR NUMBER NUMBER NUMBER ASSIGN VAR VAR BIN_OP BIN_OP BIN_OP NUMBER BIN_OP NUMBER BIN_OP BIN_OP VAR VAR NUMBER BIN_OP BIN_OP NUMBER FUNC_CALL VAR NUMBER BIN_OP BIN_OP VAR VAR NUMBER VAR VAR VAR EXPR FUNC_CALL VAR VAR
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
n = int(input().strip()) mod_base = 998244353 pow10 = 10 ans = [] cum = 0 cumcum = 0 for i in range(1, n + 1): ans.append((i * pow10 - cumcum) % mod_base) cum = (cum + ans[-1]) % mod_base cumcum = (cumcum + ans[-1] + cum) % mod_base pow10 = pow10 * 10 % mod_base print(" ".join(map(str, reversed(ans))))
ASSIGN VAR FUNC_CALL VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR LIST ASSIGN VAR NUMBER ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR NUMBER BIN_OP VAR NUMBER EXPR FUNC_CALL VAR BIN_OP BIN_OP BIN_OP VAR VAR VAR VAR ASSIGN VAR BIN_OP BIN_OP VAR VAR NUMBER VAR ASSIGN VAR BIN_OP BIN_OP BIN_OP VAR VAR NUMBER VAR VAR ASSIGN VAR BIN_OP BIN_OP VAR NUMBER VAR EXPR FUNC_CALL VAR FUNC_CALL STRING FUNC_CALL VAR VAR FUNC_CALL VAR VAR
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
m = 998244353 n = int(input()) a = [0] * n ans = [0] * n i = n qp = 0 s = 0 while i >= 1: p = n - i + 1 q = p * pow(10, p, m) ans[p - 1] = q - qp - s qp = q s += ans[p - 1] ans[p - 1] = ans[p - 1] % m i -= 1 print(*ans[::-1])
ASSIGN VAR NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR BIN_OP LIST NUMBER VAR ASSIGN VAR BIN_OP LIST NUMBER VAR ASSIGN VAR VAR ASSIGN VAR NUMBER ASSIGN VAR NUMBER WHILE VAR NUMBER ASSIGN VAR BIN_OP BIN_OP VAR VAR NUMBER ASSIGN VAR BIN_OP VAR FUNC_CALL VAR NUMBER VAR VAR ASSIGN VAR BIN_OP VAR NUMBER BIN_OP BIN_OP VAR VAR VAR ASSIGN VAR VAR VAR VAR BIN_OP VAR NUMBER ASSIGN VAR BIN_OP VAR NUMBER BIN_OP VAR BIN_OP VAR NUMBER VAR VAR NUMBER EXPR FUNC_CALL VAR VAR NUMBER
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
n = int(input()) p = 998244353 odp = [0] * (n + 1) pote = [1] * 250000 for i in range(1, 250000): pote[i] = pote[i - 1] * 10 % p for i in range(1, n + 1): if i == n: odp[i] = 10 else: brzeg = 2 * pote[n - i - 1] * 10 * 9 ile = n - i - 1 srodek_poj = 10 * 9 * 9 * pote[n - i - 2] odp[i] = brzeg + ile * srodek_poj odp[i] = odp[i] % p print(*odp[1:])
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR NUMBER ASSIGN VAR BIN_OP LIST NUMBER BIN_OP VAR NUMBER ASSIGN VAR BIN_OP LIST NUMBER NUMBER FOR VAR FUNC_CALL VAR NUMBER NUMBER ASSIGN VAR VAR BIN_OP BIN_OP VAR BIN_OP VAR NUMBER NUMBER VAR FOR VAR FUNC_CALL VAR NUMBER BIN_OP VAR NUMBER IF VAR VAR ASSIGN VAR VAR NUMBER ASSIGN VAR BIN_OP BIN_OP BIN_OP NUMBER VAR BIN_OP BIN_OP VAR VAR NUMBER NUMBER NUMBER ASSIGN VAR BIN_OP BIN_OP VAR VAR NUMBER ASSIGN VAR BIN_OP BIN_OP BIN_OP NUMBER NUMBER NUMBER VAR BIN_OP BIN_OP VAR VAR NUMBER ASSIGN VAR VAR BIN_OP VAR BIN_OP VAR VAR ASSIGN VAR VAR BIN_OP VAR VAR VAR EXPR FUNC_CALL VAR VAR NUMBER
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
printn = lambda x: print(x, end="") inn = lambda: int(input()) inl = lambda: list(map(int, input().split())) inm = lambda: map(int, input().split()) ins = lambda: input().strip() DBG = True BIG = 10**18 R = 998244353 def ddprint(x): if DBG: print(x) n = inn() pw = [1] * (n + 1) for i in range(1, n + 1): pw[i] = pw[i - 1] * 10 % R pad = "" for i in range(1, n - 1): x = 10 * (9 * 9 * (n - i - 1) * pw[n - i - 2] + 9 * 2 * pw[n - i - 1]) % R printn(pad + str(x)) pad = " " if n >= 2: printn(pad + "180") pad = " " printn(pad + "10") print("")
ASSIGN VAR FUNC_CALL VAR VAR STRING ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR NUMBER ASSIGN VAR BIN_OP NUMBER NUMBER ASSIGN VAR NUMBER FUNC_DEF IF VAR EXPR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR BIN_OP LIST NUMBER BIN_OP VAR NUMBER FOR VAR FUNC_CALL VAR NUMBER BIN_OP VAR NUMBER ASSIGN VAR VAR BIN_OP BIN_OP VAR BIN_OP VAR NUMBER NUMBER VAR ASSIGN VAR STRING FOR VAR FUNC_CALL VAR NUMBER BIN_OP VAR NUMBER ASSIGN VAR BIN_OP BIN_OP NUMBER BIN_OP BIN_OP BIN_OP BIN_OP NUMBER NUMBER BIN_OP BIN_OP VAR VAR NUMBER VAR BIN_OP BIN_OP VAR VAR NUMBER BIN_OP BIN_OP NUMBER NUMBER VAR BIN_OP BIN_OP VAR VAR NUMBER VAR EXPR FUNC_CALL VAR BIN_OP VAR FUNC_CALL VAR VAR ASSIGN VAR STRING IF VAR NUMBER EXPR FUNC_CALL VAR BIN_OP VAR STRING ASSIGN VAR STRING EXPR FUNC_CALL VAR BIN_OP VAR STRING EXPR FUNC_CALL VAR STRING
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
n = int(input()) counts = [0] * n temp1 = 810 temp2 = 1800 counts[-1] = 10 if n >= 2: counts[-2] = 180 for i in range(n - 2, 0, -1): counts[i - 1] = (n - i - 1) * temp1 + temp2 counts[i - 1] %= 998244353 temp1 *= 10 temp2 *= 10 temp1 %= 998244353 temp2 %= 998244353 for item in counts: print(item, end=" ")
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR BIN_OP LIST NUMBER VAR ASSIGN VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR NUMBER NUMBER IF VAR NUMBER ASSIGN VAR NUMBER NUMBER FOR VAR FUNC_CALL VAR BIN_OP VAR NUMBER NUMBER NUMBER ASSIGN VAR BIN_OP VAR NUMBER BIN_OP BIN_OP BIN_OP BIN_OP VAR VAR NUMBER VAR VAR VAR BIN_OP VAR NUMBER NUMBER VAR NUMBER VAR NUMBER VAR NUMBER VAR NUMBER FOR VAR VAR EXPR FUNC_CALL VAR VAR STRING
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
n = int(input()) arr = [10] if n > 1: arr.append(10 * 9 * 2) num1 = 2 * 10 * 9 num2 = 9 * 9 for i in range(n - 2, 0, -1): num1 = num1 * 10 % 998244353 num2 = num2 * 10 % 998244353 arr.append((num1 + num2 * (n - 1 - i)) % 998244353) arr.reverse() for i in arr: print(i, end=" ")
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR LIST NUMBER IF VAR NUMBER EXPR FUNC_CALL VAR BIN_OP BIN_OP NUMBER NUMBER NUMBER ASSIGN VAR BIN_OP BIN_OP NUMBER NUMBER NUMBER ASSIGN VAR BIN_OP NUMBER NUMBER FOR VAR FUNC_CALL VAR BIN_OP VAR NUMBER NUMBER NUMBER ASSIGN VAR BIN_OP BIN_OP VAR NUMBER NUMBER ASSIGN VAR BIN_OP BIN_OP VAR NUMBER NUMBER EXPR FUNC_CALL VAR BIN_OP BIN_OP VAR BIN_OP VAR BIN_OP BIN_OP VAR NUMBER VAR NUMBER EXPR FUNC_CALL VAR FOR VAR VAR EXPR FUNC_CALL VAR VAR STRING
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
import sys input = sys.stdin.readline inf = 10000000000.0 mod = int(1000000000.0 + 7) t = 1 for _ in range(t): n = int(input()) modulo = 998244353 p = [1] * (n + 1) for i in range(1, n): p[i] = p[i - 1] * 10 % modulo for i in range(1, n): res = 2 * 10 * 9 * p[n - i - 1] res += 10 * 9 * 9 * p[n - i - 2] * (n - 1 - i) print(res % modulo, end=" ") print(10)
IMPORT ASSIGN VAR VAR ASSIGN VAR NUMBER ASSIGN VAR FUNC_CALL VAR BIN_OP NUMBER NUMBER ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR NUMBER ASSIGN VAR BIN_OP LIST NUMBER BIN_OP VAR NUMBER FOR VAR FUNC_CALL VAR NUMBER VAR ASSIGN VAR VAR BIN_OP BIN_OP VAR BIN_OP VAR NUMBER NUMBER VAR FOR VAR FUNC_CALL VAR NUMBER VAR ASSIGN VAR BIN_OP BIN_OP BIN_OP NUMBER NUMBER NUMBER VAR BIN_OP BIN_OP VAR VAR NUMBER VAR BIN_OP BIN_OP BIN_OP BIN_OP NUMBER NUMBER NUMBER VAR BIN_OP BIN_OP VAR VAR NUMBER BIN_OP BIN_OP VAR NUMBER VAR EXPR FUNC_CALL VAR BIN_OP VAR VAR STRING EXPR FUNC_CALL VAR NUMBER
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
mod = 998244353 def mul(a, b): return a % mod * (b % mod) % mod def div(a, b): return mul(a, power(b, mod - 2)) def div2(a, b): return mul(a, modinv(b)) pwt = [1] for i in range(2 * 10**5): pwt.append(pwt[-1] * 10 % mod) N = int(input()) R = [] for i in range(1, N + 1): if N - i >= 2: x = mul(10 * 9 * 9 * pwt[N - i - 2] % mod, N - i - 1) y = mul(10 * 9 * pwt[N - i - 1] % mod, 2) elif N - i == 1: x = 0 y = mul(10 * 9 * pwt[N - i - 1] % mod, 2) else: x = 0 y = 10 R.append((x + y) % mod) print(*R)
ASSIGN VAR NUMBER FUNC_DEF RETURN BIN_OP BIN_OP BIN_OP VAR VAR BIN_OP VAR VAR VAR FUNC_DEF RETURN FUNC_CALL VAR VAR FUNC_CALL VAR VAR BIN_OP VAR NUMBER FUNC_DEF RETURN FUNC_CALL VAR VAR FUNC_CALL VAR VAR ASSIGN VAR LIST NUMBER FOR VAR FUNC_CALL VAR BIN_OP NUMBER BIN_OP NUMBER NUMBER EXPR FUNC_CALL VAR BIN_OP BIN_OP VAR NUMBER NUMBER VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR LIST FOR VAR FUNC_CALL VAR NUMBER BIN_OP VAR NUMBER IF BIN_OP VAR VAR NUMBER ASSIGN VAR FUNC_CALL VAR BIN_OP BIN_OP BIN_OP BIN_OP NUMBER NUMBER NUMBER VAR BIN_OP BIN_OP VAR VAR NUMBER VAR BIN_OP BIN_OP VAR VAR NUMBER ASSIGN VAR FUNC_CALL VAR BIN_OP BIN_OP BIN_OP NUMBER NUMBER VAR BIN_OP BIN_OP VAR VAR NUMBER VAR NUMBER IF BIN_OP VAR VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR FUNC_CALL VAR BIN_OP BIN_OP BIN_OP NUMBER NUMBER VAR BIN_OP BIN_OP VAR VAR NUMBER VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR NUMBER EXPR FUNC_CALL VAR BIN_OP BIN_OP VAR VAR VAR EXPR FUNC_CALL VAR VAR
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
n = int(input()) lst = [] for i in range(1, n + 1): a = ( max(n - i - 1, 0) * pow(10, max(n - i - 2, 0), 998244353) % 998244353 * 10 * 9 * 9 ) a += 2 * (pow(10, max(n - i - 1, 0), 998244353) % 998244353) * 10 * 9 a %= 998244353 lst.append(a) lst[-1] = 10 print(*lst)
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR LIST FOR VAR FUNC_CALL VAR NUMBER BIN_OP VAR NUMBER ASSIGN VAR BIN_OP BIN_OP BIN_OP BIN_OP BIN_OP FUNC_CALL VAR BIN_OP BIN_OP VAR VAR NUMBER NUMBER FUNC_CALL VAR NUMBER FUNC_CALL VAR BIN_OP BIN_OP VAR VAR NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER VAR BIN_OP BIN_OP BIN_OP NUMBER BIN_OP FUNC_CALL VAR NUMBER FUNC_CALL VAR BIN_OP BIN_OP VAR VAR NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER VAR NUMBER EXPR FUNC_CALL VAR VAR ASSIGN VAR NUMBER NUMBER EXPR FUNC_CALL VAR VAR
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
n = int(input()) m = 998244353 for i in range(n - 1): res = pow(10, n - i - 2, m) res *= 180 + (n - i - 2) * 81 res %= m print(res) print(10)
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR BIN_OP VAR NUMBER ASSIGN VAR FUNC_CALL VAR NUMBER BIN_OP BIN_OP VAR VAR NUMBER VAR VAR BIN_OP NUMBER BIN_OP BIN_OP BIN_OP VAR VAR NUMBER NUMBER VAR VAR EXPR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR NUMBER
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
n = int(input()) las = 9 su = 10 a = [] a.append(10) mod = 998244353 for i in range(1, n): las = las * 10 % mod a.append((su * 9 + las) % mod) su = (su + a[i]) % mod for i in range(n - 1, 0, -1): print(a[i], end=" ") print(a[0])
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR LIST EXPR FUNC_CALL VAR NUMBER ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR NUMBER VAR ASSIGN VAR BIN_OP BIN_OP VAR NUMBER VAR EXPR FUNC_CALL VAR BIN_OP BIN_OP BIN_OP VAR NUMBER VAR VAR ASSIGN VAR BIN_OP BIN_OP VAR VAR VAR VAR FOR VAR FUNC_CALL VAR BIN_OP VAR NUMBER NUMBER NUMBER EXPR FUNC_CALL VAR VAR VAR STRING EXPR FUNC_CALL VAR VAR NUMBER
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
n = int(input()) step = [1] * n for i in range(1, n): step[i] = step[i - 1] * 10 % 998244353 for i in range(n): if n - i == 1: print(10, end=" ") elif n - i == 2: print(180, end=" ") else: print( (18 * step[n - i - 1] + 81 * step[n - i - 2] * (n - i - 2)) % 998244353, end=" ", )
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR BIN_OP LIST NUMBER VAR FOR VAR FUNC_CALL VAR NUMBER VAR ASSIGN VAR VAR BIN_OP BIN_OP VAR BIN_OP VAR NUMBER NUMBER NUMBER FOR VAR FUNC_CALL VAR VAR IF BIN_OP VAR VAR NUMBER EXPR FUNC_CALL VAR NUMBER STRING IF BIN_OP VAR VAR NUMBER EXPR FUNC_CALL VAR NUMBER STRING EXPR FUNC_CALL VAR BIN_OP BIN_OP BIN_OP NUMBER VAR BIN_OP BIN_OP VAR VAR NUMBER BIN_OP BIN_OP NUMBER VAR BIN_OP BIN_OP VAR VAR NUMBER BIN_OP BIN_OP VAR VAR NUMBER NUMBER STRING
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
MOD = 998244353 n = int(input()) if n == 1: print(10) exit() a = [1] * (n - 1) a[0] = 20 for i in range(1, n - 1): a[i] *= a[i - 1] * 10 + 9 * pow(10, i, MOD) a[i] %= MOD a.reverse() for i in range(n - 1): a[i] *= 9 a[i] %= MOD a.append(10) print(*a)
ASSIGN VAR NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR IF VAR NUMBER EXPR FUNC_CALL VAR NUMBER EXPR FUNC_CALL VAR ASSIGN VAR BIN_OP LIST NUMBER BIN_OP VAR NUMBER ASSIGN VAR NUMBER NUMBER FOR VAR FUNC_CALL VAR NUMBER BIN_OP VAR NUMBER VAR VAR BIN_OP BIN_OP VAR BIN_OP VAR NUMBER NUMBER BIN_OP NUMBER FUNC_CALL VAR NUMBER VAR VAR VAR VAR VAR EXPR FUNC_CALL VAR FOR VAR FUNC_CALL VAR BIN_OP VAR NUMBER VAR VAR NUMBER VAR VAR VAR EXPR FUNC_CALL VAR NUMBER EXPR FUNC_CALL VAR VAR
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
from sys import stdin input = stdin.readline mod = 998244353 n = int(input()) for i in range(1, n): print(pow(10, n - i - 1, mod) * (180 + (n - i - 1) * 81) % mod, end=" ") print(10)
ASSIGN VAR VAR ASSIGN VAR NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR NUMBER VAR EXPR FUNC_CALL VAR BIN_OP BIN_OP FUNC_CALL VAR NUMBER BIN_OP BIN_OP VAR VAR NUMBER VAR BIN_OP NUMBER BIN_OP BIN_OP BIN_OP VAR VAR NUMBER NUMBER VAR STRING EXPR FUNC_CALL VAR NUMBER
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
n = int(input()) ten = [1] mod = 998244353 for i in range(1, n + 1): ten.append(ten[-1] * 10 % mod) ans = [] for i in range(1, n + 1): if n == i: ans.append(10) elif n == i + 1: ans.append(180 * ten[n - i - 1] % mod) else: SUM = 180 * ten[n - i - 1] + 810 * (n - i - 1) * ten[n - i - 2] ans.append(SUM % mod) for i, x in enumerate(ans): ans[i] = str(x) print(" ".join(ans))
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR LIST NUMBER ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR NUMBER BIN_OP VAR NUMBER EXPR FUNC_CALL VAR BIN_OP BIN_OP VAR NUMBER NUMBER VAR ASSIGN VAR LIST FOR VAR FUNC_CALL VAR NUMBER BIN_OP VAR NUMBER IF VAR VAR EXPR FUNC_CALL VAR NUMBER IF VAR BIN_OP VAR NUMBER EXPR FUNC_CALL VAR BIN_OP BIN_OP NUMBER VAR BIN_OP BIN_OP VAR VAR NUMBER VAR ASSIGN VAR BIN_OP BIN_OP NUMBER VAR BIN_OP BIN_OP VAR VAR NUMBER BIN_OP BIN_OP NUMBER BIN_OP BIN_OP VAR VAR NUMBER VAR BIN_OP BIN_OP VAR VAR NUMBER EXPR FUNC_CALL VAR BIN_OP VAR VAR FOR VAR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR FUNC_CALL STRING VAR
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
MOD = 998244353 mxn = 200000 p = [1] * (mxn + 1) for i in range(1, mxn + 1): p[i] = p[i - 1] * 10 % MOD n = int(input()) for i in range(1, n): res = 0 res += 2 * 10 * 9 * p[n - i - 1] if n - i - 2 >= 0: res += 10 * 9 * 9 * p[n - i - 2] * (n - i - 1) print(res % MOD, end=" ") print(10)
ASSIGN VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR BIN_OP LIST NUMBER BIN_OP VAR NUMBER FOR VAR FUNC_CALL VAR NUMBER BIN_OP VAR NUMBER ASSIGN VAR VAR BIN_OP BIN_OP VAR BIN_OP VAR NUMBER NUMBER VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR NUMBER VAR ASSIGN VAR NUMBER VAR BIN_OP BIN_OP BIN_OP NUMBER NUMBER NUMBER VAR BIN_OP BIN_OP VAR VAR NUMBER IF BIN_OP BIN_OP VAR VAR NUMBER NUMBER VAR BIN_OP BIN_OP BIN_OP BIN_OP NUMBER NUMBER NUMBER VAR BIN_OP BIN_OP VAR VAR NUMBER BIN_OP BIN_OP VAR VAR NUMBER EXPR FUNC_CALL VAR BIN_OP VAR VAR STRING EXPR FUNC_CALL VAR NUMBER
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
mod = 998244353 p = [1] * 200005 for i in range(1, 200005): p[i] = p[i - 1] * 10 % mod n = int(input()) f = [] f.append(10) f.append(180) for i in range(2, n): f.append((f[i - 1] * 10 % mod + p[i - 1] * 9 * 9 % mod) % mod) for i in range(n - 1, -1, -1): print(f[i], end=" ")
ASSIGN VAR NUMBER ASSIGN VAR BIN_OP LIST NUMBER NUMBER FOR VAR FUNC_CALL VAR NUMBER NUMBER ASSIGN VAR VAR BIN_OP BIN_OP VAR BIN_OP VAR NUMBER NUMBER VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR LIST EXPR FUNC_CALL VAR NUMBER EXPR FUNC_CALL VAR NUMBER FOR VAR FUNC_CALL VAR NUMBER VAR EXPR FUNC_CALL VAR BIN_OP BIN_OP BIN_OP BIN_OP VAR BIN_OP VAR NUMBER NUMBER VAR BIN_OP BIN_OP BIN_OP VAR BIN_OP VAR NUMBER NUMBER NUMBER VAR VAR FOR VAR FUNC_CALL VAR BIN_OP VAR NUMBER NUMBER NUMBER EXPR FUNC_CALL VAR VAR VAR STRING
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
n = int(input()) ini = [0] mod = 998244353 pref, last = 0, 0 for i in range(1, n + 1): curr = (i * pow(10, i, mod) % mod - last - pref) % mod pref = (pref + curr) % mod last = (pref + last) % mod ini.append(curr) print(*ini[::-1][:-1])
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR LIST NUMBER ASSIGN VAR NUMBER ASSIGN VAR VAR NUMBER NUMBER FOR VAR FUNC_CALL VAR NUMBER BIN_OP VAR NUMBER ASSIGN VAR BIN_OP BIN_OP BIN_OP BIN_OP BIN_OP VAR FUNC_CALL VAR NUMBER VAR VAR VAR VAR VAR VAR ASSIGN VAR BIN_OP BIN_OP VAR VAR VAR ASSIGN VAR BIN_OP BIN_OP VAR VAR VAR EXPR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR VAR NUMBER NUMBER
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
import sys n = int(input()) k = 1 ans = [10] s = 10 r = 10 x = 100 MOD_NUM = 998244353 while k < n: new = (k + 1) * x - (s + r) r += new s += r k += 1 x *= 10 r %= MOD_NUM s %= MOD_NUM x %= MOD_NUM while new < 0: new += MOD_NUM ans.append(new % MOD_NUM) print(*ans[::-1])
IMPORT ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR NUMBER ASSIGN VAR LIST NUMBER ASSIGN VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR NUMBER WHILE VAR VAR ASSIGN VAR BIN_OP BIN_OP BIN_OP VAR NUMBER VAR BIN_OP VAR VAR VAR VAR VAR VAR VAR NUMBER VAR NUMBER VAR VAR VAR VAR VAR VAR WHILE VAR NUMBER VAR VAR EXPR FUNC_CALL VAR BIN_OP VAR VAR EXPR FUNC_CALL VAR VAR NUMBER
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
MOD = 998244353 n = int(input()) if n == 1: print(10) exit(0) ans = [10] * n cache = [1] * n cache[0] = 9 for i in range(1, n): cache[i] = cache[i - 1] * 10 % MOD arr = [20] * n for i in range(1, n): arr[i] = arr[i - 1] + 9 for i in range(1, n): ans[i] = arr[i - 1] * cache[i - 1] % MOD print(*ans[::-1])
ASSIGN VAR NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR IF VAR NUMBER EXPR FUNC_CALL VAR NUMBER EXPR FUNC_CALL VAR NUMBER ASSIGN VAR BIN_OP LIST NUMBER VAR ASSIGN VAR BIN_OP LIST NUMBER VAR ASSIGN VAR NUMBER NUMBER FOR VAR FUNC_CALL VAR NUMBER VAR ASSIGN VAR VAR BIN_OP BIN_OP VAR BIN_OP VAR NUMBER NUMBER VAR ASSIGN VAR BIN_OP LIST NUMBER VAR FOR VAR FUNC_CALL VAR NUMBER VAR ASSIGN VAR VAR BIN_OP VAR BIN_OP VAR NUMBER NUMBER FOR VAR FUNC_CALL VAR NUMBER VAR ASSIGN VAR VAR BIN_OP BIN_OP VAR BIN_OP VAR NUMBER VAR BIN_OP VAR NUMBER VAR EXPR FUNC_CALL VAR VAR NUMBER
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
def pow_h(base, degree, module=998244353): degree = bin(degree)[2:] r = 1 for i in range(len(degree) - 1, -1, -1): r = r * base ** int(degree[i]) % module base = base**2 % module return r n = int(input()) for i in range(n, 1, -1): print(pow_h(10, i - 2) * 9 * (20 + 9 * (i - 2)) % 998244353, end=" ") print(10)
FUNC_DEF NUMBER ASSIGN VAR FUNC_CALL VAR VAR NUMBER ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR BIN_OP FUNC_CALL VAR VAR NUMBER NUMBER NUMBER ASSIGN VAR BIN_OP BIN_OP VAR BIN_OP VAR FUNC_CALL VAR VAR VAR VAR ASSIGN VAR BIN_OP BIN_OP VAR NUMBER VAR RETURN VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR NUMBER NUMBER EXPR FUNC_CALL VAR BIN_OP BIN_OP BIN_OP FUNC_CALL VAR NUMBER BIN_OP VAR NUMBER NUMBER BIN_OP NUMBER BIN_OP NUMBER BIN_OP VAR NUMBER NUMBER STRING EXPR FUNC_CALL VAR NUMBER
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
def b(m, n): if m == n: return 10 if m == n - 1: return 10 * 9 * 2 return ( 10 * 9**2 * (n - (m + 2) + 1) * pow(10, n - m - 2, 998244353) + 10 * 9 * 2 * pow(10, n - m - 1, 998244353) ) % 998244353 n = int(input()) print(*[b(i + 1, n) for i in range(n)])
FUNC_DEF IF VAR VAR RETURN NUMBER IF VAR BIN_OP VAR NUMBER RETURN BIN_OP BIN_OP NUMBER NUMBER NUMBER RETURN BIN_OP BIN_OP BIN_OP BIN_OP BIN_OP NUMBER BIN_OP NUMBER NUMBER BIN_OP BIN_OP VAR BIN_OP VAR NUMBER NUMBER FUNC_CALL VAR NUMBER BIN_OP BIN_OP VAR VAR NUMBER NUMBER BIN_OP BIN_OP BIN_OP NUMBER NUMBER NUMBER FUNC_CALL VAR NUMBER BIN_OP BIN_OP VAR VAR NUMBER NUMBER NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR EXPR FUNC_CALL VAR FUNC_CALL VAR BIN_OP VAR NUMBER VAR VAR FUNC_CALL VAR VAR
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
l = [] for i in range(10): l.append(0) def f(n, x): n = str(n) n = "0" * (x - len(n)) + n + "#" prev = 0 for i in range(1, len(n)): now = i if n[i] != n[i - 1]: l[now - prev] += 1 prev = now ans = [] ans.append(10) ans.append(180) diff = 81 for i in range(200006): ans.append((ans[len(ans) - 1] + diff) * 10) ans[len(ans) - 1] %= 998244353 diff = diff * 10 diff = diff % 998244353 n = int(input()) ans2 = ans[0:n][::-1] for i in range(n): print(ans2[i], end=" ")
ASSIGN VAR LIST FOR VAR FUNC_CALL VAR NUMBER EXPR FUNC_CALL VAR NUMBER FUNC_DEF ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR BIN_OP BIN_OP BIN_OP STRING BIN_OP VAR FUNC_CALL VAR VAR VAR STRING ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR NUMBER FUNC_CALL VAR VAR ASSIGN VAR VAR IF VAR VAR VAR BIN_OP VAR NUMBER VAR BIN_OP VAR VAR NUMBER ASSIGN VAR VAR ASSIGN VAR LIST EXPR FUNC_CALL VAR NUMBER EXPR FUNC_CALL VAR NUMBER ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR NUMBER EXPR FUNC_CALL VAR BIN_OP BIN_OP VAR BIN_OP FUNC_CALL VAR VAR NUMBER VAR NUMBER VAR BIN_OP FUNC_CALL VAR VAR NUMBER NUMBER ASSIGN VAR BIN_OP VAR NUMBER ASSIGN VAR BIN_OP VAR NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR VAR NUMBER VAR NUMBER FOR VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR VAR VAR STRING
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
MOD = 998244353 n = int(input()) ans = 0 res = [] for i in range(n): if i == n - 1: res.append(10) else: ans += pow(10, n - i - 2, MOD) ans *= 180 + 81 * (n - i - 2) ans %= MOD res.append(ans) ans = 0 print(*res)
ASSIGN VAR NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR NUMBER ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR IF VAR BIN_OP VAR NUMBER EXPR FUNC_CALL VAR NUMBER VAR FUNC_CALL VAR NUMBER BIN_OP BIN_OP VAR VAR NUMBER VAR VAR BIN_OP NUMBER BIN_OP NUMBER BIN_OP BIN_OP VAR VAR NUMBER VAR VAR EXPR FUNC_CALL VAR VAR ASSIGN VAR NUMBER EXPR FUNC_CALL VAR VAR
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
n = int(input()) pow10 = [1] last = 1 for i in range(1, 200010): last *= 10 last %= 998244353 pow10.append(last) res = [] for i in range(1, n): res.append( int( ( 10 * 9 * 9 * (n - 2 - i + 1) * pow10[n - i - 2] + 2 * 9 * 10 * pow10[n - i - 1] ) % 998244353 ) ) res.append(10) print(" ".join(map(str, res)))
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR LIST NUMBER ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR NUMBER NUMBER VAR NUMBER VAR NUMBER EXPR FUNC_CALL VAR VAR ASSIGN VAR LIST FOR VAR FUNC_CALL VAR NUMBER VAR EXPR FUNC_CALL VAR FUNC_CALL VAR BIN_OP BIN_OP BIN_OP BIN_OP BIN_OP BIN_OP NUMBER NUMBER NUMBER BIN_OP BIN_OP BIN_OP VAR NUMBER VAR NUMBER VAR BIN_OP BIN_OP VAR VAR NUMBER BIN_OP BIN_OP BIN_OP NUMBER NUMBER NUMBER VAR BIN_OP BIN_OP VAR VAR NUMBER NUMBER EXPR FUNC_CALL VAR NUMBER EXPR FUNC_CALL VAR FUNC_CALL STRING FUNC_CALL VAR VAR VAR
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
n = int(input()) q = 998244353 ans = [0] * n for i in range(1, n): ansi = 9 * pow(10, n - i - 1, q) * 2 % q if n - i - 2 >= 0: ansi += 9 * 9 * pow(10, n - i - 2, q) % q * (n - i - 1) % q ans[i - 1] = int(ansi) * 10 % q ans[-1] = 10 print(*ans)
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR NUMBER ASSIGN VAR BIN_OP LIST NUMBER VAR FOR VAR FUNC_CALL VAR NUMBER VAR ASSIGN VAR BIN_OP BIN_OP BIN_OP NUMBER FUNC_CALL VAR NUMBER BIN_OP BIN_OP VAR VAR NUMBER VAR NUMBER VAR IF BIN_OP BIN_OP VAR VAR NUMBER NUMBER VAR BIN_OP BIN_OP BIN_OP BIN_OP BIN_OP NUMBER NUMBER FUNC_CALL VAR NUMBER BIN_OP BIN_OP VAR VAR NUMBER VAR VAR BIN_OP BIN_OP VAR VAR NUMBER VAR ASSIGN VAR BIN_OP VAR NUMBER BIN_OP BIN_OP FUNC_CALL VAR VAR NUMBER VAR ASSIGN VAR NUMBER NUMBER EXPR FUNC_CALL VAR VAR
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
n = int(input()) m = 998244353 for k in range(1, n + 1): if k == n: print(10, end=" ") elif k == n - 1: print(180, end=" ") else: print( 9 % m * ((9 * (n - k) + 11) % m) % m * (pow(10, n - k - 1, m) % m) % m, end=" ", )
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR NUMBER BIN_OP VAR NUMBER IF VAR VAR EXPR FUNC_CALL VAR NUMBER STRING IF VAR BIN_OP VAR NUMBER EXPR FUNC_CALL VAR NUMBER STRING EXPR FUNC_CALL VAR BIN_OP BIN_OP BIN_OP BIN_OP BIN_OP NUMBER VAR BIN_OP BIN_OP BIN_OP NUMBER BIN_OP VAR VAR NUMBER VAR VAR BIN_OP FUNC_CALL VAR NUMBER BIN_OP BIN_OP VAR VAR NUMBER VAR VAR VAR STRING
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
M = 998244353 n = int(input()) ans = [] s = 0 s_m = 0 now = 1 for i in range(1, n + 1): now = now * 10 % M s = (s + s_m) % M el = (i * now - s) % M ans.append(el) s = (s + el) % M s_m = (s_m + el) % M print(" ".join(map(str, ans[::-1])))
ASSIGN VAR NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR LIST ASSIGN VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR NUMBER BIN_OP VAR NUMBER ASSIGN VAR BIN_OP BIN_OP VAR NUMBER VAR ASSIGN VAR BIN_OP BIN_OP VAR VAR VAR ASSIGN VAR BIN_OP BIN_OP BIN_OP VAR VAR VAR VAR EXPR FUNC_CALL VAR VAR ASSIGN VAR BIN_OP BIN_OP VAR VAR VAR ASSIGN VAR BIN_OP BIN_OP VAR VAR VAR EXPR FUNC_CALL VAR FUNC_CALL STRING FUNC_CALL VAR VAR VAR NUMBER
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
p = 998244353 n = int(input()) a = [0] const = 0 cumsum = 0 for i in range(1, n + 1): total = i * pow(10, i, p) % p new = (total - const) % p a.append(new) const += cumsum + 2 * new const %= p cumsum += new cumsum %= p a.reverse() a.pop() print(*a)
ASSIGN VAR NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR LIST NUMBER ASSIGN VAR NUMBER ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR NUMBER BIN_OP VAR NUMBER ASSIGN VAR BIN_OP BIN_OP VAR FUNC_CALL VAR NUMBER VAR VAR VAR ASSIGN VAR BIN_OP BIN_OP VAR VAR VAR EXPR FUNC_CALL VAR VAR VAR BIN_OP VAR BIN_OP NUMBER VAR VAR VAR VAR VAR VAR VAR EXPR FUNC_CALL VAR EXPR FUNC_CALL VAR EXPR FUNC_CALL VAR VAR
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
n = int(input()) ans = [10, 180] if n <= 2: print(" ".join([str(i) for i in ans[:n][::-1]])) exit() m = 1 MOD = 998244353 for i in range(n - 2): m *= 10 m %= MOD nxt = ans[-1] * 10 + 81 * m nxt %= MOD ans.append(nxt) print(" ".join([str(i) for i in ans[::-1]]))
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR LIST NUMBER NUMBER IF VAR NUMBER EXPR FUNC_CALL VAR FUNC_CALL STRING FUNC_CALL VAR VAR VAR VAR VAR NUMBER EXPR FUNC_CALL VAR ASSIGN VAR NUMBER ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR BIN_OP VAR NUMBER VAR NUMBER VAR VAR ASSIGN VAR BIN_OP BIN_OP VAR NUMBER NUMBER BIN_OP NUMBER VAR VAR VAR EXPR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR FUNC_CALL STRING FUNC_CALL VAR VAR VAR VAR NUMBER
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
n = int(input()) dp = [0] * (n + 1) mod = 998244353 dp[n] = 10 for i in range(n - 1, 0, -1): dp[i] = (n - i + 1) * pow(10, n - i + 1, mod) % mod psum = [0] * (n + 2) value = [0] * (n + 1) subs = [0] * (n + 1) value[n] = dp[n] psum[n] = dp[n] for i in range(n - 1, 0, -1): subs[i] = (subs[i + 1] + psum[i + 2] + 2 * value[i + 1]) % mod value[i] = (dp[i] - subs[i]) % mod psum[i] = (psum[i + 1] + value[i]) % mod print(*value[1:])
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR BIN_OP LIST NUMBER BIN_OP VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR VAR NUMBER FOR VAR FUNC_CALL VAR BIN_OP VAR NUMBER NUMBER NUMBER ASSIGN VAR VAR BIN_OP BIN_OP BIN_OP BIN_OP VAR VAR NUMBER FUNC_CALL VAR NUMBER BIN_OP BIN_OP VAR VAR NUMBER VAR VAR ASSIGN VAR BIN_OP LIST NUMBER BIN_OP VAR NUMBER ASSIGN VAR BIN_OP LIST NUMBER BIN_OP VAR NUMBER ASSIGN VAR BIN_OP LIST NUMBER BIN_OP VAR NUMBER ASSIGN VAR VAR VAR VAR ASSIGN VAR VAR VAR VAR FOR VAR FUNC_CALL VAR BIN_OP VAR NUMBER NUMBER NUMBER ASSIGN VAR VAR BIN_OP BIN_OP BIN_OP VAR BIN_OP VAR NUMBER VAR BIN_OP VAR NUMBER BIN_OP NUMBER VAR BIN_OP VAR NUMBER VAR ASSIGN VAR VAR BIN_OP BIN_OP VAR VAR VAR VAR VAR ASSIGN VAR VAR BIN_OP BIN_OP VAR BIN_OP VAR NUMBER VAR VAR VAR EXPR FUNC_CALL VAR VAR NUMBER
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
n = int(input()) p = 998244353 ans = [0] * n dp = 10 stp = 10 mn = 1 ans[n - 1] = 10 for i in range(n - 2, -1, -1): ans[i] = (mn + 1) * (stp * 10) % p - dp - stp * mn % p dp += ans[i] dp %= p stp *= 10 stp %= p mn += 1 print(*[(i % p) for i in ans])
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR NUMBER ASSIGN VAR BIN_OP LIST NUMBER VAR ASSIGN VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR BIN_OP VAR NUMBER NUMBER FOR VAR FUNC_CALL VAR BIN_OP VAR NUMBER NUMBER NUMBER ASSIGN VAR VAR BIN_OP BIN_OP BIN_OP BIN_OP BIN_OP VAR NUMBER BIN_OP VAR NUMBER VAR VAR BIN_OP BIN_OP VAR VAR VAR VAR VAR VAR VAR VAR VAR NUMBER VAR VAR VAR NUMBER EXPR FUNC_CALL VAR BIN_OP VAR VAR VAR VAR
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
import sys MOD = 998244353 n = int(sys.stdin.readline().rstrip()) table = [None] * (n + 1) table[0] = 1 for i in range(n): table[i + 1] = table[i] * 10 % MOD def main(): s = [None] * (n + 1) t = [None] * (n + 1) res = [None] * (n + 1) res[0] = s[0] = t[0] = 0 for i in range(1, n + 1): res[i] = (i * table[i] % MOD - t[i - 1]) % MOD res[i] %= MOD s[i] = (s[i - 1] + res[i]) % MOD t[i] = (t[i - 1] + res[i] + s[i]) % MOD return res[1:][::-1] ans = main() print(*ans, sep=" ")
IMPORT ASSIGN VAR NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR BIN_OP LIST NONE BIN_OP VAR NUMBER ASSIGN VAR NUMBER NUMBER FOR VAR FUNC_CALL VAR VAR ASSIGN VAR BIN_OP VAR NUMBER BIN_OP BIN_OP VAR VAR NUMBER VAR FUNC_DEF ASSIGN VAR BIN_OP LIST NONE BIN_OP VAR NUMBER ASSIGN VAR BIN_OP LIST NONE BIN_OP VAR NUMBER ASSIGN VAR BIN_OP LIST NONE BIN_OP VAR NUMBER ASSIGN VAR NUMBER VAR NUMBER VAR NUMBER NUMBER FOR VAR FUNC_CALL VAR NUMBER BIN_OP VAR NUMBER ASSIGN VAR VAR BIN_OP BIN_OP BIN_OP BIN_OP VAR VAR VAR VAR VAR BIN_OP VAR NUMBER VAR VAR VAR VAR ASSIGN VAR VAR BIN_OP BIN_OP VAR BIN_OP VAR NUMBER VAR VAR VAR ASSIGN VAR VAR BIN_OP BIN_OP BIN_OP VAR BIN_OP VAR NUMBER VAR VAR VAR VAR VAR RETURN VAR NUMBER NUMBER ASSIGN VAR FUNC_CALL VAR EXPR FUNC_CALL VAR VAR STRING
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
n = int(input()) p = [1] MOD = 998244353 for _ in range(n + 10): p.append(p[-1] * 10 % MOD) ans = [0] * (n + 1) for i in range(1, n + 1): if i == n: ans[i] = 10 else: ans[i] = ( 2 * 10 * 9 * p[n - i - 1] + (n - i - 1) * 10 * 9 * 9 * p[n - i - 2] ) % MOD print(*ans[1:])
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR LIST NUMBER ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR BIN_OP VAR NUMBER EXPR FUNC_CALL VAR BIN_OP BIN_OP VAR NUMBER NUMBER VAR ASSIGN VAR BIN_OP LIST NUMBER BIN_OP VAR NUMBER FOR VAR FUNC_CALL VAR NUMBER BIN_OP VAR NUMBER IF VAR VAR ASSIGN VAR VAR NUMBER ASSIGN VAR VAR BIN_OP BIN_OP BIN_OP BIN_OP BIN_OP NUMBER NUMBER NUMBER VAR BIN_OP BIN_OP VAR VAR NUMBER BIN_OP BIN_OP BIN_OP BIN_OP BIN_OP BIN_OP VAR VAR NUMBER NUMBER NUMBER NUMBER VAR BIN_OP BIN_OP VAR VAR NUMBER VAR EXPR FUNC_CALL VAR VAR NUMBER
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
n = int(input()) li = [0] * n li[n - 1] = 10 mod = 998244353 tenMult = 1 for i in range(n - 2, -1, -1): li[i] = (2 * (tenMult * 10) * 9 + tenMult * 81 * (n - 2 - i)) % mod tenMult *= 10 tenMult %= mod print(*li)
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR BIN_OP LIST NUMBER VAR ASSIGN VAR BIN_OP VAR NUMBER NUMBER ASSIGN VAR NUMBER ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR BIN_OP VAR NUMBER NUMBER NUMBER ASSIGN VAR VAR BIN_OP BIN_OP BIN_OP BIN_OP NUMBER BIN_OP VAR NUMBER NUMBER BIN_OP BIN_OP VAR NUMBER BIN_OP BIN_OP VAR NUMBER VAR VAR VAR NUMBER VAR VAR EXPR FUNC_CALL VAR VAR
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
import sys MOD = 998244353 n = int(input()) if n == 1: print("10") sys.exit(0) p9 = 90 p8 = 81 ls = ["10", "180"] for free in range(2, n): r = 10 * (p9 * 2 + p8 * (free - 1)) p9 *= 10 p9 %= MOD p8 *= 10 p8 %= MOD ls.append(str(r % MOD)) ls = ls[::-1] print(" ".join(ls))
IMPORT ASSIGN VAR NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR IF VAR NUMBER EXPR FUNC_CALL VAR STRING EXPR FUNC_CALL VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR LIST STRING STRING FOR VAR FUNC_CALL VAR NUMBER VAR ASSIGN VAR BIN_OP NUMBER BIN_OP BIN_OP VAR NUMBER BIN_OP VAR BIN_OP VAR NUMBER VAR NUMBER VAR VAR VAR NUMBER VAR VAR EXPR FUNC_CALL VAR FUNC_CALL VAR BIN_OP VAR VAR ASSIGN VAR VAR NUMBER EXPR FUNC_CALL VAR FUNC_CALL STRING VAR
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
def power(x, y, p): res = 1 x = x % p while y > 0: if y & 1: res = res * x % p y = y >> 1 x = x * x % p return res n = int(input()) for k in range(1, n + 1): if k != n: x = pow(10, n - k - 1, 998244353) print(int(2 * 9 * 10 * x + (n - k - 1) * 81 * x) % 998244353, end=" ") else: print(10)
FUNC_DEF ASSIGN VAR NUMBER ASSIGN VAR BIN_OP VAR VAR WHILE VAR NUMBER IF BIN_OP VAR NUMBER ASSIGN VAR BIN_OP BIN_OP VAR VAR VAR ASSIGN VAR BIN_OP VAR NUMBER ASSIGN VAR BIN_OP BIN_OP VAR VAR VAR RETURN VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR NUMBER BIN_OP VAR NUMBER IF VAR VAR ASSIGN VAR FUNC_CALL VAR NUMBER BIN_OP BIN_OP VAR VAR NUMBER NUMBER EXPR FUNC_CALL VAR BIN_OP FUNC_CALL VAR BIN_OP BIN_OP BIN_OP BIN_OP NUMBER NUMBER NUMBER VAR BIN_OP BIN_OP BIN_OP BIN_OP VAR VAR NUMBER NUMBER VAR NUMBER STRING EXPR FUNC_CALL VAR NUMBER
You wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999. A block in an integer $x$ is a consecutive segment of equal digits that cannot be extended to the left or to the right. For example, in the integer $00027734000$ there are three blocks of length $1$, one block of length $2$ and two blocks of length $3$. For all integers $i$ from $1$ to $n$ count the number of blocks of length $i$ among the written down integers. Since these integers may be too large, print them modulo $998244353$. -----Input----- The only line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$). -----Output----- In the only line print $n$ integers. The $i$-th integer is equal to the number of blocks of length $i$. Since these integers may be too large, print them modulo $998244353$. -----Examples----- Input 1 Output 10 Input 2 Output 180 10
def f(n): if n == 1: return "10" if n == 2: return "180 10" s = 10 + 180 p = 90 g = [0] * (n - 2) + [180, 10] m = 998244353 for i in range(n - 3, -1, -1): g[i] = ((s + p) * 10 - s) % m s = (s + g[i]) % m p = p * 10 % m return " ".join(map(str, g)) def main(): n = int(input()) print(f(n)) main()
FUNC_DEF IF VAR NUMBER RETURN STRING IF VAR NUMBER RETURN STRING ASSIGN VAR BIN_OP NUMBER NUMBER ASSIGN VAR NUMBER ASSIGN VAR BIN_OP BIN_OP LIST NUMBER BIN_OP VAR NUMBER LIST NUMBER NUMBER ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR BIN_OP VAR NUMBER NUMBER NUMBER ASSIGN VAR VAR BIN_OP BIN_OP BIN_OP BIN_OP VAR VAR NUMBER VAR VAR ASSIGN VAR BIN_OP BIN_OP VAR VAR VAR VAR ASSIGN VAR BIN_OP BIN_OP VAR NUMBER VAR RETURN FUNC_CALL STRING FUNC_CALL VAR VAR VAR FUNC_DEF ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR EXPR FUNC_CALL VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR