結果

問題 No.1086 桁和の桁和2
ユーザー mkawa2mkawa2
提出日時 2022-07-17 18:20:40
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 991 bytes
コンパイル時間 420 ms
コンパイル使用メモリ 86,968 KB
実行使用メモリ 107,604 KB
最終ジャッジ日時 2023-09-12 06:33:24
合計ジャッジ時間 14,882 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
71,292 KB
testcase_01 AC 77 ms
71,124 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 78 ms
71,184 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 127 ms
76,956 KB
testcase_16 AC 345 ms
96,040 KB
testcase_17 AC 106 ms
76,580 KB
testcase_18 WA -
testcase_19 AC 383 ms
100,300 KB
testcase_20 AC 119 ms
76,804 KB
testcase_21 AC 339 ms
95,148 KB
testcase_22 AC 451 ms
107,184 KB
testcase_23 AC 303 ms
93,148 KB
testcase_24 AC 233 ms
86,768 KB
testcase_25 AC 389 ms
102,920 KB
testcase_26 AC 334 ms
94,804 KB
testcase_27 AC 262 ms
88,588 KB
testcase_28 AC 232 ms
85,388 KB
testcase_29 WA -
testcase_30 AC 460 ms
106,572 KB
testcase_31 AC 461 ms
107,568 KB
testcase_32 WA -
testcase_33 AC 458 ms
107,396 KB
testcase_34 AC 460 ms
106,700 KB
testcase_35 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

# sys.setrecursionlimit(200005)
int1 = lambda x: int(x)-1
pDB = lambda *x: print(*x, end="\n", file=sys.stderr)
p2D = lambda x: print(*x, sep="\n", end="\n\n", file=sys.stderr)
def II(): return int(sys.stdin.readline())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def LI1(): return list(map(int1, sys.stdin.readline().split()))
def LLI1(rows_number): return [LI1() for _ in range(rows_number)]
def SI(): return sys.stdin.readline().rstrip()
dij = [(0, 1), (-1, 0), (0, -1), (1, 0)]
# dij = [(0, 1), (-1, 0), (0, -1), (1, 0), (1, 1), (1, -1), (-1, 1), (-1, -1)]
inf = (1 << 63)-1
# inf = (1 << 31)-1
md = 10**9+7
# md = 998244353

def cnt(e):
    return (pow(10, e, md)-1)*inv%md

inv = pow(9, md-2, md)
n = II()
ll = LI()
rr = LI()
dd = LI()

ans = 1
pd = 0
for l, r, d in zip(ll, rr, dd):
    cur = cnt(r)-cnt(l)
    if (d-pd)%9 == 0: cur += 1
    ans *= cur
    ans %= md
    pd = d

print(ans)
0